Ahhh... Yes, I should turn to scipy for this. Great suggestion!

I'll look for least square fit and maximum likelihood fit.

My next question is about plotting any function f(x) on top of data.
I know I could just produce enough (x,y) points and plot(x,y).
But a convenience function like plot(f, minx, maxx) would be great.
If there is no existing one I can write one.

cheers,
Ping

On Dec 6, 2007 2:50 PM, Matthieu Brucher <[EMAIL PROTECTED]> wrote:
> Hi,
>
> You could use another package, like openopt and the generic optimizers that
> give you what you want provided that you create at least the gradient  of
> the function (I didn't create a class that can numerically derive a fit
> function).
> For instance
> http://projects.scipy.org/scipy/scikits/wiki/Optimization/tutorial#FittingData
> gives you an example.
>
> Matthieu
>
> 2007/12/6, Ping Yeh <[EMAIL PROTECTED]>:
> >
> >
> >
> > Hi,
> >
> > I have (x,y) data that I want to fit to the formula
> > y = a * x^b
> > to determine a and b. How can I do it? The current
> > manual only lists linear fit and polynomial fit.
> >
> > Or, putting it in a more general setting, is there a
> > module to do fitting to an arbitrary function?
> > It would be something like
> >
> > pars = fit(x, y, func)
> >
> > where func is a function like
> >
> > y = func(x, pars)
> >
> > with pars a 1-D array.
> >
> > Thanks,
> > Ping
> >
> >
> > -------------------------------------------------------------------------
> > SF.Net email is sponsored by: The Future of Linux Business White Paper
> > from Novell.  From the desktop to the data center, Linux is going
> > mainstream.  Let it simplify your IT future.
> > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> > _______________________________________________
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
>
>
> --
> French PhD student
> Website : http://miles.developpez.com/
> Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
> LinkedIn : http://www.linkedin.com/in/matthieubrucher
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to