mom2par {Renext} | R Documentation |
Parameters from moments
Description
Compute parameters from (theoretical) moments
Usage
mom2par(densfun = "exponential",
mean,
sd = NA)
Arguments
densfun |
Name of the distribution. This can be at present time:
|
mean |
Theoretical mean (expectation) of the distribution. Can be a vector, in which case the parameters will be vectors. |
sd |
Standard deviation. |
Details
For some distributions like Weibull, it is necessary to find a numerical solution since the parameters have no closed form expression involving the moments.
Value
A named list containing the parameters values e.g. with names shape
and scale
. When mean
or sd
is vector the list
contains vectors.
Note
The name of the formal argument densfun
is for compatibility with
fitdistr
from the MASS package. However, unlike in
fitdistr
this formal can not be given a density value, i.e. an
object of the class "function"
such as dnorm
.
Author(s)
Yves Deville
Examples
## Weibull
mom2par(densfun = "weibull", mean = 1, sd = 2)
## Genrealised Pareto
mom2par(densfun = "gpd", mean = 1, sd = 2)
## Gamma
mom2par(densfun = "gamma", mean = 1:10, sd = 1)