Description Usage Arguments Details Value Author(s) Examples
View source: R/loglikelihood.R
This function computes the log-likelihood function based on a matrix of residuals obtained from a regression.
1 | LogLikelihood(mE)
|
mE |
a T by N matrix of residuals obtained from a regression. |
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).
log-likelihood function.
Yukai Yang, yukai.yang@statistik.uu.se
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.