Package: fitdistrplus 1.2-6

Aurélie Siberchicot

fitdistrplus: Help to Fit of a Parametric Distribution to Non-Censored or Censored Data

Extends the fitdistr() function (of the MASS package) with several functions to help the fit of a parametric distribution to non-censored or censored data. Censored data may contain left censored, right censored and interval censored values, with several lower and upper bounds. In addition to maximum likelihood estimation (MLE), the package provides moment matching (MME), quantile matching (QME), maximum goodness-of-fit estimation (MGE) and maximum spacing estimation (MSE) methods (available only for non-censored data). Weighted versions of MLE, MME, QME and MSE are available. See e.g. Casella & Berger (2002), Statistical inference, Pacific Grove, for a general introduction to parametric estimation.

Authors:Marie-Laure Delignette-Muller [aut], Christophe Dutang [aut], Regis Pouillot [ctb], Jean-Baptiste Denis [ctb], Aurélie Siberchicot [aut, cre]

fitdistrplus_1.2-6.tar.gz
fitdistrplus_1.2-6.zip(r-4.7)fitdistrplus_1.2-6.zip(r-4.6)fitdistrplus_1.2-6.zip(r-4.5)
fitdistrplus_1.2-6.tgz(r-4.6-any)fitdistrplus_1.2-6.tgz(r-4.5-any)
fitdistrplus_1.2-6.tar.gz(r-4.7-any)fitdistrplus_1.2-6.tar.gz(r-4.6-any)
fitdistrplus_1.2-6.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
fitdistrplus/json (API)

