Testing Robust CAPM using Likelihood ratio test

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Ktc2015
Posts: 1
Joined: Wed Apr 29, 2015 8:20 pm

Testing Robust CAPM using Likelihood ratio test

Postby Ktc2015 » Wed Apr 29, 2015 8:24 pm

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))

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Testing Robust CAPM using Likelihood ratio test

Postby trubador » Thu Apr 30, 2015 12:49 am

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)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests