Can we get the sig level of autocorrelations in the LB test?
Posted: Thu Jul 21, 2016 7:35 am
Hi Tom,
I am wondering how can I find the significance level of the results of autocorrelation in the returns' time series which Ljung-Box test gives to me in a GARCH model?
Regards
My codes are as follows:
I am wondering how can I find the significance level of the results of autocorrelation in the returns' time series which Ljung-Box test gives to me in a GARCH model?
Regards
My codes are as follows:
Code: Select all
OPEN DATA "C:\Users\aixia\Desktop\46+2 individual price - Copy"
DATA(FORMAT=XLS,ORG=OBS)
CALENDAR(I)
compute gstart=1,gend=%ALLOCEND()
***************
dec vector myresults(10)
do i=1,10
set r1 = %s("N"+i)
*
nonlin b0 b1 b2 b3 a0 a1 a2 nu
compute nu=10.0
stat(NOPRINT) r1
*
set v = %variance
set u = 0.0
frml et = r1-b0-b1*v-(b2+b3*v)*r1{1}
frml ht = a0+a1*u{1}**2+a2*v{1}
***with t distributed errors
frml Lt = (v(t)=ht(t)), (u(t)=et(t)),%LOGTDENSITY(v,u,nu)
linreg(noprint) r1; # constant r1{1}
compute b0=%beta(1), b1=0.0, b2=%beta(2), b3=0.0
compute a0=%seesq, a1=.09781, a2=.83756
nlpar(subiter=250)
****************
maximize(method=bfgs,robust,recursive,iter=500) Lt 2 *
**Compute the standardized residuals
set z1 = u(t)/sqrt(v(t))
**Compute the squared standardized residuals
set z1sq = u(t)*u(t)/v(t)
**Compute the residual diagnostics
**basic statistics
extremum r1
statistics z1
statistics z1sq
**LB(4,8,12) autocorrelation Q stat
corr(qstats,number=12,span=4,dfc=3) z1
corr(qstats,number=12,span=4,dfc=3) z1sq
**ARCH(12) tests
@archtest(lags=12,span=1,dfc=0,form=LM) r1
**************
end do i