The main change is colored with red. The MAT15 problem (Subscripts Too Large or Non-Positive
) appears in the Log likelihood for the DCC phase
Code: Select all
dec vect[series] eps(n)
dec vect fullbeta(2*n+2)
*
* Do univariate GARCH models. Save the standardized residuals
* into eps(i). Copy the coefficients into the proper slots in
* the full beta matrix.
*
do i=1,n
garch(p=1,q=1,resids=r,hseries=h) / x(i)
set eps(i) = r/sqrt(h)
do j=1,2
compute fullbeta(n*(j-1)+i)=%beta(j)
end do j
end do i
*
* Compute the covariance matrix of the standardized residuals
*
vcv(matrix=rr)
# eps
*
* Create the series[symm] uu (outer product of residuals). Make
* it the unconditional value prior to the sample.
*
dec series[symm] uu q
gset uu %regstart() %regend() = %outerxx(%xt(eps,t))
gset uu 1 %regstart()-1 = rr
gset q = rr
*
* Log likelihood for the DCC phase, taking the residuals as given
*
nonlin a b
dec frml[symm] qf
frml qf = (1-a-b)*rr+a*uu{1}+b*q{1}
frml logl =q=qf, %logdensity(%cvtocorr(q),%xt(eps,t))
compute b=.10,a=.010
maximize logl 1
* Compute the estimates into the final two slots in fullbeta
*
compute fullbeta(2*n+1)=%beta(1),fullbeta(2*n+2)=%beta(2)Could you help me to find out how to correct it?
Appreciate any help!