Page 1 of 1
REGIME DUMMIES IN MGARCH variance-covariance matrix
Posted: Fri Mar 20, 2009 4:02 am
by amcqeen
i am doing a VAR-GARCH(1,1) BEKK model upper triangular
I am interested in adding a shift dummy in the transmission of volatility
and i want to add a regime dummy in the variance covariance MATRIX Ht (in some covariances)
all non diagonal elements of the A matrix and B matrix [ A(3,3) AND B(3,3)] will be like
i.e. a21 now will be (a12+a12d*D) and (b12+b12d*D)
i.e. a21 now will be (a13+a13d*D) and (b13+b13d*D)
i.e. a21 now will be (a23+a23d*D) and (b23+b23d*D)
i can create a new matrix D and a new F for the a12d and b12d b but how can i get them multiplied by the dummy
i hope you understant what i mean and what my question is
Regards
Maria
Re: REGIME DUMMIES IN MGARCH variance-covariance matrix
Posted: Tue Mar 24, 2009 10:06 am
by TomDoan
Since you must be using MAXIMIZE to do the upper triangular BEKK, could you post the set up formulas for your model. It would be easier to show how to adjust it if I could see what you already have.
Re: REGIME DUMMIES IN MGARCH variance-covariance matrix
Posted: Wed Mar 25, 2009 10:17 am
by amcqeen
This is my code:
Code: Select all
open data ARG1.xls
data(format=xls,org=columns) 1 284 lmr fxr mmr
*
*
* 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.
*
n(parmset=meanparms) b o(1) o(2) w(1) w(2) k
frml lmreq lmr = b(1) + o(1)*lmr{1} + w(1)*fxr{1} + k(1)*mmr{1} + u(1)
frml fxreq fxr = b(2) + o(2)*lmr{1} + w(2)*fxr{1} + k(2)*mmr{1} + u(2)
frml mmreq mmr= b(3) + k(3)*mmr{1} + u(3)
frml resid(1) = (lmr-b(1)-o(1)*lmr{1}-w(1)*fxr{1}-k(1)*mmr{1})
frml resid(2) = (fxr-b(2)-o(2)*lmr{1}-w(2)*fxr{1}-k(2)*mmr{1})
frml resid(3) = (mmr-b(3)-k(3)*mmr{1})
nlsystem(parmset=meanparms,resids=u) gstart gend resid
compute rr=%sigma
*
* 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)
*****************************************************
*
* Positive definite parameterization (BEKK,EK)
* This enforces a positive definite covariance matrix by writing the covariance
* matrix evolution as
*
* V(t) = C'C + A'u(t)u(t)'A + B'V(t-1)B
*
* Note that the parameters are not globally identified: changing the signs of all
* members of C, A or B will have no effect on the function value. Using
* PMETHOD=SIMPLEX to begin is quite important with this setup, to pull the
* estimates away from zero before starting the derivative-based methods.
*
dec rect var(n,n) vbr(n,n)
dec packed vcr(n,n)
nonlin(parmset=garchparms) vcr var vbr
nonlin(parmset=restrictions) var(2,1)=var(3,1)=var(3,2)=0.0 vbr(2,1)=vbr(3,1)=vbr(3,2)=0.0
frml hf = $
hx=h{1},uux=uu{1},$
%ltouterxx(vcr)+%mqform(uux,var)+%mqform(hx,vbr)
*
* Initialize c's from the decomp of the covariance matrix
*
compute vcr = %decomp(rr)
compute var = %mscalar(.05) , vbr = %mscalar(.05)
*
maximize(parmset=meanparms+garchparms,pmethod=simplex,piters=100,method=bfgs,robust,iters=2500) logl gstart gend
and i want to make the elements of the variance- covariance matrix elements, the elements var(1,2) and vbr(1,2) [a(1,2) and b(1,2) ] be
[a(1,2)+ad(1,2)*D]^2 * uux insead of a(1,2)^2uux
[b(1,2)+bd(1,2)*D]^2 * hx insead of b(1,2)^2hx
add a dummy in this matrix for variable y(2) to see about shift in volatility parameters
Thank you in advance
Maria
Re: REGIME DUMMIES IN MGARCH variance-covariance matrix
Posted: Wed Mar 25, 2009 4:02 pm
by TomDoan
Code: Select all
dec rect var(n,n) vbr(n,n)
dec packed vcr(n,n)
nonlin(parmset=garchparms) vcr var vbr
nonlin(parmset=restrictions) var(2,1)=var(3,1)=var(3,2)=0.0 vbr(2,1)=vbr(3,1)=vbr(3,2)=0.0
frml hf = $
hx=h{1},uux=uu{1},$
%ltouterxx(vcr)+%mqform(uux,var)+%mqform(hx,vbr)
*
* Initialize c's from the decomp of the covariance matrix
*
compute vcr = %decomp(rr)
compute var = %mscalar(.05) , vbr = %mscalar(.05)
Change to
Code: Select all
dec rect var(n,n) vbr(n,n) vadr(n,n) vbdr(n,n)
dec packed vcr(n,n)
nonlin(parmset=garchparms) vcr var vbr vadr vbdr
nonlin(parmset=restrictions) var(2,1)=var(3,1)=var(3,2)=0.0 vbr(2,1)=vbr(3,1)=vbr(3,2)=0.0 $
vadr(2,1)=vadr(3,1)=vadr(3,2)=0.0 vbdr(2,1)=vbdr(3,1)=vbdr(3,2)=0.0
frml hf = $
hx=h{1},uux=uu{1},$
%ltouterxx(vcr)+%mqform(uux,var+vadr*d)+%mqform(hx,vbr+vbdr*d)
*
* Initialize c's from the decomp of the covariance matrix
*
compute vcr = %decomp(rr)
compute var = %mscalar(.05) , vbr = %mscalar(.05)
compute vadr = %const(0.0) , vbdr = %const(0.0)
I think that's what you want. I wasn't sure whether the shifts were to apply to the full lower triangle.
Re: REGIME DUMMIES IN MGARCH variance-covariance matrix
Posted: Wed Jan 13, 2016 9:07 am
by klaus86
I use a slightly modified version of the code above. I have 3 variables and include a shift dummy in the matrices A and B for the spillovers from variable 1 to variable 2. Hence, I now have (a12+a12d*D) and (b12+b12d*D). My main objective is to ascertain whether volatility spillovers increase or decrease during the periods determined by the dummy variable. My results for the variance parameters are as follows:
Code: Select all
37. VCR(1,1) -0.242759553 0.047008027 -5.16421 0.00000024
38. VCR(2,1) -0.112588062 0.048688987 -2.31239 0.02075605
39. VCR(2,2) 0.165953661 0.036563568 4.53877 0.00000566
40. VCR(3,1) -0.256946847 0.043427005 -5.91675 0.00000000
41. VCR(3,2) 0.018838866 0.045822848 0.41112 0.68098172
42. VCR(3,3) 0.001094397 0.046161770 0.02371 0.98108563
43. VAR(1,1) 0.248548665 0.052452383 4.73856 0.00000215
44. VAR(2,1) -0.096977023 0.055244239 -1.75542 0.07918693
45. VAR(3,1) -0.015451410 0.025670194 -0.60192 0.54722720
46. VAR(1,2) -0.195897122 0.053806681 -3.64076 0.00027184
47. VAR(2,2) 0.363187910 0.051663019 7.02994 0.00000000
48. VAR(3,2) -0.032918831 0.025685074 -1.28163 0.19997151
49. VAR(1,3) 0.067706515 0.059561369 1.13675 0.25564191
50. VAR(2,3) -0.019372436 0.061492465 -0.31504 0.75273314
51. VAR(3,3) 0.146834490 0.024929106 5.89008 0.00000000
52. VBR(1,1) 0.930481480 0.003733035 249.25605 0.00000000
53. VBR(2,1) 0.058563915 0.003623123 16.16393 0.00000000
54. VBR(3,1) -0.000413297 0.006274743 -0.06587 0.94748392
55. VBR(1,2) 0.051815546 0.017765173 2.91669 0.00353764
56. VBR(2,2) 0.921382803 0.019593289 47.02543 0.00000000
57. VBR(3,2) 0.010916480 0.006040102 1.80733 0.07071026
58. VBR(1,3) -0.038490962 0.021197940 -1.81579 0.06940292
59. VBR(2,3) 0.030052816 0.021454074 1.40080 0.16127460
60. VBR(3,3) 0.982772767 0.005175044 189.90617 0.00000000
61. VADR(1,1) 0.000000000 0.000000000 0.00000 0.00000000
62. VADR(2,1) 0.000000000 0.000000000 0.00000 0.00000000
63. VADR(3,1) 0.000000000 0.000000000 0.00000 0.00000000
64. VADR(1,2) 0.085349476 0.040655277 2.09935 0.03578645
65. VADR(2,2) 0.000000000 0.000000000 0.00000 0.00000000
66. VADR(3,2) 0.000000000 0.000000000 0.00000 0.00000000
67. VADR(1,3) 0.000000000 0.000000000 0.00000 0.00000000
68. VADR(2,3) 0.000000000 0.000000000 0.00000 0.00000000
69. VADR(3,3) 0.000000000 0.000000000 0.00000 0.00000000
70. VBDR(1,1) 0.000000000 0.000000000 0.00000 0.00000000
71. VBDR(2,1) 0.000000000 0.000000000 0.00000 0.00000000
72. VBDR(3,1) 0.000000000 0.000000000 0.00000 0.00000000
73. VBDR(1,2) -0.009345252 0.010318536 -0.90568 0.36510732
74. VBDR(2,2) 0.000000000 0.000000000 0.00000 0.00000000
75. VBDR(3,2) 0.000000000 0.000000000 0.00000 0.00000000
76. VBDR(1,3) 0.000000000 0.000000000 0.00000 0.00000000
77. VBDR(2,3) 0.000000000 0.000000000 0.00000 0.00000000
78. VBDR(3,3) 0.000000000 0.000000000 0.00000 0.00000000
Given the results above I would conclude that volatility spillovers from variable 1 to variable 2 are
lower during the periods where the dummy equals one, since the magnitude (in absolute values) and level of significance of the parameter VADR(1,2) is lower than the magnitude and level of significance of VAR(1,2). Is this a valid conclusion of my results? Any comments are much appreciated.
Re: REGIME DUMMIES IN MGARCH variance-covariance matrix
Posted: Wed Jan 13, 2016 9:56 am
by TomDoan
I assume it's intentional that almost all of VADR and VABR are zero.
If you set this up as described above, then yes, you have a less negative spillover during the dummied period.