Re: [R] 'fitdistr' and two views of the same data?

From: <>
Date: Thu 19 May 2005 - 01:39:06 EST


There is nothing wrong here. I rerun your example and got the same parameters. Your only "problem" is that you let the density plot use the default limits on x, which are not reasonable here since your data extends to over 200. Try this:

hist(dd, freq=FALSE) #dd is your original data xx <- seq(0, 300, by=.1)
yy <- dweibull(xx, shape=1.5079, scale=60.2139) lines(xx, yy, col=2)

BTW, when you binned your data you also scaled it down by 20, so your scale parameter changed accordingly.



Andy Jaworski
Process Laboratory
3M Corporate Research Laboratory

Tel: (651) 733-6092
Fax: (651) 736-3122
             Matt Jadud                                                    

> To
Sent by: r-help-bounces@st cc Subject [R] 'fitdistr' and two views of the 05/18/2005 09:34 same data? AM Please respond to Matt Jadud < >


I have detailed (with pictures and whatnot) my question on my weblog at

The short version of the question is this:

When I ask 'fitdistr' to try and fit my distribution as a "weibull" distribution, it comes up with some rather wacky parameters.

If I take the same distribution, and do something like

newdist <- mapply(function(x) ((x %/% 20) + 1), origdist)

which effectively forces the data into a histogram, 'fitdist' on 'newdist' gives me an entirely different set of parameters. Distressingly, the parameters it gives me are, upon inspection, good; that is, the parameters reported fit the distribution of the original data much better than 'fitdist' of 'origdist'.

Unfortunately, I'm not savvy enough to tease this out beyond "inspection." The weblog entry has the original distribution, plots, and whatnot explaining my question in more detail. My question(s) are repeated at the bottom of the post, as well as this email address. Any help or insights are appreciated; no doubt, I've done something... well, wrong.

Many thanks,
Matt mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Thu May 19 01:53:53 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:50 EST