[R] Error code 100 when using the function “fitdist” from the fitdistrplus package
nell.redu at hotmail.fr
Thu Aug 4 01:42:05 CEST 2016
Nelly Reduan has shared OneDrive?files with you. To view them, click the link or image below.
Im 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.
[[alternative HTML version deleted]]
More information about the R-help