[R] Non standard Beta Distribution

David Winsemius dwinsemius at comcast.net
Thu May 4 16:52:05 CEST 2017


> On May 3, 2017, at 11:43 PM, Collins Ochieng Onyanga <collins at aims.ac.tz> wrote:
> 
> Hi, 
> 
> I would like to fit a non standard beta distribution with the two scale parameters and lower and upper boundaries to data like  the one shown without normalizing it.
> [1] 37.50 46.79 48.30 46.04 43.40 39.25 38.49 49.51 40.38 36.98 40.00
> [12] 38.49 37.74 47.92 44.53 44.91 44.91 40.00 41.51 47.92 36.98 43.40
> [23] 42.26 41.89 38.87 43.02 39.25 40.38 42.64 36.98 44.15 44.91 43.40
> [34] 49.81 38.87 40.00 52.45 53.13 47.92 52.45 44.91 29.54 27.13 35.60
> 
> I have tried using the following code;
> 
> fitdist((Z1-r)/(t-r) , "beta", method = "mme",lower=c(0,0))
> 
> but with this I am normalizing the data to be in the interval (0,1) .

So what's wrong with using that approach? If you try to re-invent the wheel, you will lose efficiency since dbata, qbeta and pbeta are all coded in C. Is the back-transformation difficult? 

The help page for fitdistrplus::fitdist has a worked example of defining a three-member dpq-distribution family. Admittedly the mathematical expression for the more general presented at the NIST document is mildly complex, but this now appears to be a request to satisfy a homework assignment. I never took a math-stats course, but this task doesn't appear particularly difficult, only tedious. And the Posting Guide says rhelp is not for homework. That rule would probably be relaxed if you showed greater effort at creating a 3 member set of gbeta distribution function, but I haven't seen that level of effort yet.

-- 
David.
> 
> 
> Thanks.
> 
> On 4 May 2017 at 03:27, David Winsemius <dwinsemius at comcast.net> wrote:
> 
> > On May 3, 2017, at 3:55 PM, Collins Ochieng Onyanga <collins at aims.ac.tz> wrote:
> >
> > On 4 May 2017 at 01:00, Collins Ochieng Onyanga <collins at aims.ac.tz> wrote:
> >
> >> Hi,
> >>
> >> I am trying to fit fit a non standard Beta distribution to a data set  but
> >> so far I have not succeeded. Can anyone help me with a code in R that can
> >> do this.
> >>
> >> Thanks.
> >
> To Collins Ochieng Onyanga;
> 
> 

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list