I am using the multivariate Garch program for obtaining the Panel GARCH estimates of Cermeno and Grier, (2006):
all 175
open data panel912.xls
data(format=xls,org=columns)
*print / cpi7 cpi1 cpi2 cpi3 cpi4 cpi5 cpi6
*
set dcpi1 = cpi1-cpi1{1}
set dcpi2 = cpi2-cpi2{1}
set dcpi3 = cpi3-cpi3{1}
set dcpi4 = cpi4-cpi4{1}
set dcpi5 = cpi5-cpi5{1}
set dcpi6 = cpi6-cpi6{1}
set dcpi7 = cpi7-cpi7{1}
*
* Estimation using MAXIMIZE
* The initial few lines of this set the estimation range, which needs to
* be done explicitly, and the number of variables. Then, vectors for the
* dependent variables, residuals and residuals formulas are set up. The
* SET instructions copy the dependent variables over into the slots in
* the vector of series.
*
compute gstart=15,gend=175
compute n= 7
dec vect[series] y(n) u(n)
dec vect[frml] resid(n)
set y(1) = dcpi1
set y(2) = dcpi2
set y(3) = dcpi3
set y(4) = dcpi4
set y(5) = dcpi5
set y(6) = dcpi6
set y(7) = dcpi7
*
* This is specific to a mean-only model. It sets up the formulas (the &i
* are needed in the formula definitions when the FRML is defined in a
* loop), and estimates them using NLSYSTEM. This both initializes the
* mean parameters, and computes the unconditional covariance matrix. If
* you want more general mean equations, the simplest way to do that
* would be to define each FRML separately.
*
dec vect b(n)
nonlin(parmset=meanparms) b11 b12 b13 b14 b15 b16 b17 b18 b19 b110 b111 b112 b113 $
b21 b22 b23 b24 b25 b26 b27 b28 b29 b210 b211 b212 b213 $
b31 b32 b33 b34 b35 b36 b37 b38 b39 b310 b311 b312 b313 $
b41 b42 b43 b44 b45 b46 b47 b48 b49 b410 b411 b412 b413 $
b51 b52 b53 b54 b55 b56 b57 b58 b59 b510 b511 b512 b513 $
b61 b62 b63 b64 b65 b66 b67 b68 b69 b610 b611 b612 b613 $
b71 b72 b73 b74 b75 b76 b77 b78 b79 b710 b711 b712 b713 $
frml resid(1) = y(1)-b11-b12*y(1){1}-b13*y(1){2}-b14*y(1){3}-b15*y(1){4}-b16*y(1){5}-b17*y(1){6}-b18*y(1){7}-b19*y(1){8}-b110*y(1){9}-b111*y(1){10}-b112*y(1){11}-b113*y(1){12}
frml resid(2) = y(2)-b21-b22*y(2){1}-b23*y(2){2}-b24*y(2){3}-b25*y(2){4}-b26*y(2){5}-b27*y(2){6}-b28*y(2){7}-b29*y(2){8}-b210*y(2){9}-b211*y(2){10}-b212*y(2){11}-b213*y(2){12}
frml resid(3) = y(3)-b31-b32*y(3){1}-b33*y(3){2}-b34*y(3){3}-b35*y(3){4}-b36*y(3){5}-b37*y(3){6}-b38*y(3){7}-b39*y(3){8}-b310*y(3){9}-b311*y(3){10}-b312*y(3){11}-b313*y(3){12}
frml resid(4) = y(4)-b41-b42*y(4){1}-b43*y(4){2}-b44*y(4){3}-b45*y(4){4}-b46*y(4){5}-b47*y(4){6}-b48*y(4){7}-b49*y(4){8}-b410*y(4){9}-b411*y(4){10}-b412*y(4){11}-b413*y(4){12}
frml resid(5) = y(5)-b51-b52*y(5){1}-b53*y(5){2}-b54*y(5){3}-b55*y(5){4}-b56*y(5){5}-b57*y(5){6}-b58*y(5){7}-b59*y(5){8}-b510*y(5){9}-b511*y(5){10}-b512*y(5){11}-b513*y(5){12}
frml resid(6) = y(6)-b61-b62*y(6){1}-b63*y(6){2}-b64*y(6){3}-b65*y(6){4}-b66*y(6){5}-b67*y(6){6}-b68*y(6){7}-b69*y(6){8}-b610*y(6){9}-b611*y(6){10}-b612*y(6){11}-b613*y(6){12}
frml resid(7) = y(7)-b71-b72*y(7){1}-b73*y(7){2}-b74*y(7){3}-b75*y(7){4}-b76*y(7){5}-b77*y(7){6}-b78*y(7){7}-b79*y(7){8}-b710*y(7){9}-b711*y(7){10}-b712*y(7){11}-b713*y(7){12}
nlsystem(parmset=meanparms,resids=u) gstart gend resid
compute rr=%sigma
dis rr
*
* The paths of the covariance matrices and uu' are saved in the
* SERIES[SYMM] names H and UU. UX and HX are used to pull in residuals
* and H matrices.
*
declare series[symm] h uu
*
* ux is used when extracting a u vector
*
declare symm hx(n,n)
declare vect ux(n)
*
* These are used to initialize pre-sample variances.
*
gset h * gend = rr
gset uu * gend = rr
*
* This is a standard (normal) log likelihood formula for any
* multivariate GARCH model. The difference among these will be in the
* definitions of HF and RESID. The function %XT pulls information out of
* a matrix of SERIES.
*
declare frml[symm] hf
*
frml logl = $
hx = hf(t) , $
%do(i,1,n,u(i)=resid(i)) , $
ux = %xt(u,t), $
h(t)=hx, uu(t)=%outerxx(ux), $
%logdensity(hx,ux)
*****************************************************
*
* Panel GARCH - DVECH with restrictions
*
dec symm vcs(n,n)
dec real delta lambda gamma rho
dec symm vbs(n,n) vas(n,n)
*
compute vcs=rr*.1,delta=lambda=.3,gamma=rho=.3
nonlin(parmset=garchparms) vcs delta lambda gamma rho
frml hf = vcs+vbs.*h{1}+vas.*uu{1}
*
* Call once during START option to fill in the VAS and VBS arrays
*
function PGARCHInit
local integer i j
ewise vbs(i,j)=%if(i==j,delta,lambda)
ewise vas(i,j)=%if(i==j,gamma,rho)
end
*
maximize(start=PGARCHInit(),parmset=meanparms+garchparms,pmethod=simplex,piters=10,method=bfgs,iters=400) logl gstart gend
compute rr=%sigma
dis rr
set res1 = resid(1)
set res2 = resid(2)
set res3 = resid(3)
set res4 = resid(4)
set res5 = resid(5)
set res6 = resid(6)
set res7 = resid(7)
print / res1 res2 res3 res4 res5 res6 res7
dis vbs(1,1) vbs(1,2) vbs(3,3)
dis vas(1,1) vas(1,2) vas(3,3)
dis vcs(1,1) vcs(1,2) vcs(2,1)
I GOT THE PROPER ESTIMATES, HOWEVER I WANT TO OBTAIN THE COVARIANCE AND VARIANCE SERİES WHICH IS OBTAINED FROM THIS ESTIMATION.
IN THE OTHER FORM OF THE MULTIVARIATE GARCH PRGROM ICAN OBTAINED THEM BY USING
set covg = vc(1,2)+va(1,2)*h(1,2){1}+vb(1,2)*uu(1,2){1}
set var1 = vc(1,1)+va(1,1)*h(1,1){1}+vb(1,1)*uu(1,1){1}
set var2 = vc(2,2)+va(2,2)*h(2,2){1}+vb(2,2)*uu(2,2){1}
IS THERE A WAY TO OBTAINED THEM IN THIS PROGRAM?
KIND REGARDS
PANEL GARCH COVARIANCE SERIES
Re: PANEL GARCH COVARIANCE SERIES
You don't have to do any other calculations---after you've done the estimation, the SERIES[SYMM] H has the covariance matrices. See the description of how the HMATRICES option works on a standard GARCH model: https://estima.com/docs/RATS%2010%20Use ... f#page=328; what you can do with HH on that page, you can do with H in your program.