Page 1 of 1

Multivariate Value at Risk with GARCH

Posted: Wed Jun 05, 2013 7:39 pm
by JustineFH
Hi guys,

I would like to ask this, so I have the following code for univariate VAR, with GARCH. I'm trying to edit it calculate VAR for a portfolio (consist of 10 assets).
I can assign weights and just do a univariate Garch for the portfolio, but I think it's better to perform multivariate.
I hope you could give me some suggestion, really appreciate it.

Code: Select all

rndseed 1764 !nreps= 10000 !horizon = 10 !alpha = 5 '(in percent) smpl @all series r_t = dlog(general_motors) smpl 1 5119 equation eq1.arch(m=100,c=1E-5) r_t c 'runs a GARCH(1,1) eq1.makegarch h_t 'generate portofio variances (same as proc > Make GARCH variance series) series varepsilon_t = r_t - @coefs(1) 'calc the standard errors (could just get resids) series z_t = varepsilon_t/(h_t^0.5) 'calc the standardised residuals expand 1 !nreps smpl @all series aggret series bstrapz !hend = !horizon + 5119 smpl 5120 !hend eq1.forecast(f=na) r_tf varepsilon_tf h_tf ' forecast the portfolio mean, s.e. and variance for !z=1 to !nreps 'looping over reps for !i = 1 to !horizon 'looping over the horizon bstrapz(5120+!i) = z_t(1 + @round(@rnd*5119)) 'bootstrapping a random std. resid. next r_tf = @coefs(1) + bstrapz*(h_tf^0.5) aggret(!z) = @sum(r_tf) next smpl @all sort aggret 'sorting in this way will jumble up all other series - must do last (or just comment out and go manual) scalar _{!horizon}d_{!alpha}pc_var_ret = aggret((!alpha/100)*!nreps)

Re: Multivariate Value at Risk with GARCH

Posted: Thu Jun 06, 2013 7:20 am
by JustineFH
Also, when I open "as system" my 14 assets and run through, say diagonal VEC garch, I'm ignoring volatility spill over effect but it's still a form of multivariate garch right?

Re: Multivariate Value at Risk with GARCH

Posted: Fri Jun 07, 2013 2:41 am
by trubador
It would be much better to employ both (univariate and multivariate) models and see if there is a significant/meaningful improvement post hoc. And yes, diagonal models ignore the spillover effect but they are still valid multivariate garch models.

Re: Multivariate Value at Risk with GARCH

Posted: Sat Jun 08, 2013 4:21 am
by JustineFH
Thanks, the code above is for univariate only, is there anyway I can add for multivariate? so I have 10 assets, meaning really large var-covar matrix, any idea to reduce the code?

Re: Multivariate Value at Risk with GARCH

Posted: Tue Jun 11, 2013 1:27 am
by trubador
You can use the "System" object by selecting "ARCH-Conditional Heteroskedasticity" as the estimation method.