Hi, I have some random data and i want to find out the parameters of Beta distribution ( a and b) such that this data approximately fits into this distribution. I have tried by plot the histograms and graph, but it requires lot of tuning and i am unable to do that. can anyone tell me how to do it programmitically in R? Regards, Som Shekhar
library(MASS) fitdistr(x,"beta",list(shape1=1,shape2=1)) On Tue, May 3, 2011 at 9:44 PM, Shekhar <shekhar2581 at gmail.com> wrote:> > Hi, > I have some random data and i want to find out the parameters of Beta > distribution ( a and b) such that this data approximately fits into > this distribution. I have tried by plot the histograms and graph, but > it requires lot of tuning and i am unable to do that. can anyone tell > me how to do it programmitically in R? > > Regards, > Som Shekhar > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
David Winsemius
2011-May-12 11:32 UTC
[R] How to fit a random data into Beta distribution?
On May 11, 2011, at 11:17 PM, MikeK wrote:> I am also trying to fit data to a beta distribution. > > In Ang and Tang, Probability Concepts in Engineering, 2nd Ed., page > 127-9, > they describe a variant of a beta distribution with additional > parameters > than the standard beta distribution, enabling specification of a max > and min > value other than 0,1. This would be very useful for my purposes. > > Any thoughts on how to fit a distribution directly to this variant > of the > beta distribution, without starting from scratch? >Scale your data to [0,1], fit, predict, invert the scaling. xscaled <- (x-min(x))/max(x) .... xrescaled <- max(x)*xscaled + min(x) (Better check that I made the correct order of those operations. The first attempt was wrong ... I think.) -- David Winsemius, MD West Hartford, CT