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 transform your variables to make it a linear fit
problem:

log(y) = log(a * x^b) = log(a) + b * log(x)

So just do the linear regression with the logarithms of x and y, and the
slope you get back will be b, and the intercept will be log(a).

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

-------------------------------------------------------------------------
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