mle_gamma {dvmisc} | R Documentation |
Maximum Likelihood Estimation for X[1], ..., X[n] ~ Gamma(alpha, beta)
Description
Performs maximization via nlminb
. alpha and beta
correspond to the shape and scale (not shape and rate) parameters described
in GammaDist
.
Usage
mle_gamma(x, alpha = NULL, beta = NULL, estimate_var = FALSE, ...)
Arguments
x |
Numeric vector. |
alpha |
Numeric value specifying known alpha. |
beta |
Numeric value specifying known beta. |
estimate_var |
Logical value for whether to return Hessian-based variance-covariance matrix. |
... |
Additional arguments to pass to |
Value
List containing:
Numeric vector of parameter estimates.
Variance-covariance matrix (if
estimate_var = TRUE
).Returned
nlminb
object from maximizing the log-likelihood function.Akaike information criterion (AIC).
Examples
# Generate 1,000 values from Gamma(0.5, 1) and estimate alpha and beta
set.seed(123)
x <- rgamma(1000, shape = 0.5, scale = 1)
mle_gamma(x)
[Package dvmisc version 1.1.4 Index]