| mle_gamma_lnorm {dvmisc} | R Documentation |
Maximum Likelihood Estimation for X[1], ..., X[n] ~ Gamma(alpha, beta) Lognormal(mu, sigsq)
Description
Each observation is assumed to be the product of a Gamma(alpha, beta) and
Lognormal(mu, sigsq) random variable. Performs maximization via
nlminb. alpha and beta correspond to the shape and scale
(not shape and rate) parameters described in GammaDist,
and mu and sigsq correspond to meanlog and sdlog^2 in
Lognormal.
Usage
mle_gamma_lnorm(x, gamma_mean1 = FALSE, lnorm_mean1 = TRUE,
integrate_tol = 1e-08, estimate_var = FALSE, ...)
Arguments
x |
Numeric vector. |
gamma_mean1 |
Whether to use restriction that the Gamma variable is mean-1. |
lnorm_mean1 |
Whether to use restriction that the lognormal variable is mean-1. |
integrate_tol |
Numeric value specifying the |
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
nlminbobject from maximizing the log-likelihood function.Akaike information criterion (AIC).
Examples
# Generate 1,000 values from Gamma(0.5, 1) x Lognormal(-1.5/2, 1.5) and
# estimate parameters
## Not run:
set.seed(123)
x <- rgamma(1000, 0.5, 1) * rlnorm(1000, -1.5/2, sqrt(1.5))
mle_gamma_lnorm(x, control = list(trace = 1))
## End(Not run)