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

Description Usage Arguments Value Examples

View source: R/mle_lnorm.R

Description

Performs maximization via nlminb. mu and sigsq correspond to meanlog and sdlog^2 in Lognormal.

Usage

1
mle_lnorm(x, mu = NULL, sigsq = NULL, estimate_var = FALSE, ...)

Arguments

x

Numeric vector.

mu

Numeric value specifying known mu.

sigsq

Numeric value specifying known sigsq.

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 Lognormal(0.5, 1) and estimate mu and sigsq
set.seed(123)
x <- rlnorm(1000, meanlog = 0.5, sdlog = sqrt(1))
mle_lnorm(x)

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