powered by
Performs maximization via nlminb. mu and sigsq correspond to meanlog and sdlog^2 in Lognormal.
nlminb
Lognormal
mle_lnorm(x, mu = NULL, sigsq = NULL, estimate_var = FALSE, ...)
Numeric vector.
Numeric value specifying known mu.
Numeric value specifying known sigsq.
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 Lognormal(0.5, 1) and estimate mu and sigsq set.seed(123) x <- rlnorm(1000, meanlog = 0.5, sdlog = sqrt(1)) mle_lnorm(x) # }
Run the code above in your browser using DataLab