[SciPy-user] (no subject)

Ryan Krauss ryanlists at gmail.com
Thu May 18 13:51:57 EDT 2006


I think this can be done really simply using sciy.optimize.fmin

Create a function that takes a vector of input coefficents and returns
a scalar value you want to minimze - the sum of the squared error.

Then pass that function to fmin:
scipy.optimize.fmin(myfunc,[initial_guess_vector])

Check out help(scipy.optimize.fmin) and let me know if you need more
help getting started.

Ryan

On 5/18/06, Steve Lidia <SMLidia at lbl.gov> wrote:
> Hi folks,
>
> I'm looking for a simple example of constructing a least squares fit
> to a multi-component function, ie. fit one set of parameters to the
> function f=(f1,f2,f3,...) where f1, f2, f3, ... all take the same
> parameters but have (somewhat) different functional forms and
> different data to fit to.
>
> Is there a simple example somewhere that I can adapt?
>
> Please cc your reply to this email directly.
>
> Thanks,
>
> Steve
>
> __________________________________________
> Steve Lidia
> Center For Beam Physics
> MS 71R0259
> Lawrence Berkeley National Laboratory
> 1 Cyclotron Road
> Berkeley, CA 94720 USA
> +1.510.486.6101
> __________________________________________
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>




More information about the SciPy-User mailing list