Description Usage Arguments Value Note Examples
Finds the MLE from a univariate sample using a parametric family of distributions built into R (or others similar to them).
1 |
x |
Vector of univariate sample drawn from the distribution. |
ddist |
A family of densities or mass functions,
for example |
init.val |
The initial guess at parameter values for the numerical
optimizer. Could be (1) a vector, in which the order provided will correspond
to the order given in the R documentation for that distribution, or (2) a list
with names being the parameter names, or (3) |
in.range |
The same as the argument in |
A list of the parameter estimates, named according to their corresponding parameter names
If you want to make your own distribution (density function), just
be sure to follow R's order of arguments (x
first,
then named parameters).
1 2 3 4 5 6 7 8 9 10 11 | ## MLE of a Gaussian sample
unimle(rnorm(1000))
x <- rnorm(1000, 5, 100)
unimle(x)
unimle(x, init.val = list(sd = 80, mean = 10)) # Notice the order output order
## MLE of negative binomial
x <- rnbinom(1000, size = 2, mu = 10)
unimle(x, dnbinom) # No defaults, so must specify inits
unimle(x, dnbinom, c(1, 0.3))
unimle(x, dnbinom, list(size = 1, mu = 5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.