# Install 'fitdistrplus' in R:
install.packages('fitdistrplus', repos = c('https://lbbe-software.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/lbbe-software/fitdistrplus/issues

Pkgdown/docs site:https://lbbe-software.github.io

Datasets:
  • danishmulti - Danish reinsurance claim dataset
  • danishuni - Danish reinsurance claim dataset
  • dataFAQlog1 - Datasets for the FAQ
  • dataFAQscale1 - Datasets for the FAQ
  • dataFAQscale2 - Datasets for the FAQ
  • endosulfan - Species Sensitivity Distribution (SSD) for endosulfan
  • fluazinam - Species-Sensitivity Distribution (SSD) for Fluazinam
  • fremale - Fictive survival dataset of a french Male population
  • groundbeef - Ground beef serving size data set
  • salinity - Species-Sensitivity Distribution (SSD) for salinity tolerance
  • smokedfish - Contamination data of Listeria monocytogenes in smoked fish
  • toxocara - Parasite abundance in insular feral cats

On CRAN:

Conda:

16.50 score 61 stars 219 packages 10k scripts 55k downloads 120 mentions 27 exports 5 dependencies

Last updated from:9d5fb643a4. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK334
source / vignettesOK302
linux-release-x86_64OK275
macos-release-arm64OK194
macos-oldrel-arm64OK168
windows-develOK282
windows-releaseOK266
windows-oldrelOK255
wasm-releaseOK175

Exports:bootdistbootdistcenscdfcompcdfcompcensCIcdfplotdenscompdescdistdetectboundfitdistfitdistcensgofstatllcurvellplotllsurfacemgedistmledistmmedistmsedistplotdistplotdistcensppcompppcompcensprefitqmedistqqcompqqcompcensSurv2fitdistcens

Dependencies:latticeMASSMatrixrlangsurvival

Starting values used in fitdistrplus
1. Discrete distributions | 1.1. Base R distribution | 1.1.1. Geometric distribution | 1.1.2. Negative binomial distribution | 1.1.3. Poisson distribution | 1.1.4. Binomial distribution | 1.2. logarithmic distribution | 1.3. Zero truncated distributions | 1.4. Zero modified distributions | 1.5. Poisson inverse Gaussian distribution | 2. Continuous distributions | 2.1. Normal distribution | 2.2. Lognormal distribution | 2.3. Beta distribution (of the first kind) | 2.4. Other continuous distribution in actuar | 2.4.1. Log-gamma | 2.4.2. Gumbel | 2.4.3. Inverse Gaussian distribution | 2.4.4. Generalized beta | 2.5. Feller-Pareto family | The gradient with respect to $\theta, \alpha, \gamma, \tau$ is\begin{equation}\nabla\mathcal L(\mu, \theta, \alpha, \gamma, \tau) | 2.5.1. Transformed beta | 2.5.2. Generalized Pareto | 2.5.3. Burr | The survival function is$$1-F(x) = (1+(x/\theta)^\gamma)^{-\alpha}.$$Using the median $q_2$, we have$$\log(1/2) = - \alpha \log(1+(q_2/\theta)^\gamma).$$The initial value is\begin{equation}\alpha | 2.5.4. Loglogistic | 2.5.5. Paralogistic | 2.5.6. Inverse Burr | 2.5.7. Inverse paralogistic | 2.5.8. Inverse pareto | 2.5.9. Pareto IV | The first and third quartiles $q_1$ and $q_3$ verify$$((\frac34)^{-1/\alpha}-1)^{1/\gamma} = \frac{q_1-\mu}{\theta},((\frac14)^{-1/\alpha}-1)^{1/\gamma} = \frac{q_3-\mu}{\theta}.$$Hence we get two useful relations\begin{equation}\gamma | \frac{\log\left(\frac{(\frac43)^{1/\alpha}-1}{(4)^{1/\alpha}-1}\right)}{\log\left(\frac{q_1-\mu}{q_3-\mu}\right)},(#eq:pareto4gammarelation)\end{equation}\begin{equation}\theta | 2.5.10. Pareto III | Pareto III corresponds to Pareto IV with $\alpha=1$.\begin{equation}\gamma | \begin{equation}\theta | 2.5.11. Pareto II | 2.5.12. Pareto I | 2.5.13. Pareto | Pareto corresponds to Pareto IV with $\gamma=1$, $\mu=0$.\begin{equation}\theta | 2.6. Transformed gamma family | 2.6.1. Transformed gamma distribution | 2.6.2. gamma distribution | 2.6.3. Weibull distribution | 2.6.4. Exponential distribution | 2.7. Inverse transformed gamma family | 2.7.1. Inverse transformed gamma distribution | 2.7.2. Inverse gamma distribution | 2.7.3. Inverse Weibull distribution | 2.7.4. Inverse exponential | 3. Bibliography | 3.1. General books | 3.2. Books dedicated to a distribution family | 3.3. Books with applications

Last update: 2026-06-30
Started: 2024-02-22

Frequently Asked Questions
1. Questions regarding distributions | 1.1. How do I know the root name of a distribution? | 1.2. How do I find "non standard" distributions? | 1.3. How do I set (or find) initial values for non standard distributions? | 1.4. Is it possible to fit a distribution with at least 3 parameters? | 1.5. Why there are differences between MLE and MME for the lognormal distribution? | 1.6. Can I fit a distribution with positive support when data contains negative values? | 1.7. Can I fit a finite-support distribution when data is outside that support? | 1.8. Can I fit truncated distributions? | 1.9. Can I fit truncated inflated distributions? | 1.10. Can I fit a uniform distribution? | 1.11. Can I fit a beta distribution with the same shape parameter? | 1.12. How to estimate support parameter? the case of the four-parameter beta | 2. Questions regarding goodness-of-fit tests and statistics, Cullen-Frey graph | 2.1. Where can we find the results of goodness-of-fit tests ? | 2.2. Is it reasonable to use goodness-of-fit tests to validate the fit of a distribution ? | 2.2.1. Should I reject a distribution because a goodness-of-fit test rejects it ? | 2.2.2. Should I accept a distribution because goodness-of-fit tests do not reject it ? | 2.3. Why all goodness-of-fit tests are not available for every distribution ? | 2.4. How can we use goodness-of-fit statistics to compare the fit of different distributions on a same data set ? | 2.5. Can we use a test to compare the fit of two distributions on a same data set ? | 2.6. Can we get goodness-of-fit statistics for a fit on censored data ? | 2.7. Why Cullen-Frey graph may be misleading? | 3. Questions regarding optimization procedures | 3.1. How to choose optimization method? | 3.2. The optimization algorithm stops with error code, e.g., 100. What shall I do? | 3.3 Why distribution with a log argument may converge better? | 3.4. What to do when there is a scaling issue? | 3.5. How do I set bounds on parameters when optimizing? | 3.5.1. Setting bounds for scale parameters | 3.5.2. Setting bounds for shape parameters | 3.5.3. Setting bounds for probability parameters | 3.5.4. Setting bounds for boundary parameters | 3.5.5. Setting linear inequality bounds | 3.6. How does quantile matching estimation work for discrete distributions? | 3.7. Why setting a parameter to the true value does not lead to the expected result for other parameters? | 4. Questions regarding uncertainty | 4.1. Can we compute marginal confidence intervals on parameter estimates from their reported standard error ? | 4.2. How can we compute confidence intervals on quantiles from the fit of a distribution ? | 4.3. How can we compute confidence intervals on any function of the parameters of the fitted distribution ? | 4.4. How do we choose the bootstrap number? | 5. How to personalize plots | 5.1. Can I personalize the default plot given for an object of class fitdist or fitdistcens? | 5.2. How to personalize goodness-of-fit plots ? | 5.3. Is it possible to obtain ggplot2 plots ? | 5.4. Is it possible to add the names of the observations in a goodness-of-fit plot, e.g. the names of the species in the plot of the Species Sensitivity Distribution (SSD) classically used in ecotoxicology ? | 6. Questions regarding (left, right and/or interval) censored data | 6.1. How to code censored data in fitdistrplus ? | 6.2. How do I prepare the input of fitdistcens() with Surv2fitdistcens()? | 6.3. How to represent an empirical distribution from censored data ? | 6.4. How to assess the goodness-of-fit of a distribution fitted on censored data ?

Last update: 2026-01-20
Started: 2016-04-14

Overview of the fitdistrplus package
1. Introduction | 2. Fitting distributions to continuous non-censored data | 2.1. Choice of candidate distributions | 2.2. Fit of distributions by maximum likelihood estimation | 2.3. Uncertainty in parameter estimates | 3. Advanced topics | 3.1. Alternative methods for parameter estimation | 3.3. Fitting distributions to other types of data | 4. Conclusion | Acknowledgments | References

Last update: 2026-01-20
Started: 2023-03-28

Which optimization algorithm to choose?
1. Quick overview of main optimization methods | 1.1. Derivative-free optimization methods | 1.2. Hessian-free optimization methods | 1.2.1. Computing the direction $d_k$ | 1.2.2. Computing the stepsize $t_k$ | 1.3. Benchmark | 2. Numerical illustration with the beta distribution | 2.1. Log-likelihood function and its gradient for beta distribution | 2.1.1. Theoretical value | 2.1.2. R implementation | 2.2. Random generation of a sample | 2.3 Fit Beta distribution | 2.4. Results of the numerical investigation | 3. Numerical illustration with the negative binomial distribution | 3.1. Log-likelihood function and its gradient for negative binomial distribution | 3.1.1. Theoretical value | 3.1.2. R implementation | 3.2. Random generation of a sample | 3.3. Fit a negative binomial distribution | 3.4. Results of the numerical investigation | 4. Conclusion

Last update: 2026-01-20
Started: 2016-04-14

Readme and manuals

Help Manual

Help pageTopics
Overview of the 'fitdistrplus' packagefitdistrplus-package fitdistrplus
Bootstrap simulation of uncertainty for non-censored databootdist density.bootdist plot.bootdist plot.density.bootdist print.bootdist print.density.bootdist summary.bootdist
Bootstrap simulation of uncertainty for censored databootdistcens density.bootdistcens plot.bootdistcens plot.density.bootdistcens print.bootdistcens print.density.bootdistcens summary.bootdistcens
Empirical cumulative distribution function with pointwise confidence intervals on probabilities or on quantilesCIcdfplot
Danish reinsurance claim datasetdanish danishmulti danishuni
Datasets for the FAQdataFAQ dataFAQlog1 dataFAQscale1 dataFAQscale2
Description of an empirical distribution for non-censored datadescdist print.descdist
Detect bounds for density functiondetectbound
Species Sensitivity Distribution (SSD) for endosulfanendosulfan
Fit of univariate distributions to non-censored dataAIC.fitdist BIC.fitdist coef.fitdist fitdist logLik.fitdist plot.fitdist print.fitdist summary.fitdist vcov.fitdist
Fitting of univariate distributions to censored dataAIC.fitdistcens BIC.fitdistcens coef.fitdistcens fitdistcens logLik.fitdistcens plot.fitdistcens print.fitdistcens summary.fitdistcens vcov.fitdistcens
Species-Sensitivity Distribution (SSD) for Fluazinamfluazinam
Fictive survival dataset of a french Male populationfremale
Goodness-of-fit statisticsgofstat print.gofstat.fitdist print.gofstat.fitdistcens
Graphical comparison of multiple fitted distributions (for non-censored data)cdfcomp denscomp graphcomp ppcomp qqcomp
Graphical comparison of multiple fitted distributions for censored datacdfcompcens denscompcens graphcompcens ppcompcens qqcompcens
Ground beef serving size data setgroundbeef
(Log)likelihood plot for a fit using maximum likelihoodllplot
(Log)likelihood surfaces or (log)likelihood curvesllcurve llsurface
Maximum goodness-of-fit fit of univariate continuous distributionsmge mgedist
Maximum likelihood fit of univariate distributionsmle mledist
Matching moment fit of univariate distributionsmme mmedist
Maximum spacing estimation of univariate distributionsmse msedist
Plot of empirical and theoretical distributions for non-censored dataplotdist
Plot of empirical and theoretical distributions for censored dataplotdistcens
Pre-fitting procedureprefit
Quantile matching fit of univariate distributionsqme qmedist
Quantile estimation from a fitted distributionprint.quantile.bootdist print.quantile.bootdistcens print.quantile.fitdist print.quantile.fitdistcens quantile quantile.bootdist quantile.bootdistcens quantile.fitdist quantile.fitdistcens
Species-Sensitivity Distribution (SSD) for salinity tolerancesalinity
Contamination data of Listeria monocytogenes in smoked fishsmokedfish
Handling of data formated as in the survival package for use in fitdistcens()Surv2fitdistcens
Parasite abundance in insular feral catstoxocara