Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lastsave

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 40

R version 3.2.

4 Revised (2016-03-16 r70336) -- "Very Secure Dishes"


Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.


You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.


Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or


'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]

> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)


+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> utils:::menuInstallPkgs()
--- Please select a CRAN mirror for use in this session ---
Error in install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) :
no packages were specified
> setwd("D:/")
> data=read.table("data.txt")
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 2 did not have 2 elements
> data=read.csv(file.choose(),header=TRUE)
> View(data)
> ead.csv(file.choose(),header=TRUE)
Error: could not find function "ead.csv"
> ead.csv(file.choose(),header=TRUE
+ q()
Error: unexpected symbol in:
"ead.csv(file.choose(),header=TRUE
q"
> View(data)
> setwd("d:")
> data=read.table("data.txt")
> data
V1
1 18856.00
2 19323.00
3 22155.00
4 22433.00
5 21218.00
6 23205.00
7 22619.00
8 22445.00
9 22982.00
10 22552.00
11 22988.00
12 23819.00
13 23017.00
14 26258.00
15 23570.00
16 23406.00
17 23503.00
18 24609.00
19 23708.00
20 24648.00
21 25805.00
22 25162.00
23 25831.00
24 26342.00
25 26231.00
26 26252.00
27 27318.00
28 26107.00
29 26145.00
30 26844.00
31 27001.00
32 27417.00
33 27626.00
34 27880.00
35 28508.00
36 28779.00
37 28739.00
38 29051.00
39 30592.00
40 29704.00
41 30161.00
42 31563.00
43 31714.00
44 34055.00
45 35041.00
46 35615.00
47 36145.00
48 37036.00
49 37406.00
50 40048.00
51 38452.00
52 38574.00
53 38933.00
54 40106.00
55 40265.00
56 41595.00
57 42408.00
58 43985.00
59 44266.00
60 45374.00
61 44582.00
62 47332.00
63 44908.00
64 44647.00
65 45027.00
66 47045.00
67 47385.00
68 48381.00
69 48981.00
70 50384.00
71 50386.00
72 53339.00
73 52183.00
74 53960.00
75 53162.00
76 53586.00
77 53751.00
78 56448.00
79 57716.00
80 57598.00
81 59684.00
82 59595.00
83 60183.00
84 64089.00
85 65876.00
86 64985.00
87 63565.00
88 64583.00
89 65240.00
90 69950.00
91 69268.00
92 65235.00
93 66258.00
94 67351.00
95 69856.00
96 78343.00
97 92800.00
98 92509.00
99 98270.00
100 95368.00
101 103941.00
102 109480.00
103 105822.00
104 104583.00
105 102563.00
106 99603.00
107 100971.00
108 101197.00
109 101953.00
110 103458.00
111 105705.00
112 100708.00
113 103301.00
114 105964.00
115 106075.00
116 109564.00
117 118124.00
118 116315.00
119 117292.00
120 124633.00
121 122417.00
122 122160.00
123 124663.00
124 127367.00
125 130225.00
126 133832.00
127 135739.00
128 136530.00
129 135430.00
130 138886.00
131 141204.00
132 162186.00
133 145345.00
134 149879,00
135 148375,00
136 154297,00
137 155791,00
138 160142,00
139 162154,00
140 166851,00
141 164237,00
142 169963,00
143 171383,00
144 177731,00
145 166769.00
146 168643,00
147 166173,00
148 169002,00
149 168257,00
150 174017,00
151 173524,00
152 175966,00
153 181791,00
154 181667,00
155 196537,00
156 191939,00
157 180112.00
158 181530,00
159 181239,00
160 182963,00
161 191707,00
162 194878.00
163 196589,00
164 201859,00
165 207587,00
166 212614,00
167 224318.00
168 223799,00
169 209113.00
170 208161.00
171 209153.00
172 208169.00
173 215861.00
174 226147.00
175 231007.00
176 232642.00
177 234676.00
178 240495.00
179 243536.00
180 245946.00
181 242373.00
182 244668.00
183 244003.00
184 240477.00
185 246669.00
186 261814.00
187 261120.00
188 268856.00
189 267762.00
190 280270.00
191 268694.00
192 271140.00
193 274069.00
194 270338.00
195 270425.00
196 273594.00
197 296101.00
198 303803.00
199 303156.00
200 319018.00
201 323885.00
202 336273.00
203 332316.00
204 347013.00
205 335700.00
206 336393.00
207 331736.00
208 342141.00
209 343309.00
210 371768.00
211 386234.00
212 391960.00
213 400075.00
214 404018.00
215 413429.00
216 450055.00
217 410752.00
218 401410.00
219 409768.00
220 414390.00
221 426283.00
222 453047.00
223 445921.00
224 440336.00
225 479738.00
226 459116.00
227 463590.00
228 456787.00
229 437844.98
230 434761.14
231 448033.62
232 452937.48
233 456954.83
234 482621.35
235 468943.79
236 490128,00
237 490502,00
238 485538,00
239 495061,00
240 515824,00
241 496526.84
242 490083.79
243 494460.84
244 494717.69
245 514005.04
246 545405.37
247 539745.86
248 555494.78
249 549941.24
250 555548.88
251 571337.17
252 605410.53
253 604169.16
254 585890.08
255 580601.21
256 584633.81
257 611790.51
258 636206.14
259 639687.98
260 662806.24
261 656095.74
262 664999.95
263 667587.23
264 722991.17
265 696281.03
266 683208.48
267 714215.03
268 720875.99
269 749403.19
270 779366.60
271 771738.77
272 772377.53
273 795459.72
274 774922.64
275 801344.63
276 841652.12
277 787859.68
278 786548.67
279 810054.88
280 832213.49
281 822876.47
282 858498.99
283 879986.02
284 855782.79
285 867714.92
286 856171.21
287 870412.35
288 887083.50
289 842677.91
290 834532.41
291 853502.40
292 880470.30
293 906726.69
294 945717.83
295 918565.80
296 895827.12
297 949168.33
298 940348.73
299 955534.99
300 942221.34
301 918079.49
302 927847.53
303 957580.46
304 959376.46
305 980915.30
306 1039517.98
307 1031905.82
308 1026322.91
309 1063038.71
310 1036310.68
311 1051190.74
312 1055439.82
313 1046257.23
314 1035550.68
315 1064737.89
316 1089212.20
317 1118768.26
318 1184328.91
319 1144500.83
320 1135548.18
321 1126046.04
322 1142785.81
323 1182729.89
> plot(data[[1]],type="l")
Warning messages:
1: In plot.window(xlim, ylim, log = log, ...) :
graphical parameter "type" is obsolete
2: In axis(if (horiz) 2 else 1, at = at.l, labels = names.arg, lty = axis.lty, :
graphical parameter "type" is obsolete
3: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
graphical parameter "type" is obsolete
4: In axis(if (horiz) 1 else 2, cex.axis = cex.axis, ...) :
graphical parameter "type" is obsolete
> data=ts(data,start=c(1990,1),frequency=12)
> ts.plot(data,main="Plot Data Bulanan M1")
> adf.test(data,alternative=c("stationary","explosive"),k=trunc((length(data)-
1)^(1/3)))
Error: could not find function "adf.test"
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> utils:::menuInstallPkgs()
also installing the dependencies �quadprog�, �zoo�

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/quadprog_1.5-5.zip'


Content type 'application/zip' length 51805 bytes (50 KB)
downloaded 50 KB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/zoo_1.7-14.zip'


Content type 'application/zip' length 905305 bytes (884 KB)
downloaded 884 KB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/tseries_0.10-36.zip'


Content type 'application/zip' length 320361 bytes (312 KB)
downloaded 312 KB

package �quadprog� successfully unpacked and MD5 sums checked


package �zoo� successfully unpacked and MD5 sums checked
package �tseries� successfully unpacked and MD5 sums checked

The downloaded binary packages are in


C:\Users\aLf\AppData\Local\Temp\Rtmp4MCLQ7\downloaded_packages
> adf.test(data,alternative=c("stationary","explosive"),k=trunc((length(data)-
1)^(1/3)))
Error: could not find function "adf.test"
> utils:::menuInstallPkgs()
trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/tseries_0.10-36.zip'
Content type 'application/zip' length 320361 bytes (312 KB)
downloaded 312 KB

package �tseries� successfully unpacked and MD5 sums checked

The downloaded binary packages are in


C:\Users\aLf\AppData\Local\Temp\Rtmp4MCLQ7\downloaded_packages
> adf.test(data,alternative=c("stationary","explosive"),k=trunc((length(data)-
1)^(1/3)))
Error: could not find function "adf.test"
> utils:::menuInstallPkgs()
Error in install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) :
no packages were specified
> help.search("adf.test")
starting httpd help server ... done
> update.packages(ask='graphics',checkBuilt=TRUE)
trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/cluster_2.0.5.zip'
Content type 'application/zip' length 536120 bytes (523 KB)
downloaded 523 KB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/codetools_0.2-15.zip'


Content type 'application/zip' length 46174 bytes (45 KB)
downloaded 45 KB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/foreign_0.8-67.zip'


Content type 'application/zip' length 288578 bytes (281 KB)
downloaded 281 KB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/lattice_0.20-34.zip'


Content type 'application/zip' length 729747 bytes (712 KB)
downloaded 712 KB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/Matrix_1.2-7.1.zip'


Content type 'application/zip' length 2750364 bytes (2.6 MB)
downloaded 2.6 MB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/mgcv_1.8-16.zip'


Content type 'application/zip' length 2304632 bytes (2.2 MB)
downloaded 2.2 MB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/nlme_3.1-128.zip'


Content type 'application/zip' length 2157609 bytes (2.1 MB)
downloaded 2.1 MB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/survival_2.40-1.zip'


Content type 'application/zip' length 5104015 bytes (4.9 MB)
downloaded 4.9 MB

package �cluster� successfully unpacked and MD5 sums checked


package �codetools� successfully unpacked and MD5 sums checked
package �foreign� successfully unpacked and MD5 sums checked
package �lattice� successfully unpacked and MD5 sums checked
package �Matrix� successfully unpacked and MD5 sums checked
package �mgcv� successfully unpacked and MD5 sums checked
package �nlme� successfully unpacked and MD5 sums checked
package �survival� successfully unpacked and MD5 sums checked

The downloaded binary packages are in


C:\Users\aLf\AppData\Local\Temp\Rtmp4MCLQ7\downloaded_packages
> adf.test(data,alternative=c("stationary","explosive"),k=trunc((length(data)-
1)^(1/3)))
Error: could not find function "adf.test"
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})

