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)
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
Message-ID:
<CY1PR05MB273096661508FB9CC810988A99060@CY1PR05MB2730.namprd05.prod.outlook.com>
In-Reply-To:
<CY1PR05MB273009CDE13950D9A4E9B9E199060@CY1PR05MB2730.namprd05.prod.outlook.com>