# [Numpy-discussion] Fitting a curve on a log-normal distributed data

Gökhan Sever gokhansever@gmail....
Fri Nov 20 12:27:48 CST 2009

```On Thu, Nov 19, 2009 at 9:12 PM, Ian Mallett <geometrian@gmail.com> wrote:

> Hello,
>
> My analysis shows that the exponential regression gives the best result
> (r^2=87%)--power regression gives worse results (r^2=77%).  Untransformed
> data gives r^2=76%.
>
> I don't think you want lognorm.  If I'm not mistaken, that fits the data to
> a log(normal distribution random variable).
>

Lognormal fitting is the motivation behind my study since aerosol in the
atmosphere typically log-normally size distributed. See for an example case
:
http://webmathematica.seas.harvard.edu/webMathematica/AerosolCalculator.jsp

Of course this is just a simplification. There are other approaches to
represent the size-distribution besides the lognormal. So my intention is
not actually find the best fit but represent the actuality as much as I can.

>
> So, take the logarithm (to any base) of all the "conc" values.  Then do a
> linear regression on those values versus "sizes".
>
> Try (semi-pseudocode):
> slope, intercept, p, error = scipy.stats.linregress(sizes,log(conc))
>

linregress also returns the r_value which I am not sure if the documentation
from the web-based editor checked-in completely to the scipy trunk yet.

>
> Ian
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>

--
Gökhan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20091120/fe4a781d/attachment.html
```