Alexandre Furlan
2016-11-04 17:13:26 UTC
---------- Forwarded message ----------
From: Alexandre Furlan <***@gmail.com>
Date: 2016-11-04 14:59 GMT-02:00
Subject: using curve_fit with a fixed parameter
To: scipy-***@scipy.org
Hi all,
I need to make a least square method of a model function, but a parameter
of my
model function is fixed (I don't change it). I my case, I have :
def func(i,rij,eps,sigma) :
where, i is similar "x", rij is a array used to obtain some parameters of
the function, and
eps and sigma are parameter that I want to optimize. I order to optimize
these parameters I'm doing :
for i in arange(len(rij)/natoms) :
popt,pcov = curve_fit(LJ(i,rij,eps,sigma), x,Ek)
where x = x[i] and Ek[i]. When make it, I have :
TypeError('{!r} is not a Python function'.format(func))
TypeError: -0.019566048015813797 is not a Python function
Do you known how to do this type of optmization using curve_fit ?
many thanks for all
Best
Alexandre
From: Alexandre Furlan <***@gmail.com>
Date: 2016-11-04 14:59 GMT-02:00
Subject: using curve_fit with a fixed parameter
To: scipy-***@scipy.org
Hi all,
I need to make a least square method of a model function, but a parameter
of my
model function is fixed (I don't change it). I my case, I have :
def func(i,rij,eps,sigma) :
where, i is similar "x", rij is a array used to obtain some parameters of
the function, and
eps and sigma are parameter that I want to optimize. I order to optimize
these parameters I'm doing :
for i in arange(len(rij)/natoms) :
popt,pcov = curve_fit(LJ(i,rij,eps,sigma), x,Ek)
where x = x[i] and Ek[i]. When make it, I have :
TypeError('{!r} is not a Python function'.format(func))
TypeError: -0.019566048015813797 is not a Python function
Do you known how to do this type of optmization using curve_fit ?
many thanks for all
Best
Alexandre