rriskMMEdist: Fitting univariate distributions by matching moments

Description Usage Arguments Details Value Author(s) Examples

Description

Fits a univariate distribution by matching moments.

Usage

1

Arguments

data

a numerical vector.

distr

A character string "name" naming a distribution or directly the density function dname. The estimated values of the distribution parameters are provided only for the following distributions : "norm", "lnorm", "exp", "pois", "gamma", "logis", "nbinom" , "geom", "beta" and "unif".

Details

This function is an alias of the function mmedist from the package fitdistrplus (Version 0.1-2). The original function was extended to fitting additional distributions. Parameter of the following distribution families can be estimated in this function: normal, lognormal, exponential, Poisson, gamma, logistic, negative binomial, geometric, Beta and continuous univariate.

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

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

Value

rriskMMEdist returns the named parameter or a named vector of parameters.

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
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Continuous distributions
set.seed(1)
x1 <- stats::rnorm(500, mean = 2, sd = 0.7)
rriskMMEdist(x1, "norm")
rriskMMEdist(x1, "exp")
rriskMMEdist(x1, "gamma")
rriskMMEdist(x1, "logis")
rriskMMEdist(x1, "unif")

## produces an error:
# rriskMMEdist(x1, "lnorm")
# rriskMMEdist(x1, "beta")

## Discrete distributions
set.seed(2)
x2 <- rpois(500, lambda = 3)
rriskMMEdist(x2, "pois")
rriskMMEdist(x2, "nbinom")
rriskMMEdist(x2, "geom")

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