Description Usage Arguments Details Value Author(s) Examples
Fits a univariate distribution by matching moments.
1 | rriskMMEdist(data, distr)
|
data |
a numerical vector. |
distr |
A character string "name" naming a distribution or directly the
density function |
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
.
rriskMMEdist
returns the named parameter or a named vector of parameters.
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)
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.