Examples / GARCHDECO.RPF |
GARCHDECO.RPF estimates a multivariate GARCH with DECO estimator. DECO (Dynamic Equicorrelation) is from Engle and Kelly(2011).
Full Program
all 6237
open data g10xrate.xls
data(format=xls,org=columns) / usxjpn usxfra usxsui usxnld usxuk usxbel usxger usxcan
*
compute n=8
dec vect[series] x(n)
compute i=0
dofor [string] s = 'jpn' 'fra' 'sui' 'nld' 'uk' 'bel' 'ger' 'can'
compute xrate='usx'+s,i=i+1
set x(i) = 100.0*log(%s(xrate)/%s(xrate){1})
end dofor
*
dec vect[series] eps(n)
*
* 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)
end do i
*
* Compute the covariance matrix of the standardized residuals.
*
vcv(matrix=rr,nocenter,noprint)
# eps
*
* When "dotted" with a correlation matrix, the "summer" matrix will
* compute the average of the pairwise correlations.
*
dec symm summer(n,n)
ewise summer(i,j)=1.0/(n*(n-1))*(i<>j)
*
* Create a series for the sequential estimates of rho. This is
* initialized to an estimate of rho given the full data set. (Not really
* necessary to do the latter).
*
compute rhox=%dot(summer,%cvtocorr(rr))
set rho = rhox
*
* Set the target matrix to the equicorrelated estimate using the full
* sample.
*
ewise rr(i,j)=%if(i==j,1.0,rhox)
*
* 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
*
* Compute the sums across i at t needed later
*
set sumsq = %sum(%xt(eps,t).^2)
set sqsum = %sum(%xt(eps,t))^2
*
* Log likelihood for the DECO phase, taking the standardized residuals
* as given.
*
nonlin a b
dec frml[symm] qf
frml qf = (qx=(1-a-b)*rr+a*uu{1}+b*q{1})
frml logl = q=qf,rho=%dot(summer,%cvtocorr(qx)),-.5*$
(n*log(2*%pi)+(n-1)*log(1-rho)+log(1+(n-1)*rho)+1.0/(1-rho)*(sumsq-rho/(1+(n-1)*rho)*sqsum))
compute b=.80,a=.10
maximize logl 2 *
Output
GARCH Model - Estimation by BFGS
Convergence in 22 Iterations. Final criterion was 0.0000005 <= 0.0000100
Dependent Variable X(1)
Usable Observations 6236
Log Likelihood -5395.4384
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(X(1)) 0.0001885386 0.0062775497 0.03003 0.97604010
2. C 0.0074286872 0.0010353824 7.17482 0.00000000
3. A 0.1762878700 0.0115016083 15.32724 0.00000000
4. B 0.8372682877 0.0091693967 91.31116 0.00000000
GARCH Model - Estimation by BFGS
Convergence in 31 Iterations. Final criterion was 0.0000033 <= 0.0000100
Dependent Variable X(2)
Usable Observations 6236
Log Likelihood -5648.7083
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(X(2)) -0.001465587 0.006217492 -0.23572 0.81364996
2. C 0.008578832 0.001469955 5.83612 0.00000001
3. A 0.112627522 0.009253236 12.17169 0.00000000
4. B 0.878200227 0.009995168 87.86248 0.00000000
GARCH Model - Estimation by BFGS
Convergence in 31 Iterations. Final criterion was 0.0000046 <= 0.0000100
Dependent Variable X(3)
Usable Observations 6236
Log Likelihood -6685.4346
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(X(3)) 0.0034505248 0.0079161530 0.43588 0.66292087
2. C 0.0110980759 0.0020278143 5.47293 0.00000004
3. A 0.0969338848 0.0083271346 11.64073 0.00000000
4. B 0.8887829993 0.0099051503 89.72938 0.00000000
GARCH Model - Estimation by BFGS
Convergence in 25 Iterations. Final criterion was 0.0000068 <= 0.0000100
Dependent Variable X(4)
Usable Observations 6236
Log Likelihood -5789.4720
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(X(4)) 0.0005406786 0.0079768493 0.06778 0.94595999
2. C 0.0052069296 0.0016900244 3.08098 0.00206321
3. A 0.0581595698 0.0077739740 7.48132 0.00000000
4. B 0.9313458759 0.0108410205 85.90943 0.00000000
GARCH Model - Estimation by BFGS
Convergence in 21 Iterations. Final criterion was 0.0000015 <= 0.0000100
Dependent Variable X(5)
Usable Observations 6236
Log Likelihood -5334.9891
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(X(5)) -0.004613776 0.006587678 -0.70036 0.48369972
2. C 0.005767246 0.000798804 7.21985 0.00000000
3. A 0.079810124 0.007662257 10.41601 0.00000000
4. B 0.909067819 0.007912629 114.88822 0.00000000
GARCH Model - Estimation by BFGS
Convergence in 24 Iterations. Final criterion was 0.0000094 <= 0.0000100
Dependent Variable X(6)
Usable Observations 6236
Log Likelihood -5893.0269
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(X(6)) 0.0017002258 0.0073343143 0.23182 0.81667941
2. C 0.0169073691 0.0026170997 6.46035 0.00000000
3. A 0.1018532208 0.0112012630 9.09301 0.00000000
4. B 0.8650936238 0.0144946210 59.68377 0.00000000
GARCH Model - Estimation by BFGS
Convergence in 24 Iterations. Final criterion was 0.0000050 <= 0.0000100
Dependent Variable X(7)
Usable Observations 6236
Log Likelihood -5936.7270
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(X(7)) 0.0027233373 0.0074853689 0.36382 0.71599139
2. C 0.0124347245 0.0027168401 4.57691 0.00000472
3. A 0.0853711124 0.0102944434 8.29293 0.00000000
4. B 0.8899813423 0.0147890876 60.17825 0.00000000
GARCH Model - Estimation by BFGS
Convergence in 27 Iterations. Final criterion was 0.0000086 <= 0.0000100
Dependent Variable X(8)
Usable Observations 6236
Log Likelihood 410.0677
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(X(8)) -0.002972048 0.002491112 -1.19306 0.23284568
2. C 0.001021214 0.000203662 5.01425 0.00000053
3. A 0.118678672 0.010276661 11.54837 0.00000000
4. B 0.874322435 0.010877249 80.38084 0.00000000
MAXIMIZE - Estimation by BFGS
Convergence in 12 Iterations. Final criterion was 0.0000021 <= 0.0000100
Usable Observations 6236
Function Value -56172.2808
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. A 0.0354644470 0.0021814312 16.25742 0.00000000
2. B 0.9528679422 0.0029977048 317.86583 0.00000000
Copyright © 2024 Thomas A. Doan