Simulating a MV-GARCH process

Discussions of ARCH, GARCH, and related models
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Simulating a MV-GARCH process

Unread post by TomDoan »

The following simulates a bivariate GARCH process. It's written to be fairly easy to adapt to more than two variables. It could also be used for some other MV-GARCH process - you would just need to redo the HF formula.

Code: Select all

all 500
compute n=2
*
* u is the simulated GARCH process
*
dec vect[series] u(n)
*
* H is the series of variance matrices, UU is the series of lagged outer products of the residuals.
*
dec series[symm] h uu
dec symm vc(n,n) va(n,n) vb(n,n)
compute vc=||.05|.01,.05||
compute va=||.90|.85,.90||
compute vb=||.05|.05,.05||
*
* Compute the stationary variance
*
dec symm h0(n,n)
ewise h0(i,j)=vc(i,j)/(1-va(i,j)-vb(i,j))
*
dec frml[symm] hf hu
dec symm hx
dec vect ux
*
frml hf   = vc+va.*h{1}+vb.*uu{1}
frml hu   = hx=hf,ux=%ranmvnormal(%decomp(hx)),uu=%outerxx(ux),%pt(u,t,ux),hx
*
* Initialize the UU and H series for the pre-sample values
*
gset uu   = h0 
gset h    = h0 
*
* Generate starting in entry 2.
*
gset h 2 500 = hu(t)
*
* Graph the series and variance series
*
graph(footer="First simulated series")
# u(1)
graph(footer="Second simulated series")
# u(2)
set h11 = h(t)(1,1)
graph(footer="Simulated variance for first series")
# h11


Last bumped by TomDoan on Wed Apr 13, 2016 10:26 am.
Post Reply