# [SciPy-user] optimize.fmin_cg

Nils Wagner nwagner@iam.uni-stuttgart...
Tue Mar 6 08:32:51 CST 2007

Mathias Wagner wrote:
> Hi,
>
> I use optimize.fmin_cg to find the minimum of 1-dimensional and n-dimensional
> functions.
>
> For 1-dimensional functions everything is fine, but for n-dimensional
> functions I get a strange result.
>
> The function returns an array-of-array-of-arry depending on the number of
> iterations, for example I get
>
> In [6]:scipy.optimize.fmin_ncg(a.potstmu, [60.0] ,
> Optimization terminated successfully.
>          Current function value: -3464534650.284432
>          Iterations: 3
>          Function evaluations: 51
>          Hessian evaluations: 0
> Out[6]:array([[[[[[[[[[[ 121.31834513]]]]]]]]]]])
>
>
> The function potstmu is quite complicated, I am still searching for an easier
> example which needs more than 1 iteration.
> Can anyone confirm this behavior?
> Or is it a problem with my function?
>
>
> Mathias
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
Hi Mathias,

Maybe I am missing something, but you can't optimize vector valued
functions.

For example you can optimize the Rayleigh quotient