powered by
Performs maximization via nlminb. alpha and beta correspond to the shape and scale (not shape and rate) parameters described in GammaDist.
nlminb
GammaDist
mle_gamma(x, alpha = NULL, beta = NULL, estimate_var = FALSE, ...)
Numeric vector.
Numeric value specifying known alpha.
Numeric value specifying known beta.
Logical value for whether to return Hessian-based variance-covariance matrix.
Additional arguments to pass to nlminb.
List containing:
Numeric vector of parameter estimates.
Variance-covariance matrix (if estimate_var = TRUE).
estimate_var = TRUE
Returned nlminb object from maximizing the log-likelihood function.
Akaike information criterion (AIC).
# NOT RUN { # 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) # }
Run the code above in your browser using DataLab