Re: [Matplotlib-users] power law fitting of data

2007-12-28 Thread Jessica Lu
Hi Johann, I believe the scipy optimization package gives a variety of optimization algorithms but you would have to implement your own codes to fix/thaw parameters. That being said, there is a lot there and I haven't dug into all of it into detail. I would suggest posting a message to the

Re: [Matplotlib-users] power law fitting of data

2007-12-26 Thread Johann Cohen-Tanugi
hi jessica, thanks So scipy.optmizer as it stands cannot do that? I gues I should move the issue to the scipy list then. Yes there is mpfit, there is also pyminuit in google.code that is wrapper of the high energy physics standard package MINUIT, etc but I would think that fitting data,

Re: [Matplotlib-users] power law fitting of data

2007-12-26 Thread william ratcliff
Is there a new version of this which uses numpy instead of Numeric? I found the old Numeric version to work very well. cheers, William On Dec 26, 2007 12:58 PM, Jessica Lu <[EMAIL PROTECTED]> wrote: > Hi Johann, > > I would recommend using the python mpfit module: > > http://cars9.uchicago.edu/

Re: [Matplotlib-users] power law fitting of data

2007-12-26 Thread Jessica Lu
Hi Johann, I would recommend using the python mpfit module: http://cars9.uchicago.edu/software/python/mpfit.html Cheers, Jessica On Dec 22, 2007, at 8:57 PM, Johann Cohen-Tanugi wrote: > hi jessica, > This FittingData tutorial is very nice. Could you illustrate how to > fix/thaw parameters? >

Re: [Matplotlib-users] power law fitting of data

2007-12-22 Thread Johann Cohen-Tanugi
hi jessica, This FittingData tutorial is very nice. Could you illustrate how to fix/thaw parameters? I did not find any such attribute and when I try some kludges they fail with a msg saying : shape mismatch: objects cannot be broadcast to a single shape thanks, Johann ---

Re: [Matplotlib-users] power law fitting of data

2007-12-06 Thread Jessica Lu
Hi, I just happened to do the same thing two days ago. If you want uncertainties as well, here is some code that uses scipy.optimize. I just put up a preliminary example on the scipy wiki: http://www.scipy.org/Cookbook/FittingData?action=show Not the cleanest or most sophisticated code in th

Re: [Matplotlib-users] power law fitting of data

2007-12-06 Thread Ryan May
Ping Yeh wrote: > 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. > If you just want quick power law fit without turning to the other solutions, you can just transfor

Re: [Matplotlib-users] power law fitting of data

2007-12-06 Thread Ping Yeh
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, mi

Re: [Matplotlib-users] power law fitting of data

2007-12-05 Thread Matthieu Brucher
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/Opt

Re: [Matplotlib-users] power law fitting of data

2007-12-05 Thread Barry Wark
Ping, You should investigate scipy.optimize.lsqFit for using least squares to fit an arbitrary function and scipy.odr for regular or orthogonal least squares fitting. barry On Dec 5, 2007 9:45 PM, Ping Yeh <[EMAIL PROTECTED]> wrote: > Hi, > > I have (x,y) data that I want to fit to the formula >

[Matplotlib-users] power law fitting of data

2007-12-05 Thread Ping Yeh
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 p