rriskFitdist.cont: Fitting univariate distributions by maximum likelihood or by...

Description Usage Arguments Details Value Author(s) Examples

Description

Fits a univariate distribution by maximum likelihood or by matching moments.

Usage

1
2
rriskFitdist.cont(data, distr, method = c("mle", "mme"), start,
   chisqbreaks, meancount, ...)

Arguments

data

A numerical vector, data to be fitted.

distr

A character string name naming a distribution for which the corresponding density function dname, the corresponding distribution function pname and the corresponding quantile function must be defined, or directly the density function.

method

A character string coding for the fitting method: "mle" for the maximum likelihood estimation and "mme" for the matching moment estimation.

start

A named list giving the initial values of parameters of the named distribution. This argument will not be taken into account if method = "mme", and may be omitted for some distributions for which reasonable starting values are computed if method = "mle".

chisqbreaks

A numerical vector defining the breaks of the cell used to compute the chi-square statistic. If omitted, these breaks are automatically computed from the data in order to reach roughly the same number of observations per cell, roughly equal to the argument meancount, or slightly more if there are some ties.

meancount

The mean number of observations per cell expected for the definition of the breaks of the cells used to compute the chi-squared statistic.

...

further arguments to be passed to generic function, or to the function rriskMLEdist, in order to control the optimization method.

Details

This function is an alias of the function fitdist 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, lognormal, logistic, exponential, F, Student's t, Beta, Cauchy, Weibull, Gamma.

For more details see the assistance page of the function fitdist from the package fitdistrplus.

This function is not intended to be called directly but is internally called in useFitdist.

Value

rriskFitdist.cont returns a list containing 19 items with following fitting results:

estimate

numeric, a single value or a vector containing estimated parameters.

method

the character string representing the used fitting method ("mle" or "mme").

sd

the estimated standard errors or NULL in case of the "mme" method.

cor

the estimated correlation matrix or NULL in case of the "mme" method.

loglik

the log-likelihood or NULL in case of the "mme" method.

aic

the Akaike information criterion or NULL in case of the "mme" method.

bic

the BIC or SBC (Schwarz Bayesian criterion) or NULL in case of the "mme" method.

n

the length of the data set.

data

the data set.

distname

the name of the estimated distribution.

chisq

the Chi-squared statistic or NULL, if not computed.

chisqbreaks

breaks used to define cells in the chi-square statistic.

chisqpvalue

p-value of the chi-square statistic or NULL, if not computed.

chisqdf

degree of freedom of the chi-square distribution or NULL, if not computed.

chisqtable

a table with observed and theoretical counts used for the Chi-squared calculations.

ad

the Anderson-Darling statistic or NULL, if not computed.

adtest

the decision of the Anderson-Darling test or NULL, if not computed.

ks

the Kolmogorov-Smirnov statistic or NULL, if not computed.

kstest

the decision of the Kolmogorov-Smirnov test or NULL, if not computed.

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

1
2
3
4
set.seed(1)
x <- stats::rnorm(5000, mean = 10, sd = 5)
rriskFitdist.cont(x, "norm")
rriskFitdist.cont(x, "t")

rriskDistributions documentation built on May 2, 2019, 3:44 a.m.