Page 1 of 1

Testing Robust CAPM using Likelihood ratio test

Posted: Wed Apr 29, 2015 8:24 pm
by Ktc2015
Hi there, I'm trying to test the Robust CAPM but have trouble setting the alpha and beta to 0 and 1, respectively. What would the codes be for these commands? Thanks heaps in advance.
@logl logf
y = r_cba - rate_365
x = r_all_ordinaries - rate_365
u = y - c(1) - c(2)*x
sig2 = c(3)^2
nu = c(4)
@param c(1) 0.001 c(2) 0.001 c(3) 0.001 c(4) 5
pi = 3.14159
logf = log(@gamma((nu+1)/2)) - log(@gamma(nu/2)) - 0.5*log(pi) - 0.5*log(nu-2) - 0.5*log(sig2) - ((nu+1)/2)*log(1+u^2/((nu-2)*sig2))

Re: Testing Robust CAPM using Likelihood ratio test

Posted: Thu Apr 30, 2015 12:49 am
by trubador
Build and estimate the restricted version of the ML model:

Code: Select all

@logl logf0 ... u = y - x ...
Then the following will give you the likelihood ratio statistic along with its associated p-value:

Code: Select all

scalar lr_stat = -2*(logf0.@logl - logf.@logl) scalar lr_pval = 1-@cchisq(lr_stat,2)