LogLikelihood: Compute the log-likelihood function based on the residuals...

Description Usage Arguments Details Value Author(s) Examples

View source: R/loglikelihood.R

Description

This function computes the log-likelihood function based on a matrix of residuals obtained from a regression.

Usage

1

Arguments

mE

a T by N matrix of residuals obtained from a regression.

Details

The assumptions of the regression model contain the multivariate normality of the error vectors.

It computes the following function value

-\frac{NT}{2}\log 2 π - \frac{T}{2}\log |\hat{Σ}| - \frac{1}{2} ∑_{t=1}^T e_t' \hat{Σ} e_t

where e_t is the residual vector at time t (the t's row of mE), and \hat{Σ} is the covariance matrix of the residuals (the estimated covariance matrix of the errors).

Value

log-likelihood function.

Author(s)

Yukai Yang, yukai.yang@statistik.uu.se

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
mR = portfolio_m[,25:124]
vRm = portfolio_m[,3]
vRf = portfolio_m[,4]

mZ = mR - c(vRf)
vZm = vRm - c(vRf)

## get the residuals
mE = EstCAPM(mZ, vZm)$mE

LogLikelihood(mE)

yukai-yang/FE documentation built on May 29, 2019, 12:19 p.m.