-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresults.txt
200 lines (161 loc) · 7.84 KB
/
results.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
results for symbol = MU
forecasts = res.forecast(reindex=False)
print(forecasts.mean.iloc[-3:])
forecasts = res.forecast(horizon=10, reindex=False)
print(forecasts.residual_variance.iloc[-3:])
h.1
tradedate
2021-09-03 0.162063
h.01 h.02 h.03 h.04 h.05 h.06 \
tradedate
2021-09-03 5.878467 5.955663 6.030638 6.103454 6.174174 6.242858
h.07 h.08 h.09 h.10
tradedate
2021-09-03 6.309565 6.374352 6.437274 6.498385
----------------------------------------------------------------------------
results for symbol = MS
forecasts = res.forecast(reindex=False)
print(forecasts.mean.iloc[-3:])
forecasts = res.forecast(horizon=10, reindex=False)
print(forecasts.residual_variance.iloc[-3:])
h.1
tradedate
2021-09-03 0.080423
h.01 h.02 h.03 h.04 h.05 h.06 \
tradedate
2021-09-03 1.594559 1.689667 1.781559 1.870343 1.956125 2.039005
h.07 h.08 h.09 h.10
tradedate
2021-09-03 2.119083 2.196452 2.271205 2.34343
sqrt(252.*v[ic-1])
sqrt(252*(.0804+1.59))
----------------------------------------------------------------------------
results for symbol = CVA
forecasts = res.forecast(reindex=False)
print(forecasts.mean.iloc[-3:])
forecasts = res.forecast(horizon=10, reindex=False)
print(forecasts.residual_variance.iloc[-3:])
h.1
tradedate
2021-09-03 0.039836
h.01 h.02 h.03 h.04 h.05 h.06 \
tradedate
2021-09-03 1.267626 1.418142 1.566125 1.711618 1.854663 1.9953
h.07 h.08 h.09 h.10
tradedate
2021-09-03 2.133571 2.269515 2.403171 2.534578
----------------------------------------------------------------------------
results symbol = CMLT
Iteration: 5, Func. Count: 46, Neg. LLF: 63.029396825836486
Iteration: 10, Func. Count: 89, Neg. LLF: 60.7382946543891
Iteration: 15, Func. Count: 130, Neg. LLF: 60.66396599026828
Optimization terminated successfully. (Exit mode 0)
Current function value: 60.663812020804365
Iterations: 17
Function evaluations: 146
Gradient evaluations: 17
Constant Mean - GJR-GARCH Model Results
====================================================================================
Dep. Variable: pct_close R-squared: 0.000
Mean Model: Constant Mean Adj. R-squared: 0.000
Vol Model: GJR-GARCH Log-Likelihood: -60.6638
Distribution: Standardized Student's t AIC: 133.328
Method: Maximum Likelihood BIC: 146.374
No. Observations: 65
Date: Fri, Sep 10 2021 Df Residuals: 64
Time: 13:37:21 Df Model: 1
Mean Model
==========================================================================
coef std err t P>|t| 95.0% Conf. Int.
--------------------------------------------------------------------------
mu -0.1097 7.005e-02 -1.566 0.117 [ -0.247,2.762e-02]
Volatility Model
===========================================================================
coef std err t P>|t| 95.0% Conf. Int.
---------------------------------------------------------------------------
omega 0.1599 0.100 1.595 0.111 [-3.657e-02, 0.356]
alpha[1] 0.5958 0.477 1.248 0.212 [ -0.340, 1.532]
gamma[1] 0.7332 1.126 0.651 0.515 [ -1.474, 2.940]
beta[1] 0.0376 0.127 0.297 0.767 [ -0.211, 0.286]
Distribution
========================================================================
coef std err t P>|t| 95.0% Conf. Int.
------------------------------------------------------------------------
nu 4.5971 2.042 2.251 2.438e-02 [ 0.594, 8.600]
========================================================================
h.1
tradedate
2021-09-03 -0.109668
h.01 h.02 h.03 h.04 h.05 h.06 \
tradedate
2021-09-03 0.380331 0.540276 0.700221 0.860166 1.020112 1.180057
h.07 h.08 h.09 h.10
tradedate
2021-09-03 1.340002 1.499947 1.659893 1.819838
----------------------------------------------------------------------------
results symbol = ONTX
h.1
tradedate
2021-09-03 -0.563783
h.01 h.02 h.03 h.04 h.05 \
tradedate
2021-09-03 44.634569 84.953041 121.688819 155.160261 185.657436
h.06 h.07 h.08 h.09 h.10
tradedate
2021-09-03 213.444635 238.762668 261.830944 282.849376 302.000113
from /mnt/fedora-home/kwoodle/NetBeansC++Projects/Garch_5_1/main.cpp
double volp1 = 0.0;
if (ndim == 3) {
volp1 = sqrt(252*(omega+(alpha+beta)*v[ic-1]));
} else if (ndim == 4 ) {
volp1 = sqrt(252*(omega+(alpha+beta+gamma/2.0)*v[ic-1]));
}
ofile<<sym<<"|"<<sqrt(252.*v[ic-1])<<"|"<<volp1<<"|"<<LB<<"|"<<LB2<<"|"<<ndim<<"|"<<omega<<"|"<<alpha<<"|"
<<beta<<"|"<<gamma<<"|"<<start<<"|"<<end<<endl;
cout<<"ic = "<<ic<<" lk = "<<lk<<endl;
cout<<"mean root(v) = "<<vsum/v.size()<<" = "<<vsum/v.size()*sqrt(252.)<<" annualized\n"<<endl;
klog<<"ic = "<<ic<<" lk = "<<lk<<endl;
klog<<"mean root(v) = "<<vsum/v.size()<<" = "<<vsum/v.size()*sqrt(252.)<<" annualized\n"<<endl;
} // end for each sym
MariaDB [ktrade]> select * from usvolatility2 where symbol='COV' and start='2009-09-29' and end='2011-09-29' and ndim=4;
+--------+----------+----------+---------+---------+------+--------------+-----------+----------+-----------+------------+------------+
| Symbol | vol | volp1 | LB | LB2 | ndim | omega | alpha | beta | gamma | start | end |
+--------+----------+----------+---------+---------+------+--------------+-----------+----------+-----------+------------+------------+
| COV | 0.249676 | 0.245732 | 140.101 | 14.7069 | 4 | 0.0000383019 | 0.0468289 | 0.720825 | 0.0923462 | 2009-09-29 | 2011-09-29 |
+--------+----------+----------+---------+---------+------+--------------+-----------+----------+-----------+------------+------------+
1 row in set (0.000 sec)
__________________________________________________________________________________
select tradedate, pct_close from USEQ_HIST where symbol='MS' and
tradedate between '2017-09-10' and '2021-09-03'
results for MS GJR Garch Normal dist
mu 0.095045
omega 0.173447
alpha[1] 0.036694
gamma[1] 0.156896
beta[1] 0.841593
h.1
tradedate
2021-09-03 0.095045
h.01 h.02 h.03 h.04 h.05 h.06 \
tradedate
2021-09-03 1.65095 1.752968 1.850571 1.943952 2.033293 2.118768
h.07 h.08 h.09 h.10
tradedate
2021-09-03 2.200545 2.278784 2.353638 2.425253
√(252×(.095+1.65)) = 20.976 %
√(252×(.095045+1.752968)) = 21.580 %
__________________________________________________________________________________
mu 0.086393
omega 0.218567
alpha[1] 0.048914
gamma[1] 0.135266
beta[1] 0.824478
h.1
tradedate
2021-09-03 0.086393
h.01 h.02 h.03 h.04 h.05 h.06 \
tradedate
2021-09-03 1.728989 1.84559 1.955314 2.058567 2.155731 2.247165
h.07 h.08 h.09 h.10
tradedate
2021-09-03 2.333206 2.414173 2.490366 2.562065