Hi Nelly,
The message David suggested was about scaling the values, not
adjusting the parameters. It is quite possible that the empirical
distribution is nothing like beta or Weibull. Have you tried plotting
the values with "density"?

Jim


On Fri, Aug 5, 2016 at 6:56 AM, Nelly Reduan <[email protected]> wrote:
> Hello,
>
>
> Thanks David for your answer. I tested different parameters for Beta and 
> Weibull distributions based on forums but I didn't find solutions.
>
>
> Thank you very much for your time.
>
> Have a nice day
>
> Nell
>
> ________________________________
> De : David Winsemius <[email protected]>
> Envoyé : jeudi 4 août 2016 08:45:01
> À : Nelly Reduan
> Cc : [email protected]
> Objet : Re: [R] Error code 100 when using the function “fitdist” from the 
> fitdistrplus package
>
>
>> On Aug 3, 2016, at 4:42 PM, Nelly Reduan <[email protected]> wrote:
>>
>> 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>
>>
>
> Cannot get anything useful from that URL.
>
>>
>> <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
>
> A bit of searching produces this:
>
> http://markmail.org/search/?q=list%3Aorg.r-project.r-help+fitdistrplus+error+code+100#query:list%3Aorg.r-project.r-help%20fitdistrplus%20error%20code%20100+page:1+mid:esp2okcorrdichtj+state:results
>
>
>
> --
> David.
>>
>>
>>
>> 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]]
>>
>> ______________________________________________
>> [email protected] 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.
>
> David Winsemius
> Alameda, CA, USA
>
>
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> [email protected] 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.

______________________________________________
[email protected] 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