�tseries� version: 0.10-36

�tseries� is a package for time series analysis and computational


finance.

See �library(help="tseries")� for details.

Warning message:
package �tseries� was built under R version 3.2.5
> adf.test(data,alternative=c("stationary","explosive"),k=trunc((length(data)-
1)^(1/3)))

Augmented Dickey-Fuller Test

data: data
Dickey-Fuller = -1.6496, Lag order = 6, p-value = 0.7243
alternative hypothesis: stationary

> pp.test(data[[1]],alternative=c("stationary","explosive"),lshort=TRUE)
Error in embed(x, 2) : wrong embedding dimension
> pp.test(yen[[1]],alternative=c("stationary","explosive"),lshort=TRUE)
Error in NCOL(x) : object 'yen' not found
> pp.test(data[[1]],alternative=c("stationary","explosive"),lshort=TRUE)
Error in embed(x, 2) : wrong embedding dimension
> pp.test(yen[[1]],alternative=c("stationary","explosive"),lshort=TRUE)
Error in NCOL(x) : object 'yen' not found
> rtdata=diff(log(data),lag=1)
> rtdata
Jan Feb Mar Apr May
1990 0.038714512 0.152340725 0.032088315 -0.065240522
1991 -0.084557388 0.250224510 -0.183849441 -0.027908788 0.018692133
1992 -0.022989518 0.007722046 0.081225440 -0.120446153 0.015873349
1993 -0.006688988 0.013333531 0.038965969 -0.025807884 0.006514681
1994 0.011428696 0.039002158 -0.033336420 0.005633818 0.011173301
1995 -0.044016885 0.076961041 -0.057158414 -0.009852296 0.019608471
1996 -0.008510690 0.021142437 -0.016878038 0.008474627 0.004210533
1997 0.022728251 -0.015094626 -0.019194447 0.015384919 0.011385322
1998 0.087011377 -0.006430890 0.037979248 -0.015649772 -3.273995124
1999 0.287682072 0.810930216 0.693147181 -2.890371758 2.079441542
2000 -0.025975486 -0.026668247 0.077961541 0.024692613 0.024097552
2001 -0.133531393 0.040005335 -0.019802627 0.039220713 0.019048195
2002 -0.156569061 0.049596941 -0.066691374 0.082691716 -0.032260862
2003 -0.108213585 0.028170877 -0.013986242 0.054808236 0.026317308
2004 -0.066691374 -0.023256862 0.034685558 -0.022989518 0.056512210
2005 -0.034486176 0.025975486 -0.008583744 -0.035091320 0.077291674
2006 0.021202208 -0.035590945 0.007220248 0.021353124 0.068053463
2007 -0.035932009 0.012121361 -0.024391453 0.036367644 0.005934736
2008 -0.081262964 -0.021391190 0.016086138 0.015831465 0.015584731
2009 -0.068992871 -0.005115101 0.040206420 0.019512814 0.019139340
2010 -0.017316450 -0.026550232 0.013363228 0.004415018 0.021787354
2011 -0.003913899 -0.015810606 -0.008000043 0.004008021 0.027615167
2012 -0.018018506 -0.007299302 0.018149319 0.003590668 0.007142888
2013 -0.024014876 -0.003478264 0.013841051 0.006849342 -0.003418807
2014 -0.029952322 -0.006779687 0.010152371 0.023295563 0.009820046
2015 -0.019293203 0.009693129 0.025398191 0.003129893 0.003120127
2016 -0.125163143 -0.405465108 0.832909123 0.042559614 0.117783036
Jun Jul Aug Sep Oct
1990 0.155754529 -0.049271049 -0.030771659 0.040821995 -0.030459207
1991 0.096992266 -0.078643127 0.087011377 0.024692613 -0.008163311
1992 0.053652713 0.022141126 0.049832374 0.006920443 0.006872879
1993 0.025642431 0.006309169 0.049089610 0.023669744 0.005830920
1994 0.021978907 0.010810916 0.031748698 0.005194817 0.020513540
1995 0.042761859 0.009259325 0.013730193 0.009049836 0.035401927
1996 0.028987537 0.012170536 -0.004040410 0.024001152 -0.003960401
1997 0.044287680 -0.010889400 -0.037179003 0.015037877 0.014815086
1998 0.733969175 -0.274436846 -0.305381650 -1.029619417 4.168214411
1999 0.916290732 0.048790164 0.213574100 0.268263987 -0.060624622
2000 0.023530497 0.045462374 0.021978907 -0.044451763 0.065957968
2001 0.018692133 0.018349139 0.087011377 -0.051293294 0.115831816
2002 0.093818755 -0.015037877 0.029852963 0.084557388 -0.013605652
2003 0.038221213 0.024692613 0.012121361 0.011976191 0.068992871
2004 0.074107972 0.049761510 0.019231362 0.018868484 0.054558984
2005 0.056239718 -0.015748357 0.076372979 -0.022305758 0.100083459
2006 0.025975486 -0.006430890 0.031748698 0.006230550 0.024541109
2007 0.034887259 0.022599832 0.011111225 0.005509656 0.027101930
2008 0.069679921 -0.034233172 -0.015037877 0.096228032 -0.027908788
2009 0.037213596 -0.023095715 0.045670037 0.004454350 -0.017937701
2010 0.038059562 -0.004158010 0.012422520 -0.004123717 0.008230499
2011 0.007751977 0.003853569 0.034029749 -0.011215071 0.014925650
2012 0.014134511 -0.010582109 0.003539827 0.020979790 -0.017452450
2013 0.027028672 0.009950331 -0.016639319 0.010016778 -0.006666691
2014 0.025724891 -0.019231362 -0.009756175 0.032157112 -0.009539023
2015 -3.206491766 -0.619039208 -0.154150680 1.299282984 -0.693147181
2016 0.287682072 -0.149531734 -0.066691374 -0.035091320 0.068992871
Nov Dec
1990 0.040409538 0.094409684
1991 0.016260521 0.062520357
1992 0.013605652 0.013423020
1993 0.005797118 0.005763705
1994 0.010101096 0.049029427
1995 0.004338402 0.021414095
1996 0.007905180 0.027186140
1997 0.014598799 0.035590945
1998 -5.084505143 0.405465108
1999 0.030771659 0.167054085
2000 0.021053409 0.154150680
2001 0.015504187 0.059719235
2002 0.103989714 -0.037740328
2003 0.043485112 -0.010695289
2004 0.017544310 0.025752496
2005 -0.085157808 0.036367644
2006 -0.012195273 0.042048236
2007 0.015915455 0.075985907
2008 0.004705891 -0.014184635
2009 0.031182927 0.021692825
2010 0.008163311 0.039845909
2011 0.003696862 0.032670782
2012 0.020906685 0.017094433
2013 0.009983444 0.009884759
2014 0.015848192 -0.012658397
2015 0.374693449 0.060624622
2016 0.154150680
> adf.test(rtdata,alternative=c("stationary","explosive"),k=trunc((length(rtdata)-
1)^(1/3)))

Augmented Dickey-Fuller Test

data: rtdata
Dickey-Fuller = -6.8942, Lag order = 6, p-value = 0.01
alternative hypothesis: stationary

