-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fitting truncated gamma distribution to simulated data yields unexpected result #21
Comments
Dear Paul, We consider the shape as a fixed parameter, the fitted log-likelihood is a decreasing function of the shape. Surprisingly the fit is correct when comparing the distribution function. see below This issue also happens if we work on The origin of the issue is to use the true value of the
We obtain a far better estimate (of all parameters):
The fit of 3 parameters and 2 parameters only is almost indistinguable when checking the cdf, see below. It might be good to add this example to the FAQ? Any comment is welcome. |
Hi Christophe, this is very enlightening. Just to sum things up, I compare the old approach with your newly suggested one below. This time around I've upped the number of random draws from the gamma distribution from Initial Setup
Old Approach
Newly Suggested Approach
For what it's worth, having a concrete example of fitting a truncated distribution in the FAQ would have proved quite helpful to me a couple of weeks back when I started experimenting with the |
Issue added to the FAQ. |
I am trying to fit a truncated gamma distribution,$X|X>x_0$ for some threshold $x_0>0$ , to simulated data using the
fitdistrplus
package.To this end, I modified the code from the "Can I fit truncated distributions?" section of the package FAQ to fit a truncated gamma distribution to data generated from a gamma distribution with shape parameter$x_0=5$ :
11
, rate parameter3
, and thresholdHowever, the estimated parameters as shown here
differ from the true values to conspicuous degree.
Any ideas about what might be going wrong here?
The text was updated successfully, but these errors were encountered: