[R-SIG-Finance] Issue with external regressors in rugarch model

Jyoti Nair jyot|n@|r66 @end|ng |rom gm@||@com
Mon Jun 20 19:07:20 CEST 2022


Hi,

First of all, let me thank you for the wonderful job you all are doing for
our benefit. I am Jyoti Raj Nair, from India and have recently started
using R, especially rugarch package for GARCH. I am in a situation, where I
need to use external regressors, while using GARCH with 'ged' distribution.

What I find is, the moment I add the external regressors, I see that the
coefficient of the regressor becomes zero with a p-value of 1 and the GARCH
term becomes zero as well with a p-value of 1. When I run the same data
through Eviews, I note that the GARCH term becomes negative (obviously that
is incorrect I think).

I am enclosing the csv file with the data and I am using an ARIMA model of
(6,0,3). I am also pasting the program codes with the output below:

################## WITH VARIANCE REGRESSOR_1  ############################
>
> set.seed(1)
>
spec_regressor_1=ugarchspec(mean.model=list(armaOrder=c(6,3),external.regressors=NULL),variance.model
=
list(garchOrder=c(1,1),external.regressors=matrix(test_file$regressor_1),model="sGARCH"),distribution.model='std')
> fit_regressor_1=ugarchfit(spec_regressor_1,data=test_file$returns,
out.sample = 0, solver = "hybrid", solver.control = list(),
+                       fit.control = list(stationarity = 1, fixed.se = 0,
scale = 0, rec.init = 'all',
+                                          trunclag = 1000))
> fit_regressor_1

*---------------------------------*
*          GARCH Model Fit        *
*---------------------------------*

Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(6,0,3)
Distribution : std

Optimal Parameters
------------------------------------
        Estimate  Std. Error    t value Pr(>|t|)
mu      0.046490    0.009023   5.152506 0.000000
ar1    -0.304562    0.034959  -8.712062 0.000000
ar2    -0.449911    0.030220 -14.887902 0.000000
ar3    -0.842745    0.014272 -59.047512 0.000000
ar4     0.006586    0.014404   0.457241 0.647498
ar5    -0.000777    0.013210  -0.058807 0.953106
ar6     0.010526    0.012395   0.849194 0.395773
ma1     0.302272    0.032923   9.181110 0.000000
ma2     0.456017    0.027290  16.710319 0.000000
ma3     0.836477    0.001912 437.598759 0.000000
omega   0.008293    0.002490   3.330620 0.000867
alpha1  0.054722    0.008109   6.748313 0.000000
beta1   0.945127    0.007508 125.887799 0.000000
vxreg1  0.000000    0.046051   0.000000 1.000000
shape   3.400755    0.194712  17.465540 0.000000

Robust Standard Errors:
        Estimate  Std. Error    t value Pr(>|t|)
mu      0.046490    0.009397   4.947556 0.000001
ar1    -0.304562    0.031777  -9.584348 0.000000
ar2    -0.449911    0.028387 -15.849166 0.000000
ar3    -0.842745    0.015535 -54.249463 0.000000
ar4     0.006586    0.015160   0.434445 0.663965
ar5    -0.000777    0.011991  -0.064783 0.948347
ar6     0.010526    0.012765   0.824626 0.409584
ma1     0.302272    0.029547  10.230229 0.000000
ma2     0.456017    0.025565  17.837582 0.000000
ma3     0.836477    0.002513 332.874749 0.000000
omega   0.008293    0.002867   2.892342 0.003824
alpha1  0.054722    0.010927   5.007795 0.000001
beta1   0.945127    0.010335  91.450205 0.000000
vxreg1  0.000000    0.045982   0.000000 1.000000
shape   3.400755    0.209648  16.221227 0.000000

LogLikelihood : -6128.18

Information Criteria
------------------------------------

Akaike       2.3857
Bayes        2.4048
Shibata      2.3857
Hannan-Quinn 2.3924

Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
                         statistic p-value
Lag[1]                        2.45  0.1175
Lag[2*(p+q)+(p+q)-1][26]     11.70  0.9993
Lag[4*(p+q)+(p+q)-1][44]     17.75  0.9202
d.o.f=9
H0 : No serial correlation

Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
                        statistic  p-value
Lag[1]                     0.2478 0.618611
Lag[2*(p+q)+(p+q)-1][5]   10.0884 0.008738
Lag[4*(p+q)+(p+q)-1][9]   12.5385 0.013658
d.o.f=2

Weighted ARCH LM Tests
------------------------------------
            Statistic Shape Scale P-Value
ARCH Lag[3]    0.8764 0.500 2.000  0.3492
ARCH Lag[5]    1.8753 1.440 1.667  0.4995
ARCH Lag[7]    2.9691 2.315 1.543  0.5194

Nyblom stability test
------------------------------------
Joint Statistic:  6.9568
Individual Statistics:
mu     0.5652
ar1    0.0596
ar2    0.6626
ar3    0.1377
ar4    0.2910
ar5    0.5846
ar6    0.1087
ma1    0.0799
ma2    0.6294
ma3    0.1554
omega  1.3766
alpha1 0.6761
beta1  0.8438
vxreg1 0.3549
shape  2.2443

Asymptotic Critical Values (10% 5% 1%)
Joint Statistic:     3.26 3.54 4.07
Individual Statistic: 0.35 0.47 0.75

Sign Bias Test
------------------------------------
                   t-value   prob sig
Sign Bias           1.1788 0.2385
Negative Sign Bias  0.3801 0.7039
Positive Sign Bias  0.2309 0.8174
Joint Effect        1.6430 0.6497


Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
  group statistic p-value(g-1)
1    20     57.88    8.324e-06
2    30     75.30    5.521e-06
3    40     79.59    1.341e-04
4    50     86.10    8.374e-04


Elapsed time : 3.823148

>
> ################ WITH VARIANCE REGRESSOR_2 #########################
>
> set.seed(1)
>
spec_regressor_2=ugarchspec(mean.model=list(armaOrder=c(6,3),external.regressors=NULL),variance.model
=
list(garchOrder=c(1,1),external.regressors=matrix(test_file$regressor_2),model="sGARCH"),distribution.model='std')
> fit_regressor_2=ugarchfit(spec_regressor_2,data=test_file$returns,
out.sample = 0, solver = "hybrid", solver.control = list(),
+                           fit.control = list(stationarity = 1, fixed.se =
0, scale = 0, rec.init = 'all',
+                                              trunclag = 1000))
> fit_regressor_2

*---------------------------------*
*          GARCH Model Fit        *
*---------------------------------*

Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(6,0,3)
Distribution : std

Optimal Parameters
------------------------------------
        Estimate  Std. Error     t value Pr(>|t|)
mu      0.056893    0.006314  9.0108e+00 0.000000
ar1    -0.386381    0.001677 -2.3041e+02 0.000000
ar2    -0.268396    0.001677 -1.6005e+02 0.000000
ar3    -0.900510    0.000671 -1.3413e+03 0.000000
ar4    -0.010040    0.003353 -2.9944e+00 0.002750
ar5     0.010369    0.003919  2.6462e+00 0.008141
ar6     0.001257    0.003364  3.7369e-01 0.708633
ma1     0.372461    0.000007  5.0185e+04 0.000000
ma2     0.261934    0.000002  1.1840e+05 0.000000
ma3     0.889388    0.000003  2.8688e+05 0.000000
omega   0.000000    0.000079  0.0000e+00 1.000000
alpha1  0.028093    0.016322  1.7212e+00 0.085211
beta1   0.000000    0.006471  0.0000e+00 1.000000
vxreg1  0.410436    0.017836  2.3011e+01 0.000000
shape   4.267964    0.309290  1.3799e+01 0.000000

Robust Standard Errors:
        Estimate  Std. Error     t value Pr(>|t|)
mu      0.056893    0.006692     8.50172 0.000000
ar1    -0.386381    0.004571   -84.53490 0.000000
ar2    -0.268396    0.005127   -52.35384 0.000000
ar3    -0.900510    0.001959  -459.64856 0.000000
ar4    -0.010040    0.004892    -2.05217 0.040153
ar5     0.010369    0.005776     1.79514 0.072632
ar6     0.001257    0.003590     0.35009 0.726267
ma1     0.372461    0.000020 18325.44524 0.000000
ma2     0.261934    0.000008 32098.56753 0.000000
ma3     0.889388    0.000013 68274.83047 0.000000
omega   0.000000    0.000006     0.00000 1.000000
alpha1  0.028093    0.050217     0.55943 0.575869
beta1   0.000000    0.020105     0.00000 1.000000
vxreg1  0.410436    0.024166    16.98398 0.000000
shape   4.267964    0.672608     6.34540 0.000000

LogLikelihood : -5709.452

Information Criteria
------------------------------------

Akaike       2.2231
Bayes        2.2422
Shibata      2.2231
Hannan-Quinn 2.2298

Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
                         statistic  p-value
Lag[1]                       1.683 0.194577
Lag[2*(p+q)+(p+q)-1][26]    14.948 0.008347
Lag[4*(p+q)+(p+q)-1][44]    23.716 0.347564
d.o.f=9
H0 : No serial correlation

Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
                        statistic   p-value
Lag[1]                      26.93 2.111e-07
Lag[2*(p+q)+(p+q)-1][5]    324.77 0.000e+00
Lag[4*(p+q)+(p+q)-1][9]    541.03 0.000e+00
d.o.f=2

Weighted ARCH LM Tests
------------------------------------
            Statistic Shape Scale P-Value
ARCH Lag[3]     329.5 0.500 2.000       0
ARCH Lag[5]     391.9 1.440 1.667       0
ARCH Lag[7]     532.0 2.315 1.543       0

Nyblom stability test
------------------------------------
Joint Statistic:  78.6851
Individual Statistics:
mu      0.14940
ar1     0.06556
ar2     0.06370
ar3     0.05691
ar4     0.06376
ar5     0.06364
ar6     0.05845
ma1     0.05920
ma2     0.05870
ma3     0.05426
omega  72.17748
alpha1  5.49804
beta1  42.01761
vxreg1 13.53124
shape   6.78982

Asymptotic Critical Values (10% 5% 1%)
Joint Statistic:     3.26 3.54 4.07
Individual Statistic: 0.35 0.47 0.75

Sign Bias Test
------------------------------------
                   t-value     prob sig
Sign Bias            1.724 0.084679   *
Negative Sign Bias   1.589 0.112144
Positive Sign Bias   1.874 0.061044   *
Joint Effect        12.630 0.005508 ***


Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
  group statistic p-value(g-1)
1    20     14.49       0.7545
2    30     23.92       0.7328
3    40     35.17       0.6455
4    50     46.49       0.5757


Elapsed time : 4.642887

>
> ############## WITH BOTH VARIANCE REGRESSORS ########################
>
> set.seed(1)
> regrs_both=cbind(test_file$regressor_1,test_file$regressor_2)
>
spec_both=ugarchspec(mean.model=list(armaOrder=c(6,3),external.regressors=NULL),variance.model
=
list(garchOrder=c(1,1),external.regressors=regrs_both,model="sGARCH"),distribution.model='std')
> fit_both=ugarchfit(spec_both,data=working_gold$fut_ret, out.sample = 0,
solver = "hybrid", solver.control = list(),
+                     fit.control = list(stationarity = 1, fixed.se = 0,
scale = 0, rec.init = 'all',
+                                        trunclag = 1000))
> fit_both

*---------------------------------*
*          GARCH Model Fit        *
*---------------------------------*

Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(6,0,3)
Distribution : std

Optimal Parameters
------------------------------------
        Estimate  Std. Error   t value Pr(>|t|)
