Spark Online Training by Edureka

fitDR: Fit of destruction rate models

Description Usage Arguments Details Value Author(s) References See Also Examples


Fit of univariate distributions to destruction rate data by maximum likelihood (mle), moment matching (mme), quantile matching (qme) or maximizing goodness-of-fit estimation (mge). The latter is also known as minimizing distance estimation. Generic methods are print, plot, summary, quantile, logLik, vcov and coef.


fitDR(x, dist, method="mle", start=NULL, optim.method="default", ...)



A numeric vector.


A character string "name" naming a distribution among "oiunif", "oistpareto", "oibeta", "oigbeta", "mbbefd", "MBBEFD".


A character string coding for the fitting method: "mle" for 'maximum likelihood estimation', "tlmme" for 'total-loss-moment matching estimation'.


A named list giving the initial values of parameters of the named distribution or a function of data computing initial values and returning a named list. This argument may be omitted (default) for some distributions for which reasonable starting values are computed (see the 'details' section of mledist).


"default" or an optimization method to pass to optim.


Further arguments to be passed to "fitdist" when method != "tlmme". See fitdist for details on parameter estimation.


The fitted distribution (dist) has its d, p, q, r functions defined in the man page: oiunif, oistpareto, oibeta, oigbeta, mbbefd, MBBEFD.

The two possible fitting methods are described below:

When method="mle"

Maximum likelihood estimation consists in maximizing the log-likelihood. A numerical optimization is carried out in mledist via optim to find the best values (see mledist for details). For one-inflated distributions, the probability parameter is estimated by a closed-form formula and other parameters use a two-optimization procedures.

When method="tlmme"

Total loss and moment matching estimation consists in equalizing theoretical and empirical total loss as well as theoretical and empirical moments. The theoretical and the empirical moments are matched numerically, by minimization of the sum of squared differences between observed and theoretical quantities (see mmedist for details).

For one-inflated distributions, by default, direct optimization of the log-likelihood (or other criteria depending of the chosen method) is performed using optim, with the "L-BFGS-B" method for distributions characterized by more than one parameter and the "Brent" method for distributions characterized by only one parameter. Note that when errors are raised by optim, it's a good idea to start by adding traces during the optimization process by adding control=list(trace=1, REPORT=1). For the MBBEFD distribution, is used.

A pre-fitting process is carried out for the following distributions "mbbefd", "MBBEFD" and "oigbeta" before the main optimization.

The estimation process is carried out via fitdist from the fitdistrplus package and the output object will inherit from the "fitdist" class. Therefore, the following generic methods are available print, plot, summary, quantile, logLik, vcov and coef.


fitDR returns an object of class "fitDR" inheriting from the "fitdist" class. That is a list with the following components:


the parameter estimates.


the character string coding for the fitting method : "mle" for 'maximum likelihood estimation', "tlmme" for 'matching total loss moment estimation'.


the estimated standard errors, NA if numerically not computable or NULL if not available.


the estimated correlation matrix, NA if numerically not computable or NULL if not available.


the estimated variance-covariance matrix, NULL if not available.


the log-likelihood.


the Akaike information criterion.


the the so-called BIC or SBC (Schwarz Bayesian criterion).


the length of the data set.


the data set.


the name of the distribution.


the named list giving the values of parameters of the named distribution that must be kept fixed rather than estimated by maximum likelihood or NULL if there are no such parameters.

the function used to set the value of fix.arg or NULL.


the input argument or the automatic definition by the function to be passed to functions gofstat, plotdist and cdfcomp.


the list of further arguments passed in ... to be used in bootdist in iterative calls to mledist, mmedist, qmedist, mgedist or NULL if no such arguments.


the vector of weigths used in the estimation process or NULL.

Generic functions:


The print of a "fitDR" object shows few traces about the fitting method and the fitted distribution.


The summary provides the parameter estimates of the fitted distribution, the log-likelihood, AIC and BIC statistics and when the maximum likelihood is used, the standard errors of the parameter estimates and the correlation matrix between parameter estimates.


The plot of an object of class "fitDR" returned by fitdist uses the function plotdist. An object of class "fitdist" or a list of objects of class "fitDR" corresponding to various fits using the same data set may also be plotted using a cdf plot (function cdfcomp), a density plot(function denscomp), a density Q-Q plot (function qqcomp), or a P-P plot (function ppcomp).


Extracts the estimated log-likelihood from the "fitDR" object.


Extracts the estimated var-covariance matrix from the "fitDR" object (only available when method = "mle").


Extracts the fitted coefficients from the "fitDR" object.


Christophe Dutang.


Cullen AC and Frey HC (1999), Probabilistic techniques in exposure assessment. Plenum Press, USA, pp. 81-155.

Venables WN and Ripley BD (2002), Modern applied statistics with S. Springer, New York, pp. 435-446.

Vose D (2000), Risk analysis, a quantitative guide. John Wiley & Sons Ltd, Chischester, England, pp. 99-143.

Delignette-Muller ML and Dutang C (2015), fitdistrplus: An R Package for Fitting Distributions. Journal of Statistical Software, 64(4), 1-34.

See Also

See mledist, mmedist, for details on parameter estimation. See gofstat for goodness-of-fit statistics. See plotdist, graphcomp for graphs. See bootDR for bootstrap procedures See optim for base R optimization procedures. See quantile.fitdist, another generic function, which calculates quantiles from the fitted distribution. See quantile for base R quantile computation.


# (1) fit of a one-inflated beta distribution by maximum likelihood estimation
n <- 1e3
x <- roibeta(n, 3, 2, 1/6)

f1 <- fitDR(x, "oibeta", method="mle")

plot(bootdist(f1, niter=11), enhance=TRUE, trueval=c(3, 2, 1/6))

Search within the mbbefd package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.