[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] , 
> a.grad_potstmu,args=(10,0,0),disp=1)
> Optimization terminated successfully.
>          Current function value: -3464534650.284432
>          Iterations: 3
>          Function evaluations: 51
>          Gradient evaluations: 9
>          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

R(v) = dot(v.T,A*v)/dot(v.T,B*v)  \quad    R \in \mathds{R},\quad v \in
\mathds{R}^n

where v is a vector. Please can you expand on your function potstmu.
 
Nils



More information about the SciPy-user mailing list