mu      0.056499    0.006218  9.087103 0.000000
ar1    -0.861647    0.329725 -2.613229 0.008969
ar2    -0.447792    0.384478 -1.164674 0.244151
ar3    -0.303149    0.250935 -1.208077 0.227018
ar4    -0.009216    0.011431 -0.806279 0.420082
ar5     0.011105    0.011176  0.993648 0.320394
ar6     0.017919    0.009227  1.941936 0.052145
ma1     0.846551    0.329666  2.567903 0.010232
ma2     0.428875    0.378405  1.133375 0.257057
ma3     0.286646    0.246661  1.162107 0.245192
omega   0.000000    0.000078  0.000000 1.000000
alpha1  0.029239    0.008270  3.535311 0.000407
beta1   0.000000    0.011269  0.000000 1.000000
vxreg1  0.000000    0.018195  0.000005 0.999996
vxreg2  0.404066    0.020718 19.503355 0.000000
shape   4.362421    0.254501 17.141096 0.000000

Robust Standard Errors:
        Estimate  Std. Error   t value Pr(>|t|)
mu      0.056499    0.006035  9.362484 0.000000
ar1    -0.861647    0.729126 -1.181753 0.237304
ar2    -0.447792    0.673992 -0.664387 0.506442
ar3    -0.303149    0.235657 -1.286396 0.198305
ar4    -0.009216    0.018479 -0.498731 0.617969
ar5     0.011105    0.014195  0.782318 0.434028
ar6     0.017919    0.009729  1.841780 0.065507
ma1     0.846551    0.729498  1.160458 0.245862
ma2     0.428875    0.662109  0.647740 0.517153
ma3     0.286646    0.236139  1.213889 0.224790
omega   0.000000    0.000001  0.000000 1.000000
alpha1  0.029239    0.009915  2.948970 0.003188
beta1   0.000000    0.024829  0.000000 1.000000
vxreg1  0.000000    0.096070  0.000001 0.999999
vxreg2  0.404066    0.039091 10.336657 0.000000
shape   4.362421    0.352650 12.370411 0.000000

LogLikelihood : -5714.48

Information Criteria
------------------------------------

Akaike       2.2254
Bayes        2.2458
Shibata      2.2254
Hannan-Quinn 2.2325

Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
                         statistic   p-value
Lag[1]                       2.132 0.1442055
Lag[2*(p+q)+(p+q)-1][26]    15.742 0.0001408
Lag[4*(p+q)+(p+q)-1][44]    25.814 0.1705274
d.o.f=9
H0 : No serial correlation

Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
                        statistic   p-value
Lag[1]                      26.89 2.151e-07
Lag[2*(p+q)+(p+q)-1][5]    325.40 0.000e+00
Lag[4*(p+q)+(p+q)-1][9]    543.62 0.000e+00
d.o.f=2

Weighted ARCH LM Tests
------------------------------------
            Statistic Shape Scale P-Value
ARCH Lag[3]     323.3 0.500 2.000       0
ARCH Lag[5]     388.7 1.440 1.667       0
ARCH Lag[7]     530.5 2.315 1.543       0

Nyblom stability test
------------------------------------
Joint Statistic:  90.69
Individual Statistics:
mu      0.15586
ar1     0.40511
ar2     0.05629
ar3     0.02915
ar4     0.06826
ar5     0.15741
ar6     0.13758
ma1     0.40301
ma2     0.05473
ma3     0.02894
omega  71.73162
alpha1  6.23893
beta1  38.74346
vxreg1 34.53084
vxreg2 12.80609
shape   6.73046

Asymptotic Critical Values (10% 5% 1%)
Joint Statistic:     3.46 3.75 4.3
Individual Statistic: 0.35 0.47 0.75

Sign Bias Test
------------------------------------
                   t-value     prob sig
Sign Bias            1.890 0.058842   *
Negative Sign Bias   1.598 0.110040
Positive Sign Bias   1.709 0.087457   *
Joint Effect        12.695 0.005346 ***


Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
  group statistic p-value(g-1)
1    20     19.37      0.43353
2    30     35.57      0.18634
3    40     54.05      0.05505
4    50     51.61      0.37207


Elapsed time : 6.79606



I would be highly obliged if you could point out where I am wrong..

Best regards

J R Nair
Attachments area

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20220620/eefb4ef2/attachment.html>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rfile_ext_reg_jrnair.csv
Type: text/csv
Size: 193592 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20220620/eefb4ef2/attachment.csv>


More information about the R-SIG-Finance mailing list