Warning message:
In adf.test(rtdata, alternative = c("stationary", "explosive"), :
p-value smaller than printed p-value
> plot(acf(rtdata,maxlag=10),alpha=0.05)
There were 12 warnings (use warnings() to see them)
> plot(pacf(rtihsg,maxlag=10),alpha=0.05
+

+ > plot(pacf(rtdata,maxlag=10),alpha=0.05)
There were 12 warnings (use warnings() to see them)
> summary(arma(rtdata,order=c(1,0)))

Call:
arma(x = rtdata, order = c(1, 0))

Model:
ARMA(1,0)

Residuals:
Min 1Q Median 3Q Max
-3.39726 -0.00119 0.02070 0.04381 3.75603

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.403905 0.050988 -7.922 2.44e-15 ***
intercept -0.003683 0.026296 -0.140 0.889
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2233, Conditional Sum-of-Squares = 71.47, AIC = 435.11

> summary(arma10<-
arma(rtdata,order=c(1,0),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(1, 0), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(1,0)

Residuals:
Min 1Q Median 3Q Max
-3.400950 -0.004873 0.017020 0.040130 3.752348

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.40390 0.05099 -7.921 2.44e-15 ***
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2233, Conditional Sum-of-Squares = 71.48, AIC = 433.11

Warning message:
In optim(coef, err, gr = NULL, hessian = TRUE, ...) :
one-dimensional optimization by Nelder-Mead is unreliable:
use "Brent" or optimize() directly
> summary(arma(rtihsg,order=c(2,0)))
Error in NCOL(x) : object 'rtihsg' not found
> summary(arma(rtdata,order=c(2,0)))

Call:
arma(x = rtdata, order = c(2, 0))

Model:
ARMA(2,0)

Residuals:
Min 1Q Median 3Q Max
-3.2908082 0.0007378 0.0231899 0.0497061 3.6414934

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.468761 0.055009 -8.522 < 2e-16 ***
ar2 -0.160336 0.055010 -2.915 0.00356 **
intercept -0.004888 0.025992 -0.188 0.85084
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2182, Conditional Sum-of-Squares = 69.61, AIC = 429.6

> summary(arma10<-
arma(rtdata,order=c(2,0),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(2, 0), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(2,0)

Residuals:
Min 1Q Median 3Q Max
-3.295840 -0.004149 0.018303 0.044817 3.636652

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.46872 0.05501 -8.521 < 2e-16 ***
ar2 -0.16032 0.05501 -2.914 0.00357 **
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2182, Conditional Sum-of-Squares = 69.61, AIC = 427.6

> summary(arma(rtdata,order=c(3,0)))
Call:
arma(x = rtdata, order = c(3, 0))

Model:
ARMA(3,0)

Residuals:
Min 1Q Median 3Q Max
-3.303011 0.004436 0.027001 0.051273 3.572749

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.488151 0.055339 -8.821 < 2e-16 ***
ar2 -0.216340 0.060465 -3.578 0.000346 ***
ar3 -0.119144 0.055329 -2.153 0.031289 *
intercept -0.005908 0.025847 -0.229 0.819206
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2157, Conditional Sum-of-Squares = 68.6, AIC = 427.95

> summary(arma10<-
arma(rtdata,order=c(3,0),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(3, 0), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(3,0)

Residuals:
Min 1Q Median 3Q Max
-3.309306 -0.001477 0.021115 0.045344 3.567150

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.48798 0.05534 -8.818 < 2e-16 ***
ar2 -0.21609 0.06046 -3.574 0.000352 ***
ar3 -0.11894 0.05533 -2.150 0.031584 *
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2157, Conditional Sum-of-Squares = 68.62, AIC = 425.95

> summary(arma(rtdata,order=c(0,1)))

Call:
arma(x = rtdata, order = c(0, 1))

Model:
ARMA(0,1)

Residuals:
Min 1Q Median 3Q Max
-3.43696 0.00416 0.02705 0.05233 3.57401
Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ma1 -0.460148 0.045995 -10.004 <2e-16 ***
intercept -0.002972 0.014010 -0.212 0.832
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2165, Conditional Sum-of-Squares = 69.3, AIC = 425.16

> summary(arma10<-
arma(rtdata,order=c(0,1),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(0, 1), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(0,1)

Residuals:
Min 1Q Median 3Q Max
-3.442860 -0.001344 0.021540 0.046823 3.568792

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ma1 -0.46000 0.04598 -10 <2e-16 ***
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2166, Conditional Sum-of-Squares = 69.31, AIC = 423.16

Warning message:
In optim(coef, err, gr = NULL, hessian = TRUE, ...) :
one-dimensional optimization by Nelder-Mead is unreliable:
use "Brent" or optimize() directly
> summary(arma(rtdata,order=c(0,2)))

Call:
arma(x = rtdata, order = c(0, 2))

Model:
ARMA(0,2)

Residuals:
Min 1Q Median 3Q Max
-3.277472 0.003516 0.026819 0.051419 3.584619

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ma1 -0.486829 0.057186 -8.513 <2e-16 ***
ma2 0.046709 0.054498 0.857 0.391
intercept -0.003288 0.014526 -0.226 0.821
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2166, Conditional Sum-of-Squares = 69.1, AIC = 427.26

> summary(arma10<-
arma(rtdata,order=c(0,2),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(0, 2), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(0,2)

Residuals:
Min 1Q Median 3Q Max
-3.283603 -0.002373 0.020933 0.045538 3.579373

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ma1 -0.48661 0.05720 -8.508 <2e-16 ***
ma2 0.04691 0.05449 0.861 0.389
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2166, Conditional Sum-of-Squares = 69.11, AIC = 425.26

> summary(arma(rtdata,order=c(1,1)))

Call:
arma(x = rtdata, order = c(1, 1))

Model:
ARMA(1,1)

Residuals:
Min 1Q Median 3Q Max
-3.301266 0.003446 0.026250 0.050844 3.580620

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.087366 0.108630 -0.804 0.421
ma1 -0.395436 0.097318 -4.063 4.84e-05 ***
intercept -0.003172 0.015668 -0.202 0.840
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2161, Conditional Sum-of-Squares = 69.16, AIC = 426.52

> summary(arma10<-
arma(rtdata,order=c(1,1),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(1, 1), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(1,1)
Residuals:
Min 1Q Median 3Q Max
-3.306320 -0.001814 0.020990 0.045593 3.575712

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.08785 0.10862 -0.809 0.419
ma1 -0.39489 0.09734 -4.057 4.98e-05 ***
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2161, Conditional Sum-of-Squares = 69.17, AIC = 424.53

> summary(arma(rtdata,order=c(1,2)))

Call:
arma(x = rtdata, order = c(1, 2))

Model:
ARMA(1,2)

Residuals:
Min 1Q Median 3Q Max
-3.308272 0.003899 0.026632 0.051991 3.560891

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.619811 0.456695 -1.357 0.175
ma1 0.140352 0.464153 0.302 0.762
ma2 -0.248765 0.222859 -1.116 0.264
intercept -0.004982 0.023142 -0.215 0.830

Fit:
sigma^2 estimated as 0.2167, Conditional Sum-of-Squares = 69.12, AIC = 429.33

> summary(arma10<-
arma(rtdata,order=c(1,2),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(1, 2), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(1,2)

Residuals:
Min 1Q Median 3Q Max
-3.314389 -0.001696 0.021038 0.046393 3.555625

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.6214 0.4528 -1.372 0.170
ma1 0.1422 0.4604 0.309 0.757
ma2 -0.2493 0.2212 -1.127 0.260

Fit:
sigma^2 estimated as 0.2167, Conditional Sum-of-Squares = 69.13, AIC = 427.33
> summary(arma(rtdata,order=c(1,3)))

Call:
arma(x = rtdata, order = c(1, 3))

Model:
ARMA(1,3)

Residuals:
Min 1Q Median 3Q Max
-3.277142 0.004191 0.027545 0.051876 3.566380

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.701841 0.470492 -1.492 0.136
ma1 0.217088 0.471039 0.461 0.645
ma2 -0.287886 0.236819 -1.216 0.224
ma3 0.016642 0.068832 0.242 0.809
intercept -0.005744 0.024605 -0.233 0.815

Fit:
sigma^2 estimated as 0.2172, Conditional Sum-of-Squares = 69.07, AIC = 432.13

> summary(arma10<-
arma(rtdata,order=c(1,3),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(1, 3), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(1,3)

Residuals:
Min 1Q Median 3Q Max
-3.284146 -0.001885 0.021443 0.045789 3.561243

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.70342 0.47108 -1.493 0.135
ma1 0.21905 0.47150 0.465 0.642
ma2 -0.28841 0.23706 -1.217 0.224
ma3 0.01695 0.06904 0.246 0.806

Fit:
sigma^2 estimated as 0.2172, Conditional Sum-of-Squares = 69.08, AIC = 430.13

> summary(arma(rtdata,order=c(2,1)))

Call:
arma(x = rtdata, order = c(2, 1))

Model:
ARMA(2,1)

Residuals:
Min 1Q Median 3Q Max
-3.297819 0.003695 0.026910 0.051320 3.587174
Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.15202 0.19906 -0.764 0.4450
ar2 -0.04138 0.10353 -0.400 0.6894
ma1 -0.33225 0.19266 -1.725 0.0846 .
intercept -0.00380 0.01733 -0.219 0.8265
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2166, Conditional Sum-of-Squares = 69.09, AIC = 429.21

> summary(arma10<-
arma(rtdata,order=c(2,1),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(2, 1), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(2,1)

Residuals:
Min 1Q Median 3Q Max
-3.303884 -0.002009 0.021202 0.045624 3.581933

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.15250 0.19909 -0.766 0.4437
ar2 -0.04148 0.10350 -0.401 0.6886
ma1 -0.33157 0.19270 -1.721 0.0853 .
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2166, Conditional Sum-of-Squares = 69.1, AIC = 427.21

> summary(arma(rtdata,order=c(2,2)))

Call:
arma(x = rtdata, order = c(2, 2))

Model:
ARMA(2,2)

Residuals:
Min 1Q Median 3Q Max
-3.296740 0.003808 0.026695 0.051757 3.564450

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.652577 0.531856 -1.227 0.220
ar2 -0.015122 0.113709 -0.133 0.894
ma1 0.170924 0.529960 0.323 0.747
ma2 -0.249171 0.224488 -1.110 0.267
intercept -0.005106 0.023934 -0.213 0.831

Fit:
sigma^2 estimated as 0.2167, Conditional Sum-of-Squares = 69.11, AIC = 431.31
> summary(arma10<-
arma(rtdata,order=c(2,2),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(2, 2), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(2,2)

Residuals:
Min 1Q Median 3Q Max
-3.302271 -0.001735 0.021154 0.046204 3.559284

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.65546 0.52924 -1.238 0.216
ar2 -0.01566 0.11399 -0.137 0.891
ma1 0.17394 0.52730 0.330 0.741
ma2 -0.24978 0.22261 -1.122 0.262

Fit:
sigma^2 estimated as 0.2167, Conditional Sum-of-Squares = 69.12, AIC = 429.31

> summary(arma(rtdata,order=c(3,1)))

Call:
arma(x = rtdata, order = c(3, 1))

Model:
ARMA(3,1)

Residuals:
Min 1Q Median 3Q Max
-3.295188 0.003894 0.026524 0.050595 3.544757

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.700930 0.285381 -2.456 0.0140 *
ar2 -0.317372 0.143722 -2.208 0.0272 *
ar3 -0.156385 0.066403 -2.355 0.0185 *
ma1 0.215729 0.285821 0.755 0.4504
intercept -0.006929 0.031406 -0.221 0.8254
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2154, Conditional Sum-of-Squares = 68.5, AIC = 429.45

> summary(arma10<-
arma(rtdata,order=c(3,1),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(3, 1), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(3,1)
Residuals:
Min 1Q Median 3Q Max
-3.300708 -0.001806 0.020827 0.044897 3.539078

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.7009 0.2853 -2.457 0.0140 *
ar2 -0.3173 0.1437 -2.207 0.0273 *
ar3 -0.1564 0.0664 -2.355 0.0185 *
ma1 0.2157 0.2857 0.755 0.4503
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2154, Conditional Sum-of-Squares = 68.51, AIC = 427.45

> summary(arma(rtdata,order=c(3,2)))

Call:
arma(x = rtdata, order = c(3, 2))

Model:
ARMA(3,2)

Residuals:
Min 1Q Median 3Q Max
-3.52018 -0.00219 0.02022 0.04670 3.56512

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.749235 0.168037 -4.459 8.24e-06 ***
ar2 -0.927079 0.161111 -5.754 8.70e-09 ***
ar3 -0.387428 0.075776 -5.113 3.17e-07 ***
ma1 0.289344 0.176264 1.642 0.101
ma2 0.652193 0.156275 4.173 3.00e-05 ***
intercept -0.008006 0.049588 -0.161 0.872
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.213, Conditional Sum-of-Squares = 67.74, AIC = 427.86

> summary(arma10<-
arma(rtdata,order=c(3,2),lag=NULL,coef=NULL,include.intercept=FALSE))

Call:
arma(x = rtdata, order = c(3, 2), lag = NULL, coef = NULL, include.intercept =
FALSE)

Model:
ARMA(3,2)

Residuals:
Min 1Q Median 3Q Max
-3.535762 -0.005879 0.016123 0.043762 3.563130

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
ar1 -0.79576 0.15351 -5.184 2.18e-07 ***
ar2 -0.95219 0.15179 -6.273 3.54e-10 ***
ar3 -0.39857 0.07054 -5.650 1.60e-08 ***
ma1 0.34063 0.16294 2.090 0.0366 *
ma2 0.66507 0.15162 4.387 1.15e-05 ***
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Fit:
sigma^2 estimated as 0.2129, Conditional Sum-of-Squares = 67.72, AIC = 425.75

> res1=resid(arma(rt,order=c(0,1)))
Error in ts(x) : object is not a matrix
> res1=resid(arma(rt,order=c(3,0)))res1=resid(arma(rt,order=c(3,0)))
Error: unexpected symbol in "res1=resid(arma(rt,order=c(3,0)))res1"
> res1=resid(arma(rtdata,order=c(0,1)))
> ks.test(res1,ecdf(res1))

One-sample Kolmogorov-Smirnov test

data: res1
D = 0.0031153, p-value = 1
alternative hypothesis: two-sided

> Box.test(res1,lag=1,type=c("Box-Pierce","Ljung-Box"),fitdf=0)

Box-Pierce test

data: res1
X-squared = 0.16358, df = 1, p-value = 0.6859

> ArchTest(res1,lags=12,demean=FALSE)
Error: could not find function "ArchTest"
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
Warning message:
package �nlme� was built under R version 3.2.5
> utils:::menuInstallPkgs()
also installing the dependencies �gss�, �stabledist�, �timeDate�, �timeSeries�,
�fBasics�

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/gss_2.1-6.zip'


Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://cran.csiro.au/bin/windows/contrib/3.2/gss_2.1-6.zip'
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package �gss� failed
trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/stabledist_0.7-1.zip'
Content type 'application/zip' length 41903 bytes (40 KB)
downloaded 40 KB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/timeDate_3012.100.zip'


Content type 'application/zip' length 791781 bytes (773 KB)
downloaded 773 KB
trying URL
'https://cran.csiro.au/bin/windows/contrib/3.2/timeSeries_3022.101.2.zip'
Content type 'application/zip' length 1588108 bytes (1.5 MB)
downloaded 1.5 MB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/fBasics_3011.87.zip'


Content type 'application/zip' length 1553914 bytes (1.5 MB)
downloaded 1.5 MB

trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/fGarch_3010.82.1.zip'


Content type 'application/zip' length 442901 bytes (432 KB)
downloaded 432 KB

package �stabledist� successfully unpacked and MD5 sums checked


package �timeDate� successfully unpacked and MD5 sums checked
package �timeSeries� successfully unpacked and MD5 sums checked
package �fBasics� successfully unpacked and MD5 sums checked
package �fGarch� successfully unpacked and MD5 sums checked

The downloaded binary packages are in


C:\Users\aLf\AppData\Local\Temp\Rtmp4MCLQ7\downloaded_packages
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics

Rmetrics Package fBasics


Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Warning messages:
1: package �fGarch� was built under R version 3.2.5
2: package �timeDate� was built under R version 3.2.5
3: package �timeSeries� was built under R version 3.2.5
4: package �fBasics� was built under R version 3.2.5
> utils:::menuInstallPkgs()
trying URL 'https://cran.csiro.au/bin/windows/contrib/3.2/FinTS_0.4-5.zip'
Content type 'application/zip' length 3699651 bytes (3.5 MB)
downloaded 3.5 MB

package �FinTS� successfully unpacked and MD5 sums checked

The downloaded binary packages are in


C:\Users\aLf\AppData\Local\Temp\Rtmp4MCLQ7\downloaded_packages
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
Loading required package: zoo

Attaching package: �zoo�

The following object is masked from �package:timeSeries�:

time<-

The following objects are masked from �package:base�:


as.Date, as.Date.numeric

Warning messages:
1: package �FinTS� was built under R version 3.2.5
2: package �zoo� was built under R version 3.2.5
> ArchTest(res1,lags=12,demean=FALSE)

ARCH LM-test; Null hypothesis: no ARCH effects

data: res1
Chi-squared = 109.81, df = 12, p-value < 2.2e-16

>
arch1=garchFit(~garch(1,0),data=rt,include.mean=F,trace=F,algoritm="lbfgsb+nm",cond
.dist="QMLE")
Error in as.data.frame.default(data) :
cannot coerce class ""function"" to a data.frame
> summary(arch1)
Error in summary(arch1) : object 'arch1' not found
>
arch1=garchFit(~garch(1,0),data=rt,include.mean=F,trace=F,algoritm="lbfgsb+nm",cond
.dist="QMLE")
Error in as.data.frame.default(data) :
cannot coerce class ""function"" to a data.frame
>
arch1=garchFit(~garch(1,0),data=rtdata,include.mean=F,trace=F,algoritm="lbfgsb+nm",
cond.dist="QMLE")
> summary(arch1)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(1, 0), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algoritm = "lbfgsb+nm")

Mean and Variance Equation:


data ~ garch(1, 0)
<environment: 0x037ccac4>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1
0.080009 1.000000

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 0.08001 0.05254 1.523 0.1278
alpha1 1.00000 0.41070 2.435 0.0149 *
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1
Log Likelihood:
-91.85773 normalized: -0.2852725

Description:
Mon Jan 16 14:30:03 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 126645.5 0
Shapiro-Wilk Test R W 0.265766 0
Ljung-Box Test R Q(10) 23.63982 0.008616011
Ljung-Box Test R Q(15) 29.79605 0.01267853
Ljung-Box Test R Q(20) 30.43184 0.06315199
Ljung-Box Test R^2 Q(10) 2.050112 0.9959415
Ljung-Box Test R^2 Q(15) 2.912986 0.9996651
Ljung-Box Test R^2 Q(20) 2.990707 0.999996
LM Arch Test R TR^2 2.715819 0.9972394

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5829673 0.6064117 0.5828908 0.5923271

>
arch1=garchFit(~garch(2,0),data=rtdata,include.mean=F,trace=F,algoritm="lbfgsb+nm",
cond.dist="QMLE")
>
arch2=garchFit(~garch(2,0),data=rtdata,include.mean=F,trace=F,algoritm="lbfgsb+nm",
cond.dist="QMLE")
> summary(arch2)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(2, 0), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algoritm = "lbfgsb+nm")

Mean and Variance Equation:


data ~ garch(2, 0)
<environment: 0x06ec9d88>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 alpha2
0.08014609 0.99999999 0.00000001

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 8.015e-02 5.240e-02 1.529 0.1262
alpha1 1.000e+00 4.149e-01 2.410 0.0159 *
alpha2 1.000e-08 2.746e-02 0.000 1.0000
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-92.47055 normalized: -0.2871756

Description:
Mon Jan 16 14:33:41 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 126812.3 0
Shapiro-Wilk Test R W 0.2646906 0
Ljung-Box Test R Q(10) 23.7425 0.00831401
Ljung-Box Test R Q(15) 29.84811 0.01248113
Ljung-Box Test R Q(20) 30.48118 0.06242301
Ljung-Box Test R^2 Q(10) 2.054862 0.9959021
Ljung-Box Test R^2 Q(15) 2.92024 0.9996599
Ljung-Box Test R^2 Q(20) 2.997907 0.9999959
LM Arch Test R TR^2 2.722354 0.9972069

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5929848 0.6281514 0.5928133 0.6070244

>
arch3=garchFit(~garch(3,0),data=rtdata,include.mean=F,trace=F,algoritm="lbfgsb+nm",
cond.dist="QMLE")
> summary(arch3)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(3, 0), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algoritm = "lbfgsb+nm")

Mean and Variance Equation:


data ~ garch(3, 0)
<environment: 0x0bd85dec>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 alpha2 alpha3
0.07678795 0.99999999 0.00000001 0.02951389

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 7.679e-02 5.158e-02 1.489 0.1366
alpha1 1.000e+00 4.156e-01 2.406 0.0161 *
alpha2 1.000e-08 2.954e-02 0.000 1.0000
alpha3 2.951e-02 2.088e-02 1.413 0.1575
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-88.14863 normalized: -0.2737535

Description:
Mon Jan 16 14:37:27 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 157318 0
Shapiro-Wilk Test R W 0.2443675 0
Ljung-Box Test R Q(10) 17.39171 0.06613345
Ljung-Box Test R Q(15) 23.78688 0.06880213
Ljung-Box Test R Q(20) 24.45149 0.2232261
Ljung-Box Test R^2 Q(10) 0.9585746 0.9998583
Ljung-Box Test R^2 Q(15) 1.783419 0.9999862
Ljung-Box Test R^2 Q(20) 1.849965 0.9999999
LM Arch Test R TR^2 1.606151 0.9998119

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5723517 0.6192406 0.5720481 0.5910713

> arch4=garchFit(~garch(4,0),data=rtdata,include.mean=F,trace=F,algoritm="lbfgsb
+ +nm",cond.dist="QMLE")
> summary(arch4)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(4, 0), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algoritm = "lbfgsb\n+nm")

Mean and Variance Equation:


data ~ garch(4, 0)
<environment: 0x0372c09c>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 alpha2 alpha3 alpha4
0.07656157 0.99999999 0.00000001 0.02797250 0.01417058

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 7.656e-02 5.155e-02 1.485 0.1375
alpha1 1.000e+00 4.489e-01 2.228 0.0259 *
alpha2 1.000e-08 2.970e-02 0.000 1.0000
alpha3 2.797e-02 2.017e-02 1.387 0.1655
alpha4 1.417e-02 1.809e-02 0.783 0.4335
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-88.41471 normalized: -0.2745798

Description:
Mon Jan 16 14:40:47 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 163975.5 0
Shapiro-Wilk Test R W 0.238877 0
Ljung-Box Test R Q(10) 15.48948 0.115209
Ljung-Box Test R Q(15) 21.84303 0.1119863
Ljung-Box Test R Q(20) 22.42768 0.3177618
Ljung-Box Test R^2 Q(10) 0.8984751 0.9998949
Ljung-Box Test R^2 Q(15) 1.714912 0.9999894
Ljung-Box Test R^2 Q(20) 1.780692 1
LM Arch Test R TR^2 1.538968 0.9998502

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5802156 0.6388266 0.5797431 0.6036150

> arch5=garchFit(~garch(5,0),data=rtdata,include.mean=F,trace=F,algoritm="lbfgsb
+ +nm",cond.dist="QMLE")
> summary(arch5)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(5, 0), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algoritm = "lbfgsb\n+nm")

Mean and Variance Equation:


data ~ garch(5, 0)
<environment: 0x0f4ffa28>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 alpha2 alpha3 alpha4 alpha5
0.07510955 0.21654451 0.00000001 0.02752411 0.02412043 0.16813195

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 7.511e-02 5.071e-02 1.481 0.1386
alpha1 2.165e-01 1.057e-01 2.049 0.0405 *
alpha2 1.000e-08 1.700e-02 0.000 1.0000
alpha3 2.752e-02 2.029e-02 1.357 0.1749
alpha4 2.412e-02 1.715e-02 1.406 0.1596
alpha5 1.681e-01 1.044e-01 1.611 0.1073
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-78.13378 normalized: -0.2426515

Description:
Mon Jan 16 14:42:01 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 190386.4 0
Shapiro-Wilk Test R W 0.2372128 0
Ljung-Box Test R Q(10) 15.53774 0.1136519
Ljung-Box Test R Q(15) 18.52333 0.2361523
Ljung-Box Test R Q(20) 18.90177 0.5282191
Ljung-Box Test R^2 Q(10) 0.3786518 0.9999983
Ljung-Box Test R^2 Q(15) 0.4333826 1
Ljung-Box Test R^2 Q(20) 0.4942516 1
LM Arch Test R TR^2 0.3599366 1

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5225701 0.5929033 0.5218924 0.5506493

> arch6=garchFit(~garch(6,0),data=rtdata,include.mean=F,trace=F,algoritm="lbfgsb
+ +nm",cond.dist="QMLE")
> summary(arch6)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(6, 0), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algoritm = "lbfgsb\n+nm")

Mean and Variance Equation:


data ~ garch(6, 0)
<environment: 0x059a9e30>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 alpha2 alpha3 alpha4 alpha5
0.07523959 0.21298738 0.00000001 0.02722244 0.02380833 0.16500655
alpha6
0.00000001

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 7.524e-02 5.075e-02 1.482 0.1382
alpha1 2.130e-01 1.012e-01 2.105 0.0353 *
alpha2 1.000e-08 1.698e-02 0.000 1.0000
alpha3 2.722e-02 1.986e-02 1.371 0.1705
alpha4 2.381e-02 1.690e-02 1.409 0.1589
alpha5 1.650e-01 1.003e-01 1.645 0.0999 .
alpha6 1.000e-08 3.024e-02 0.000 1.0000
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-78.54997 normalized: -0.243944

Description:
Mon Jan 16 14:43:21 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 189178.1 0
Shapiro-Wilk Test R W 0.2378083 0
Ljung-Box Test R Q(10) 15.73775 0.1073897
Ljung-Box Test R Q(15) 18.76398 0.2246291
Ljung-Box Test R Q(20) 19.14132 0.5126578
Ljung-Box Test R^2 Q(10) 0.3942962 0.9999979
Ljung-Box Test R^2 Q(15) 0.4493343 1
Ljung-Box Test R^2 Q(20) 0.5105972 1
LM Arch Test R TR^2 0.3748065 0.9999999

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5313663 0.6134218 0.5304477 0.5641255

> arch7=garchFit(~garch(7,0),data=rtdata,include.mean=F,trace=F,algoritm="lbfgsb
+ +nm",cond.dist="QMLE")
> summary(arch7)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(7, 0), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algoritm = "lbfgsb\n+nm")

Mean and Variance Equation:


data ~ garch(7, 0)
<environment: 0x043a90fc>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 alpha2 alpha3 alpha4 alpha5
0.07537630 0.20848122 0.00000001 0.02693385 0.02345315 0.16274050
alpha6 alpha7
0.00000001 0.00000001

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 7.538e-02 5.066e-02 1.488 0.1368
alpha1 2.085e-01 9.890e-02 2.108 0.0350 *
alpha2 1.000e-08 1.694e-02 0.000 1.0000
alpha3 2.693e-02 1.968e-02 1.369 0.1711
alpha4 2.345e-02 1.655e-02 1.417 0.1563
alpha5 1.627e-01 9.727e-02 1.673 0.0943 .
alpha6 1.000e-08 3.063e-02 0.000 1.0000
alpha7 1.000e-08 1.621e-02 0.000 1.0000
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-78.97554 normalized: -0.2452657

Description:
Mon Jan 16 14:44:43 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 187902.9 0
Shapiro-Wilk Test R W 0.2385375 0
Ljung-Box Test R Q(10) 15.95366 0.1009667
Ljung-Box Test R Q(15) 19.01976 0.2128397
Ljung-Box Test R Q(20) 19.39603 0.4962336
Ljung-Box Test R^2 Q(10) 0.4102044 0.9999974
Ljung-Box Test R^2 Q(15) 0.4656383 1
Ljung-Box Test R^2 Q(20) 0.5273267 1
LM Arch Test R TR^2 0.3900006 0.9999999

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5402207 0.6339984 0.5390257 0.5776598

> arch8=garchFit(~garch(8,0),data=rtdata,include.mean=F,trace=F,algoritm="lbfgsb
+ +nm",cond.dist="QMLE")
> summary(arch8)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(8, 0), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algoritm = "lbfgsb\n+nm")

Mean and Variance Equation:


data ~ garch(8, 0)
<environment: 0x0bda0404>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 alpha2 alpha3 alpha4 alpha5
0.07551979 0.20427566 0.00000001 0.02668887 0.02310943 0.15991594
alpha6 alpha7 alpha8
0.00000001 0.00000001 0.00000001
Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 7.552e-02 5.060e-02 1.492 0.1356
alpha1 2.043e-01 9.626e-02 2.122 0.0338 *
alpha2 1.000e-08 1.658e-02 0.000 1.0000
alpha3 2.669e-02 1.942e-02 1.374 0.1694
alpha4 2.311e-02 1.621e-02 1.426 0.1539
alpha5 1.599e-01 9.509e-02 1.682 0.0926 .
alpha6 1.000e-08 3.082e-02 0.000 1.0000
alpha7 1.000e-08 1.564e-02 0.000 1.0000
alpha8 1.000e-08 1.458e-02 0.000 1.0000
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-79.41365 normalized: -0.2466263

Description:
Mon Jan 16 14:45:47 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 186551.4 0
Shapiro-Wilk Test R W 0.2393151 0
Ljung-Box Test R Q(10) 16.20072 0.09402899
Ljung-Box Test R Q(15) 19.31072 0.1999975
Ljung-Box Test R Q(20) 19.68557 0.4777472
Ljung-Box Test R^2 Q(10) 0.4280391 0.9999969
Ljung-Box Test R^2 Q(15) 0.4838926 1
Ljung-Box Test R^2 Q(20) 0.5460297 1
LM Arch Test R TR^2 0.4070201 0.9999999

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5491531 0.6546530 0.5476466 0.5912721

> summary(arch5<-garch(rtdata, order = c(0,5)))

***** ESTIMATION WITH ANALYTICAL GRADIENT *****

I INITIAL X(I) D(I)

1 1.995395e-01 1.000e+00
2 5.000000e-02 1.000e+00
3 5.000000e-02 1.000e+00
4 5.000000e-02 1.000e+00
5 5.000000e-02 1.000e+00
6 5.000000e-02 1.000e+00

IT NF F RELDF PRELDF RELDX STPPAR D*STEP NPRELDF


0 1 -1.485e+02
1 3 -1.958e+02 2.42e-01 2.53e-01 2.8e-01 5.0e+03 1.0e-01 6.26e+02
2 5 -2.032e+02 3.67e-02 4.16e-02 9.4e-02 7.0e+01 2.0e-02 1.09e+03
3 7 -2.065e+02 1.58e-02 1.93e-02 7.8e-02 4.2e+00 1.6e-02 1.19e+01
4 8 -2.074e+02 4.17e-03 6.08e-03 4.5e-02 2.6e+00 1.6e-02 1.24e+01
5 9 -2.086e+02 5.71e-03 7.54e-03 4.3e-02 2.0e+00 1.6e-02 1.07e+01
6 11 -2.108e+02 1.06e-02 1.01e-02 1.0e-01 2.0e+00 3.1e-02 7.37e+00
7 13 -2.112e+02 2.06e-03 1.55e-03 1.6e-02 2.0e+00 6.2e-03 4.27e+01
8 15 -2.113e+02 2.64e-04 2.62e-04 1.8e-03 2.9e+01 6.2e-04 8.44e+01
9 18 -2.117e+02 1.99e-03 1.98e-03 1.5e-02 3.4e+00 5.0e-03 2.45e+02
10 21 -2.117e+02 4.26e-05 4.25e-05 3.3e-04 2.8e+02 1.0e-04 3.49e+02
11 23 -2.117e+02 8.53e-06 8.53e-06 6.7e-05 1.6e+04 2.0e-05 1.16e+04
12 25 -2.117e+02 1.71e-05 1.71e-05 1.3e-04 2.8e+04 4.0e-05 1.03e+06
13 27 -2.117e+02 3.41e-06 3.41e-06 2.7e-05 9.3e+05 8.0e-06 1.02e+08
14 29 -2.117e+02 6.83e-06 6.83e-06 5.4e-05 8.3e+04 1.6e-05 9.98e+09
15 31 -2.117e+02 1.37e-05 1.37e-05 1.1e-04 1.7e+03 3.2e-05 9.72e+11
16 33 -2.117e+02 2.73e-06 2.73e-06 2.1e-05 1.5e+03 6.4e-06 5.91e+13
17 36 -2.117e+02 5.47e-08 5.47e-08 4.3e-07 3.8e+05 1.3e-07 2.44e+14
18 38 -2.117e+02 1.09e-07 1.09e-07 8.6e-07 4.6e+05 2.6e-07 5.29e+15
19 40 -2.117e+02 2.19e-07 2.19e-07 1.7e-06 1.1e+06 5.1e-07 4.10e+17
20 43 -2.117e+02 4.37e-09 4.37e-09 3.4e-08 4.6e+07 1.0e-08 3.87e+19
21 45 -2.117e+02 8.75e-09 8.75e-09 6.9e-08 4.4e+07 2.0e-08 3.01e+21
22 48 -2.117e+02 1.75e-10 1.75e-10 1.4e-09 6.8e+09 4.1e-10 2.91e+23
23 50 -2.117e+02 3.50e-10 3.50e-10 2.8e-09 6.5e+09 8.2e-10 2.78e+25
24 52 -2.117e+02 7.00e-11 7.00e-11 5.5e-10 1.9e+01 1.6e-10 -4.16e-01
25 54 -2.117e+02 1.40e-11 1.40e-11 1.1e-10 3.2e+01 3.3e-11 -4.21e-01
26 56 -2.117e+02 2.80e-11 2.80e-11 2.2e-10 6.6e+01 6.5e-11 -4.25e-01
27 58 -2.117e+02 5.60e-11 5.60e-11 4.4e-10 5.7e+00 1.3e-10 -3.83e-01
28 61 -2.117e+02 1.12e-12 1.12e-12 8.8e-12 2.0e+00 2.6e-12 -4.01e-01
29 63 -2.117e+02 2.24e-12 2.24e-12 1.8e-11 2.0e+00 5.2e-12 -2.17e-01
30 65 -2.117e+02 4.47e-13 4.48e-13 3.5e-12 2.0e+00 1.0e-12 -2.18e-01
31 67 -2.117e+02 8.96e-13 8.96e-13 7.0e-12 3.0e+00 2.1e-12 -3.19e-01
32 69 -2.117e+02 1.80e-13 1.79e-13 1.4e-12 2.0e+00 4.2e-13 -3.99e-01
33 71 -2.117e+02 3.58e-13 3.58e-13 2.8e-12 2.0e+00 8.4e-13 -3.71e-01
34 73 -2.117e+02 7.16e-13 7.16e-13 5.6e-12 2.0e+00 1.7e-12 -4.23e-01
35 75 -2.117e+02 1.43e-13 1.43e-13 1.1e-12 2.0e+00 3.3e-13 -4.27e-01
36 77 -2.117e+02 2.90e-14 2.87e-14 2.3e-13 2.0e+00 6.7e-14 -4.22e-01
37 79 -2.117e+02 5.75e-14 5.73e-14 4.5e-13 2.0e+00 1.3e-13 -3.79e-01
38 81 -2.117e+02 1.02e-14 1.15e-14 9.0e-14 2.0e+00 2.7e-14 -3.80e-01
39 83 -2.117e+02 2.39e-14 2.29e-14 1.8e-13 2.0e+00 5.4e-14 -3.17e-01
40 85 -2.117e+02 5.10e-15 4.59e-15 3.6e-14 2.0e+00 1.1e-14 -4.18e-01
41 87 -2.117e+02 8.99e-15 9.17e-15 7.2e-14 2.0e+00 2.1e-14 -3.97e-01
42 89 -2.117e+02 1.07e-15 1.83e-15 1.4e-14 2.0e+00 4.3e-15 -4.23e-01
43 91 -2.117e+02 3.62e-15 3.67e-15 2.9e-14 2.0e+00 8.6e-15 -4.06e-01
44 93 -2.117e+02 1.21e-15 7.34e-16 5.8e-15 2.0e+00 1.7e-15 -4.22e-01
45 94 -2.117e+02 -4.72e+07 1.47e-15 1.2e-14 2.0e+00 3.4e-15 -4.02e-01

***** FALSE CONVERGENCE *****

FUNCTION -2.117279e+02 RELDX 1.154e-14


FUNC. EVALS 94 GRAD. EVALS 45
PRELDF 1.467e-15 NPRELDF -4.019e-01

I FINAL X(I) D(I) G(I)

1 7.511753e-02 1.000e+00 -1.022e+01


2 1.272971e-01 1.000e+00 -3.458e+01
3 1.978228e-15 1.000e+00 7.774e+01
4 3.250124e-02 1.000e+00 8.060e+00
5 3.492588e-02 1.000e+00 7.621e+00
6 1.160973e-01 1.000e+00 -2.751e+01
Call:
garch(x = rtdata, order = c(0, 5))

Model:
GARCH(0,5)

Residuals:
Min 1Q Median 3Q Max
-11.91044 -0.04444 0.04864 0.12598 3.43114

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
a0 7.512e-02 7.997e-04 93.931 < 2e-16 ***
a1 1.273e-01 2.623e-02 4.853 1.21e-06 ***
a2 1.978e-15 2.435e-02 0.000 1.000
a3 3.250e-02 2.383e-02 1.364 0.173
a4 3.493e-02 5.663e-02 0.617 0.537
a5 1.161e-01 2.504e-02 4.637 3.53e-06 ***
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Diagnostic Tests:
Jarque Bera Test

data: Residuals
X-squared = 160200, df = 2, p-value < 2.2e-16

Box-Ljung test

data: Squared.Residuals
X-squared = 0.001349, df = 1, p-value = 0.9707

> residu=resid(arch5)
> resku=residu^2
> ks.test(residu,ecdf(residu))

One-sample Kolmogorov-Smirnov test

data: residu
D = 0.0031546, p-value = 1
alternative hypothesis: two-sided

> Box.test(residu,lag = 1, type =c("Box-Pierce","Ljung-Box"),fitdf = 0)

Box-Pierce test

data: residu
X-squared = 1.6411, df = 1, p-value = 0.2002

> ArchTest(residu, lags=12, demean=FALSE)

ARCH LM-test; Null hypothesis: no ARCH effects

data: residu
Chi-squared = 0.83321, df = 12, p-value = 1

> garch11=garchFit(~garch(1,1), data=rtdata,include.mean=F, trace=F,


algorithm="lbfgsb+nm", cond.dist="QMLE")
> summary(garch11)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(1, 1), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algorithm = "lbfgsb+nm")

Mean and Variance Equation:


data ~ garch(1, 1)
<environment: 0x035d9c5c>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 beta1
0.06893 1.32756 0.10258

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 0.06893 0.04937 1.396 0.1626
alpha1 1.32756 0.70244 1.890 0.0588 .
beta1 0.10258 0.10195 1.006 0.3143
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-88.96179 normalized: -0.2762789

Description:
Mon Jan 16 15:09:17 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 175277.4 0
Shapiro-Wilk Test R W 0.2356695 0
Ljung-Box Test R Q(10) 15.78055 0.106089
Ljung-Box Test R Q(15) 20.87666 0.1408165
Ljung-Box Test R Q(20) 21.55278 0.3652625
Ljung-Box Test R^2 Q(10) 0.5821603 0.9999863
Ljung-Box Test R^2 Q(15) 0.9643977 0.9999998
Ljung-Box Test R^2 Q(20) 1.022551 1
LM Arch Test R TR^2 0.8504967 0.9999943

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5711913 0.6063579 0.5710198 0.5852309

> garch12=garchFit(~garch(1,2), data=rtdata,include.mean=F, trace=F,


algorithm="lbfgsb+nm", cond.dist="QMLE")
> > summary(garch12)
Error: unexpected '>' in ">"
> summary(garch12)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(1, 2), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algorithm = "lbfgsb+nm")

Mean and Variance Equation:


data ~ garch(1, 2)
<environment: 0x037f0bf8>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 beta1 beta2
5.6624e-02 5.5650e-01 1.0093e-08 2.5966e-01

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 5.662e-02 3.878e-02 1.460 0.1443
alpha1 5.565e-01 3.626e-01 1.535 0.1249
beta1 1.009e-08 5.037e-02 0.000 1.0000
beta2 2.597e-01 1.186e-01 2.189 0.0286 *
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-86.28706 normalized: -0.2679722

Description:
Mon Jan 16 15:12:39 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 181164.5 0
Shapiro-Wilk Test R W 0.2301159 0
Ljung-Box Test R Q(10) 16.92148 0.07611961
Ljung-Box Test R Q(15) 20.16939 0.1655307
Ljung-Box Test R Q(20) 20.53074 0.4252
Ljung-Box Test R^2 Q(10) 1.047719 0.9997869
Ljung-Box Test R^2 Q(15) 1.192875 0.9999991
Ljung-Box Test R^2 Q(20) 1.25882 1
LM Arch Test R TR^2 1.064629 0.9999799

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5607892 0.6076780 0.5604856 0.5795087

> garch21=garchFit(~garch(2,1), data=rtdata,include.mean=F, trace=F,


algorithm="lbfgsb+nm", cond.dist="QMLE")
> summary(garch21)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(2, 1), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algorithm = "lbfgsb+nm")

Mean and Variance Equation:


data ~ garch(2, 1)
<environment: 0x036f9dbc>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 alpha2 beta1
6.8882e-02 1.2957e+00 9.3876e-09 1.0482e-01

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 6.888e-02 5.230e-02 1.317 0.1878
alpha1 1.296e+00 7.029e-01 1.843 0.0653 .
alpha2 9.388e-09 3.982e-01 0.000 1.0000
beta1 1.048e-01 1.697e-01 0.618 0.5368
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-89.70962 normalized: -0.2786013

Description:
Mon Jan 16 15:13:03 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 174222.1 0
Shapiro-Wilk Test R W 0.2354617 0
Ljung-Box Test R Q(10) 16.00301 0.09954613
Ljung-Box Test R Q(15) 21.14189 0.1323568
Ljung-Box Test R Q(20) 21.81637 0.3505575
Ljung-Box Test R^2 Q(10) 0.6077577 0.9999832
Ljung-Box Test R^2 Q(15) 1.006145 0.9999997
Ljung-Box Test R^2 Q(20) 1.064726 1
LM Arch Test R TR^2 0.8893655 0.9999927

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5820473 0.6289362 0.5817437 0.6007668

> garch21=garchFit(~garch(2,1), data=rtdata,include.mean=F, trace=F,


algorithm="lbfgsb+nm", cond.dist="QMLE")
> garch22=garchFit(~garch(2,2), data=rtdata,include.mean=F, trace=F,
algorithm="lbfgsb+nm", cond.dist="QMLE")
> summary(garch22)

Title:
GARCH Modelling

Call:
garchFit(formula = ~garch(2, 2), data = rtdata, cond.dist = "QMLE",
include.mean = F, trace = F, algorithm = "lbfgsb+nm")

Mean and Variance Equation:


data ~ garch(2, 2)
<environment: 0x03fe836c>
[data = rtdata]

Conditional Distribution:
QMLE

Coefficient(s):
omega alpha1 alpha2 beta1 beta2
0.071312 1.009071 -0.076328 0.035137 0.051812

Std. Errors:
robust

Error Analysis:
Estimate Std. Error t value Pr(>|t|)
omega 0.07131 0.05617 1.270 0.204
alpha1 1.00907 0.20946 4.818 1.45e-06 ***
alpha2 -0.07633 0.13212 -0.578 0.563
beta1 0.03514 0.14420 0.244 0.807
beta2 0.05181 0.03306 1.567 0.117
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Log Likelihood:
-84.70247 normalized: -0.2630511

Description:
Mon Jan 16 15:13:40 2017 by user: aLf

Standardised Residuals Tests:


Statistic p-Value
Jarque-Bera Test R Chi^2 159580.8 0
Shapiro-Wilk Test R W 0.2478968 0
Ljung-Box Test R Q(10) 16.42924 0.08798648
Ljung-Box Test R Q(15) 22.22909 0.1019362
Ljung-Box Test R Q(20) 22.81928 0.2977553
Ljung-Box Test R^2 Q(10) 0.9022675 0.9998929
Ljung-Box Test R^2 Q(15) 1.626256 0.9999926
Ljung-Box Test R^2 Q(20) 1.694037 1
LM Arch Test R TR^2 1.455878 0.9998888

Information Criterion Statistics:


AIC BIC SIC HQIC
0.5571582 0.6157692 0.5566857 0.5805576

> summary(garch22<-garch(rtdata, order = c(2,2)))


***** ESTIMATION WITH ANALYTICAL GRADIENT *****

I INITIAL X(I) D(I)

1 2.128421e-01 1.000e+00
2 5.000000e-02 1.000e+00
3 5.000000e-02 1.000e+00
4 5.000000e-02 1.000e+00
5 5.000000e-02 1.000e+00

IT NF F RELDF PRELDF RELDX STPPAR D*STEP NPRELDF


0 1 -1.085e+02
1 3 -1.479e+02 2.66e-01 2.97e-01 2.0e-01 4.4e+03 1.0e-01 6.52e+02
2 5 -1.556e+02 4.97e-02 5.06e-02 6.6e-02 3.6e+02 2.0e-02 2.35e+03
3 7 -1.689e+02 7.85e-02 8.69e-02 1.2e-01 5.1e+00 4.0e-02 1.60e+03
4 9 -1.768e+02 4.48e-02 5.79e-02 8.4e-02 1.2e+01 3.9e-02 2.13e+02
5 10 -1.799e+02 1.73e-02 3.86e-02 6.2e-02 2.3e+00 3.9e-02 4.31e+01
6 11 -1.903e+02 5.49e-02 7.55e-02 1.4e-01 2.0e+00 7.7e-02 2.62e+01
7 12 -1.963e+02 3.03e-02 7.11e-02 1.5e-01 2.0e+00 7.7e-02 7.54e+00
8 13 -2.028e+02 3.19e-02 3.11e-02 1.1e-01 2.0e+00 7.7e-02 3.10e+00
9 14 -2.053e+02 1.22e-02 2.05e-02 1.0e-01 2.2e+01 7.7e-02 2.10e+00
10 18 -2.053e+02 1.37e-04 2.52e-04 1.4e-03 5.2e+00 1.1e-03 2.46e+00
11 20 -2.053e+02 3.22e-04 2.95e-04 3.2e-03 2.0e+00 2.8e-03 2.31e+00
12 23 -2.059e+02 2.47e-03 2.35e-03 2.0e-02 2.0e+00 1.6e-02 2.42e+00
13 26 -2.059e+02 5.80e-05 4.99e-05 3.8e-04 4.9e+00 3.3e-04 4.47e+01
14 28 -2.059e+02 1.11e-04 1.09e-04 8.0e-04 1.6e+01 6.6e-04 6.42e+01
15 30 -2.059e+02 2.19e-05 2.19e-05 1.6e-04 1.0e+03 1.3e-04 8.47e+01
16 32 -2.059e+02 4.39e-05 4.38e-05 3.2e-04 5.4e+04 2.6e-04 5.56e+03
17 34 -2.059e+02 8.80e-05 8.77e-05 6.5e-04 1.7e+02 5.3e-04 5.86e+05
18 37 -2.059e+02 1.77e-06 1.76e-06 1.3e-05 9.0e+03 1.1e-05 1.82e+07
19 39 -2.059e+02 3.53e-06 3.52e-06 2.6e-05 1.1e+04 2.1e-05 2.12e+08
20 41 -2.059e+02 7.06e-06 7.03e-06 5.2e-05 6.2e+04 4.2e-05 1.38e+10
21 43 -2.059e+02 1.41e-06 1.41e-06 1.0e-05 8.3e+08 8.4e-06 1.32e+12
22 45 -2.059e+02 2.83e-07 2.81e-07 2.1e-06 2.8e+08 1.7e-06 1.32e+14
23 47 -2.059e+02 5.65e-08 5.63e-08 4.1e-07 1.4e+09 3.4e-07 1.32e+16
24 49 -2.059e+02 1.13e-07 1.13e-07 8.3e-07 3.2e+08 6.7e-07 1.32e+18
25 51 -2.059e+02 2.26e-07 2.25e-07 1.7e-06 1.0e+07 1.3e-06 1.32e+20
26 53 -2.059e+02 4.52e-08 4.50e-08 3.3e-07 5.5e+06 2.7e-07 1.31e+22
27 55 -2.059e+02 9.04e-09 9.00e-09 6.6e-08 3.9e+07 5.4e-08 9.78e+23
28 57 -2.059e+02 1.81e-09 1.80e-09 1.3e-08 4.4e+08 1.1e-08 7.96e+25
29 59 -2.059e+02 3.62e-10 3.60e-10 2.6e-09 5.4e+09 2.2e-09 7.23e+27
30 61 -2.059e+02 7.23e-10 7.20e-10 5.3e-09 1.7e+09 4.3e-09 6.96e+29
31 63 -2.059e+02 1.45e-09 1.44e-09 1.1e-08 7.3e+07 8.6e-09 6.85e+31
32 67 -2.059e+02 2.89e-12 2.88e-12 2.1e-11 2.0e+00 1.7e-11 -1.60e-01
33 69 -2.059e+02 5.79e-13 5.76e-13 4.2e-12 2.0e+00 3.4e-12 -1.00e-01
34 71 -2.059e+02 1.16e-12 1.15e-12 8.5e-12 8.9e+00 6.9e-12 -1.57e-01
35 73 -2.059e+02 2.31e-12 2.30e-12 1.7e-11 5.8e+01 1.4e-11 -1.66e-01
36 76 -2.059e+02 4.72e-14 4.61e-14 3.4e-13 3.6e+01 2.8e-13 -1.65e-01
37 78 -2.059e+02 9.23e-14 9.22e-14 6.8e-13 2.7e+02 5.5e-13 -1.67e-01
38 80 -2.059e+02 1.79e-14 1.84e-14 1.4e-13 2.0e+02 1.1e-13 -1.67e-01
39 83 -2.059e+02 4.14e-16 3.69e-16 2.7e-15 3.7e+02 2.2e-15 -1.67e-01
40 86 -2.059e+02 3.04e-15 2.95e-15 2.2e-14 5.7e+04 1.8e-14 -1.67e-01
41 88 -2.059e+02 -4.86e+07 5.90e-16 4.3e-15 1.4e+03 3.5e-15 -1.67e-01

***** FALSE CONVERGENCE *****

FUNCTION -2.059251e+02 RELDX 4.334e-15


FUNC. EVALS 88 GRAD. EVALS 41
PRELDF 5.900e-16 NPRELDF -1.672e-01

I FINAL X(I) D(I) G(I)

1 4.605784e-02 1.000e+00 -1.113e+00


2 3.264518e-01 1.000e+00 -1.241e+01
3 1.290797e-15 1.000e+00 2.762e+01
4 8.689695e-02 1.000e+00 1.626e+01
5 3.121566e-01 1.000e+00 -1.897e+00

Call:
garch(x = rtdata, order = c(2, 2))

Model:
GARCH(2,2)

Residuals:
Min 1Q Median 3Q Max
-11.80172 -0.04437 0.04648 0.12335 4.63464

Coefficient(s):
Estimate Std. Error t value Pr(>|t|)
a0 4.606e-02 1.749e-02 2.634 0.00845 **
a1 3.265e-01 1.393e-01 2.344 0.01906 *
a2 1.291e-15 1.633e-01 0.000 1.00000
b1 8.690e-02 3.346e-01 0.260 0.79512
b2 3.122e-01 1.676e-01 1.863 0.06246 .
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1

Diagnostic Tests:
Jarque Bera Test

data: Residuals
X-squared = 166580, df = 2, p-value < 2.2e-16

Box-Ljung test

data: Squared.Residuals
X-squared = 0.0034925, df = 1, p-value = 0.9529

> res2=resid(garch22)
> resku2=res2^2
> ks.test(res2,ecdf(res2))

One-sample Kolmogorov-Smirnov test

data: res2
D = 0.003125, p-value = 1
alternative hypothesis: two-sided

> Box.test(residu,lag = 1, type =c("Box-Pierce","Ljung-Box"),fitdf = 0)

Box-Pierce test

data: residu
X-squared = 1.6411, df = 1, p-value = 0.2002

> Box-Pierce testBox.test(residu,lag = 1, type =c("Box-Pierce","Ljung-


Box"),fitdf = 0)
Error: unexpected symbol in " Box-Pierce testBox.test"
> Box.test(res2,lag = 1, type =c("Box-Pierce","Ljung-Box"),fitdf = 0)

Box-Pierce test

data: res2
X-squared = 2.0026, df = 1, p-value = 0.157

> ArchTest(res2, lags=12, demean=FALSE)

ARCH LM-test; Null hypothesis: no ARCH effects

data: res2
Chi-squared = 1.8244, df = 12, p-value = 0.9996

> cor.test(residu, resku2, alternative = c("two.sided", "less", "greater"), method


= c("pearson", "kendall", "spearman"), exact = NULL, conf.level = 0.95, continuity
= FALSE)

Pearson's product-moment correlation

data: residu and resku2


t = -35.484, df = 315, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.9144296 -0.8699084
sample estimates:
cor
-0.8943621

>

You might also like