[SciPy-User] [SciPy-user] Error using fmin
Wed Feb 22 07:53:26 CST 2012
On Wed, Feb 22, 2012 at 8:41 AM, RDX <email@example.com> wrote:
> I am using fmin and it returns initial guess as the final solution.
> def Traug (v):
> Traug_RHOB = v + v*(z_den_s/3125.0)**v
> count =arange(size(den_s))
> for i in count:
> err += abs(den_s[i] - Traug_RHOB [i])
> return err
my first guess is that fmin doesn't like the abs, you could try with a
quadratic loss instead to see whether it works and whether there are
If den_s[i] is an array, then you could vectorize the loop
> vO=[1.6, 0.5, 0.35]
> t=fmin(Traug,vO )
> a=t; b=t; c=t;
> Code gives me a=1.6, b=0.5, c=0.35, which is my initial guess.
> What is wrong? Many thanks in advance.
> View this message in context: http://old.nabble.com/Error-using-fmin-tp33370870p33370870.html
> Sent from the Scipy-User mailing list archive at Nabble.com.
> SciPy-User mailing list
More information about the SciPy-User