Learn R Programming

GNAR (version 1.0)

logLik.GNARfit: Log-likelihood method for GNARfit objects

Description

Returns the log-likelihood for a GNARfit object.

Usage

# S3 method for GNARfit
logLik(object,...)

Arguments

object

A GNARfit object generated by a GNARfit call.

...

Optional additional arguments, not used here.

Value

A logLik object.

Details

S3 method for the GNARfit class. The function returns the value of $$-TN/2 \log(2 \pi) - T/2 \log(| \Sigma |) - 1/2 trace(E \Sigma^{-1} E'),$$ where \(T\) is the time length of the observations, \(N\) is the number of nodes, \(\Sigma = E E' /T\) is the estimated covariance matrix and \(E\) is the matrix of residuals.

Examples

Run this code
# NOT RUN {
#calculate log-likelihood for fiveNode data
#global alphas
logLik(GNARfit())
#individual alphas
logLik(GNARfit(globalalpha=FALSE))
# }

Run the code above in your browser using DataLab