Learn R Programming

nmm (version 0.9)

mlsem: mlsem returns expression of log-likelihood for joint normal distribution, for maximum likelihood (ML), Simultaneous Equations Models (SEM) variant.

Description

mlsem returns expression of log-likelihood for joint normal distribution, for maximum likelihood (ML), Simultaneous Equations Models (SEM) variant.

Usage

mlsem(cheqs0, fixed_term = TRUE)

Arguments

cheqs0

Strings defining equations of errors.

fixed_term

if TRUE fixed term -(k/2)*log(2*pi) (k number of equations) is included

Value

List with LL expressions of joint normal distribution, first element is string with expression for derivative calculations, the second - string for evaluation.

Examples

Run this code
# NOT RUN {
# normal distribution
eq_c <- c("Tw ~ ((((PH) + (tw)) * (ta - Tc) + Ec/w * (1 + (tw)) + sqrt((Ec/w *(1 + (tw)) +
(ta - Tc) * ((PH) + (tw)))^2 - 4 * Ec/w * (ta -Tc) * (tw) * (1 + (PH) + (tw))))/(2 * (1 + (PH)
 + (tw))))",
"Tf1 ~ (th1) *(Tw - Tc)",
"Ef1 ~ (ph1)/(PH) * (w * Tw - Ec)")
parl <- c("tw","PH","th1","ph1")
para_cont <- get_par(parl, eq_c)
cheqs0 <- para_cont$cheqs0
res <- mlsem(cheqs0, fixed_term=FALSE)
# }

Run the code above in your browser using DataLab