In: Statistics and Probability
Build a garch model using the following monthly change data for Mexico. Use R
DATE | INFLATION |
ene-05 | 4.54 |
feb-05 | 4.27 |
mar-05 | 4.39 |
abr-05 | 4.6 |
may-05 | 4.6 |
jun-05 | 4.33 |
jul-05 | 4.47 |
ago-05 | 3.95 |
sep-05 | 3.51 |
oct-05 | 3.05 |
nov-05 | 2.91 |
dic-05 | 3.33 |
ene-06 | 3.94 |
feb-06 | 3.75 |
mar-06 | 3.41 |
abr-06 | 3.2 |
may-06 | 3 |
jun-06 | 3.18 |
jul-06 | 3.06 |
ago-06 | 3.47 |
sep-06 | 4.09 |
oct-06 | 4.29 |
nov-06 | 4.09 |
dic-06 | 4.05 |
ene-07 | 3.98 |
feb-07 | 4.11 |
mar-07 | 4.21 |
abr-07 | 3.99 |
may-07 | 3.95 |
jun-07 | 3.98 |
jul-07 | 4.14 |
ago-07 | 4.03 |
sep-07 | 3.79 |
oct-07 | 3.74 |
nov-07 | 3.93 |
dic-07 | 3.76 |
ene-08 | 3.7 |
feb-08 | 3.72 |
mar-08 | 4.25 |
abr-08 | 4.55 |
may-08 | 4.95 |
jun-08 | 5.26 |
jul-08 | 5.39 |
ago-08 | 5.57 |
sep-08 | 5.47 |
oct-08 | 5.78 |
nov-08 | 6.23 |
dic-08 | 6.53 |
R CODE:
inflation<-c(4.54,4.29,4.37,4.6,4.6,4.33,4.47,3.95,3.51,3.05,2.91,3.33,3.94,3.75,3.41,3.2,3,3.18,3.06,3.47,4.09,4.29,4.09,4.05,3.98,4.11,4.21,3.99,3.95,3.98,4.14,4.03,3.79,3.74,3.93,3.76,3.7,3.72,4.25,4.55,4.95,5.26,5.39,5.57,5.47,5.78,6.23,6.53)
library(tseries)
garch(inflation)
R OUTPUT:
***** ESTIMATION WITH ANALYTICAL GRADIENT *****
I INITIAL X(I) D(I)
1 5.977270e-01 1.000e+00
2 5.000000e-02 1.000e+00
3 5.000000e-02 1.000e+00
IT NF F RELDF PRELDF RELDX STPPAR D*STEP NPRELDF
0 1 2.726e+02
1 2 9.053e+01 6.68e-01 1.03e+01 7.9e-01 2.8e+03 1.0e+00
1.46e+04
2 4 9.030e+01 2.50e-03 2.71e-03 2.4e-02 2.0e+00 5.0e-02
1.35e-01
3 6 9.012e+01 2.04e-03 1.80e-03 2.3e-02 9.0e-02 5.0e-02
2.90e-03
4 7 9.002e+01 1.14e-03 8.86e-04 1.9e-02 2.0e+00 5.0e-02
1.24e-03
5 9 9.002e+01 2.43e-05 2.44e-05 9.4e-04 1.1e+01 2.3e-03
1.27e-04
6 11 9.001e+01 4.08e-05 4.08e-05 1.9e-03 2.1e+00 4.7e-03
1.02e-04
7 13 9.001e+01 6.91e-06 6.91e-06 3.9e-04 1.8e+01 9.4e-04
6.15e-05
8 15 9.001e+01 1.26e-05 1.26e-05 7.9e-04 3.0e+00 1.9e-03
5.55e-05
9 17 9.001e+01 2.32e-06 2.32e-06 1.6e-04 3.7e+01 3.7e-04
4.31e-05
10 19 9.001e+01 4.56e-07 4.56e-07 3.2e-05 1.8e+02 7.5e-05
4.13e-05
11 21 9.001e+01 9.03e-07 9.03e-07 6.5e-05 2.3e+01 1.5e-04
4.10e-05
12 23 9.001e+01 1.79e-07 1.79e-07 1.3e-05 4.3e+02 3.0e-05
4.01e-05
13 25 9.001e+01 3.58e-07 3.58e-07 2.6e-05 5.5e+01 6.0e-05
4.00e-05
14 27 9.001e+01 7.13e-08 7.13e-08 5.2e-06 1.1e+03 1.2e-05
3.97e-05
15 29 9.001e+01 1.43e-08 1.43e-08 1.0e-06 5.3e+03 2.4e-06
3.96e-05
16 32 9.001e+01 1.14e-07 1.14e-07 8.3e-06 1.7e+02 1.9e-05
3.96e-05
17 36 9.001e+01 2.28e-10 2.28e-10 1.7e-08 3.3e+05 3.8e-08
3.95e-05
18 38 9.001e+01 4.55e-10 4.55e-10 3.3e-08 4.2e+04 7.7e-08
3.95e-05
19 40 9.001e+01 9.11e-11 9.11e-11 6.7e-09 8.3e+05 1.5e-08
3.95e-05
20 43 9.001e+01 7.29e-10 7.29e-10 5.3e-08 2.6e+04 1.2e-07
3.95e-05
21 46 9.001e+01 1.46e-11 1.46e-11 1.1e-09 5.2e+06 2.5e-09
3.95e-05
22 48 9.001e+01 2.91e-12 2.91e-12 2.1e-10 2.6e+07 4.9e-10
3.95e-05
23 51 9.001e+01 2.33e-11 2.33e-11 1.7e-09 8.1e+05 3.9e-09
3.95e-05
24 54 9.001e+01 4.66e-13 4.66e-13 3.4e-11 1.6e+08 7.9e-11
3.95e-05
25 56 9.001e+01 9.30e-14 9.33e-14 6.8e-12 8.1e+08 1.6e-11
3.95e-05
26 58 9.001e+01 1.87e-13 1.87e-13 1.4e-11 1.0e+08 3.1e-11
3.95e-05
27 60 9.001e+01 3.73e-14 3.73e-14 2.7e-12 2.0e+09 6.3e-12
3.95e-05
28 62 9.001e+01 7.45e-14 7.46e-14 5.5e-12 2.5e+08 1.3e-11
3.95e-05
29 64 9.001e+01 1.48e-14 1.49e-14 1.1e-12 5.1e+09 2.5e-12
3.95e-05
30 66 9.001e+01 3.02e-14 2.98e-14 2.2e-12 6.4e+08 5.0e-12
3.95e-05
31 68 9.001e+01 5.92e-14 5.97e-14 4.4e-12 3.2e+08 1.0e-11
3.95e-05
32 70 9.001e+01 1.23e-14 1.19e-14 8.7e-13 6.4e+09 2.0e-12
3.95e-05
33 72 9.001e+01 2.53e-15 2.39e-15 1.7e-13 3.2e+10 4.0e-13
3.95e-05
34 74 9.001e+01 3.16e-16 4.78e-16 3.5e-14 1.6e+11 8.0e-14
3.95e-05
35 76 9.001e+01 0.00e+00 9.55e-17 7.0e-15 8.0e+11 1.6e-14
3.95e-05
***** FALSE CONVERGENCE *****
FUNCTION 9.000969e+01 RELDX 6.984e-15
FUNC. EVALS 76 GRAD. EVALS 35
PRELDF 9.551e-17 NPRELDF 3.951e-05
I FINAL X(I) D(I) G(I)
1 6.522721e-01 1.000e+00 1.496e-02
2 9.964029e-01 1.000e+00 2.675e-01
3 5.785579e-14 1.000e+00 4.625e-01
Call:
garch(x = inflation)
Coefficient(s):
a0 a1 b1
6.523e-01 9.964e-01 5.786e-14
Hopefully this will help you. In case of any query, do comment. If you are satisfied with the answer, give it a like. Thanks.