rriskMLEdist {rriskDistributions} | R Documentation |
Maximum likelihood fitting of univariate distributions
Description
Fits a univariate distribution by maximum likelihood.
Usage
rriskMLEdist(data, distr, start = NULL, optim.method = "default",
lower = -Inf, upper = Inf, custom.optim = NULL, ...)
Arguments
data |
A numerical vector for non censored data or a dataframe of two columns respectively named left and right, describing each observed value as an interval for censored data. In that case the left column contains either NA for left censored observations, the left bound of the interval for interval censored observations, or the observed value for non-censored observations. The right column contains either NA for right censored observations, the right bound of the interval for interval censored observations, or the observed value for non-censored observations. |
distr |
A character string "name" naming a distribution (or directly the density function) for which the corresponding density function dname and the corresponding distribution pname must be classically defined. The possible values are: "norm", "exp", "lnorm", "logis", "gamma", "weibull", "beta", "chisq", "t", "f", "cauchy", "gompertz". |
start |
A named list giving the initial values of parameters of the named distribution. This argument may be omitted for some distributions for which reasonable starting values are computed (see details). |
optim.method |
"default" (see details) or optimization method to pass to |
lower |
Left bounds on the parameters for the "L-BFGS-B" method (see |
upper |
Right bounds on the parameters for the "L-BFGS-B" method (see |
custom.optim |
a function carrying the MLE optimization (see details). |
... |
further arguments passed to the |
Details
This function is an alias of the function mledist
from the package
fitdistrplus (Version 0.1-2). The original function was extended to
fitting additional distributions. The following continuous distributions can
be fitted by this function: normal, exponential, lognormal, logistic, gamma,
Weibull, Beta, chi-square, Student's t, F, Cauchy, Gompertz and triangular.
And the following discrete distributions can be fitted: (wird ergaenzt).
For more details see the assistance page of the function
mledist
from the package fitdistrplus.
This function is not intended to be called directly but is internally
called in rriskFitdist.cont
.
Value
rriskMLEdist
returns a list with fitting results containing following informations
estimate |
numeric, a single value or a vector containing estimated parameters. |
convergence |
an integer code for the convergence of |
loglik |
the log-likelihood |
hessian |
a symmetric matrix computed by |
optim.function |
the name of the optimization function used for maximum likelihood. |
Author(s)
Matthias Greiner matthias.greiner@bfr.bund.de (BfR),
Kristin Tolksdorf kristin.tolksdorf@bfr.bund.de (BfR),
Katharina Schueller schueller@stat-up.de (STAT-UP Statistical Consulting),
Natalia Belgorodski belgorodski@stat-up.de (STAT-UP Statistical Consulting),
Marie-Laure Delignette-Muller (coauthor of the package fitdistrplus),
Christophe Dutang (coauthor of the package fitdistrplus)
Examples
## a basic fit of some distribution with maximum likelihood estimation
set.seed(1)
x2 <- rchisq(500, 4)
rriskMLEdist(x2, "norm")
rriskMLEdist(x2, "exp")
rriskMLEdist(x2, "lnorm")
rriskMLEdist(x2, "logis")
rriskMLEdist(x2, "gamma")
rriskMLEdist(x2, "weibull")
#rriskMLEdist(x2, "beta")
rriskMLEdist(x2, "chisq")
rriskMLEdist(x2, "t")
rriskMLEdist(x2, "f")
rriskMLEdist(x2, "cauchy")
rriskMLEdist(x2, "gompertz")
## produces an error:
# rriskMLEdist(x2, "triang")