lmn_loglik {LMN}R Documentation

Loglikelihood function for LMN models.

Description

Loglikelihood function for LMN models.

Usage

lmn_loglik(Beta, Sigma, suff)

Arguments

Beta

A ⁠p x q⁠ matrix of regression coefficients (see lmn_suff()).

Sigma

A ⁠q x q⁠ matrix of error variances (see lmn_suff()).

suff

An object of class lmn_suff (see lmn_suff()).

Value

Scalar; the value of the loglikelihood.

Examples

# generate data
n <- 50
q <- 3
Y <- matrix(rnorm(n*q),n,q) # response matrix
X <- 1 # intercept covariate
V <- 0.5 # scalar variance specification
suff <- lmn_suff(Y, X = X, V = V) # sufficient statistics

# calculate loglikelihood
Beta <- matrix(rnorm(q),1,q)
Sigma <- diag(rexp(q))
lmn_loglik(Beta = Beta, Sigma = Sigma, suff = suff)

[Package LMN version 1.1.3 Index]