Nelly Reduan has shared OneDrive?files with you. To view them, click the link 
or image below.


<https://1drv.ms/u/s!Apkg2VlgfYyDgQo8BnoB_Ds4KXgR>
[https://bzmvxw.by3301.livefilestore.com/y3mor2T_TYssPck9iMngzQsuiM_z140uCxN_MOvDhcRAILsrvwtWQ8cMMtzUvEuWjFYFytobNNvH8TJGzIrV7tjUHcKnVG_E76ru3RJEpGNPM3v-gKVJgYLhZPb9gLcQST6h-N6UtMumzrF9xVxCaWwJjLJ7amvLtDs816OaSSttsA?width=200&height=150&cropmode=center]<https://1drv.ms/u/s!Apkg2VlgfYyDgQo8BnoB_Ds4KXgR>


<https://1drv.ms/u/s!Apkg2VlgfYyDgQmEe6HOjP3d_4e2>
[https://r1.res.office365.com/owa/prem/images/dc-jpg_20.png]<https://1drv.ms/u/s!Apkg2VlgfYyDgQmEe6HOjP3d_4e2>

Figure_1.jpeg<https://1drv.ms/u/s!Apkg2VlgfYyDgQmEe6HOjP3d_4e2>




Hello,

I�m trying to fit distributions to data. To do this, I used the function 
�fitdist� from the fitdistrplus package and I drew a Cullen and Frey graph 
(attached Figure 1). From this graph, I am attempting to fit different 
distributions: Beta, Gamma and Weibull. The function �fitdist� works with Gamma 
distribution from this code:

Fit.dist <- fitdist(x[x!=0], distr="gamma", method="mle",lower=c(0, 
0),start=list(scale=1,shape=1))

However, with Beta and Weibull distributions, I obtain this error message:

  the function mle failed to estimate the parameters,

                with the error code 100



Here is my code to fit Beta and Weibull distributions:

fit.dist <- fitdist(x_scaled, distr="beta", method = "mle")

fit.dist <- fitdist(x, distr="weibull", method="mle", lower=c(0, 0))

For the Beta distribution, I transformed the variable to have values between 0 
and 1 as follows:

x_scaled  <- (x-min(x))/max(x)

Here are some information about data (summary() and attached Figure 2)

> summary(x)

   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.

    0.0    90.4   244.8   437.4   549.4  4904.0

 How can I fit Gamma and Weibull distributions to my data without having the 
error message ?

Thank you very much for your time.

Nell


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to