mle_gamma: Maximum Likelihood Estimation for X[1], ..., X[n] ~...

Description Usage Arguments Value Examples

View source: R/mle_gamma.R

Description

Performs maximization via nlminb. alpha and beta correspond to the shape and scale (not shape and rate) parameters described in GammaDist.

Usage

1
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 nlminb.

Value

List containing:

  1. Numeric vector of parameter estimates.

  2. Variance-covariance matrix (if estimate_var = TRUE).

  3. Returned nlminb object from maximizing the log-likelihood function.

  4. Akaike information criterion (AIC).

Examples

1
2
3
4
# 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)

vandomed/dvmisc documentation built on Oct. 2, 2020, 9:50 p.m.