mom2par | R Documentation |
Compute parameters from (theoretical) moments
mom2par(densfun = "exponential",
mean,
sd = NA)
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. |
For some distributions like Weibull, it is necessary to find a numerical solution since the parameters have no closed form expression involving the moments.
A named list containing the parameters values e.g. with names shape
and scale
. When mean
or sd
is vector the list
contains vectors.
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
.
Yves Deville
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.