Chicago Boothf Garch Script
Chicago Boothf Garch Script
Chicago Boothf Garch Script
fGarch package
**** For more details, please download a copy of the fGarch document from the R mirror.
**** The document is fGarch.pdf.
****
**** Output edited ***
> setwd("C:/Users/rst/teaching/bs41202/sp2010")
> da=read.table("m-intc7303.txt")
> intc=log(da[,2]+1)
> library(fGarch)
> help(garchFit,package="fGarch")
> m1=garchFit(~garch(3,0),data=intc)
Series Initialization:
ARMA Model: arma
Formula Mean: ~ arma(0, 0)
GARCH Model: garch
Formula Variance: ~ garch(3, 0)
ARMA Order: 0 0
Max ARMA Order: 0
GARCH Order: 3 0
Max GARCH Order: 3
Maximum Order: 3
Conditional Dist: norm
h.start: 4
llh.start: 1
Length of Series: 372
Recursion Init: mci
Series Scale: 0.1337381 <=== Sample standard error
Parameter Initialization:
Initial Parameters: $params
Limits of Transformations: $U, $V
Which Parameters are Fixed? $includes
Parameter Matrix:
U V params includes
mu -1.34515434 1.345154 0.13451543 TRUE
omega 0.00000100 100.000000 0.10000000 TRUE
alpha1 0.00000001 1.000000 0.03333333 TRUE
alpha2 0.00000001 1.000000 0.03333333 TRUE
alpha3 0.00000001 1.000000 0.03333333 TRUE
gamma1 -0.99999999 1.000000 0.10000000 FALSE
gamma2 -0.99999999 1.000000 0.10000000 FALSE
gamma3 -0.99999999 1.000000 0.10000000 FALSE
delta 0.00000000 2.000000 2.00000000 FALSE
skew 0.10000000 10.000000 1.00000000 FALSE
shape 1.00000000 10.000000 4.00000000 FALSE
Index List of Parameters to be Optimized:
mu omega alpha1 alpha2 alpha3
1 2 3 4 5
Persistence: 0.1
http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2010/fGarch.txt Page 1 of 6
6/18/12 5:52 PM
> m1 <== Obtain estimation results [You may use summary(m1) to include model chekcing
statistics]
Title:
GARCH Modelling
Call:
garchFit(formula = ~garch(3, 0), data = intc)
Conditional Distribution:
norm
Coefficient(s):
mu omega alpha1 alpha2 alpha3
0.016572 0.012043 0.208649 0.071837 0.049045
Std. Errors:
based on Hessian
Error Analysis:
Estimate Std. Error t value Pr(>|t|)
mu 0.016572 0.006423 2.580 0.00988 **
omega 0.012043 0.001579 7.627 2.4e-14 ***
alpha1 0.208649 0.129177 1.615 0.10626
alpha2 0.071837 0.048551 1.480 0.13897
alpha3 0.049045 0.048847 1.004 0.31536
http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2010/fGarch.txt Page 2 of 6
6/18/12 5:52 PM
---
Log Likelihood:
233.4286 normalized: 0.6274962
> m1
Title:
GARCH Modelling
Call:
garchFit(formula = ~garch(1, 0), data = intc)
Conditional Distribution:
norm
Coefficient(s):
mu omega alpha1
0.016570 0.012490 0.363447
Std. Errors:
based on Hessian
Error Analysis:
Estimate Std. Error t value Pr(>|t|)
mu 0.016570 0.006161 2.689 0.00716 **
omega 0.012490 0.001549 8.061 6.66e-16 ***
alpha1 0.363447 0.131598 2.762 0.00575 **
---
Log Likelihood:
230.2423 normalized: 0.6189309
> plot(m1@residuals,type='l')
> plot([email protected],type='l')
>
> m1=garchFit(~garch(1,0),data=intc,cond.dist=c("std"))
Series Initialization:
ARMA Model: arma
Formula Mean: ~ arma(0, 0)
GARCH Model: garch
Formula Variance: ~ garch(1, 0)
ARMA Order: 0 0
Max ARMA Order: 0
GARCH Order: 1 0
Max GARCH Order: 1
Maximum Order: 1
Conditional Dist: std
h.start: 2
llh.start: 1
http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2010/fGarch.txt Page 3 of 6
6/18/12 5:52 PM
Parameter Initialization:
Initial Parameters: $params
Limits of Transformations: $U, $V
Which Parameters are Fixed? $includes
Parameter Matrix:
U V params includes
mu -1.34515434 1.345154 0.1345154 TRUE
omega 0.00000100 100.000000 0.1000000 TRUE
alpha1 0.00000001 1.000000 0.1000000 TRUE
gamma1 -0.99999999 1.000000 0.1000000 FALSE
delta 0.00000000 2.000000 2.0000000 FALSE
skew 0.10000000 10.000000 1.0000000 FALSE
shape 1.00000000 10.000000 4.0000000 TRUE
Index List of Parameters to be Optimized:
mu omega alpha1 shape
1 2 3 7
Persistence: 0.1
Title:
GARCH Modelling
Call:
http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2010/fGarch.txt Page 4 of 6
6/18/12 5:52 PM
Conditional Distribution:
std
Coefficient(s):
mu omega alpha1 shape
0.021571 0.013424 0.259867 5.985979
Std. Errors:
based on Hessian
Error Analysis:
Estimate Std. Error t value Pr(>|t|)
mu 0.021571 0.006054 3.563 0.000366 ***
omega 0.013424 0.001968 6.820 9.09e-12 ***
alpha1 0.259867 0.119901 2.167 0.030209 *
shape 5.985979 1.660030 3.606 0.000311 ***
---
Log Likelihood:
242.9678 normalized: 0.6531391
Title:
GARCH Modelling
Call:
garchFit(formula = ~garch(1, 0), data = intc, cond.dist = c("std"),
trace = F)
Conditional Distribution:
std
Coefficient(s):
mu omega alpha1 shape
0.021571 0.013424 0.259867 5.985979
Std. Errors:
based on Hessian
Error Analysis:
Estimate Std. Error t value Pr(>|t|)
mu 0.021571 0.006054 3.563 0.000366 ***
omega 0.013424 0.001968 6.820 9.09e-12 ***
alpha1 0.259867 0.119901 2.167 0.030209 *
http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2010/fGarch.txt Page 5 of 6
6/18/12 5:52 PM
Box-Ljung test
data: sresi
X-squared = 14.3129, df = 10, p-value = 0.1592
> Box.test(sresi^2,lag=10,type='Ljung')
Box-Ljung test
data: sresi^2
X-squared = 15.3592, df = 10, p-value = 0.1195
http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2010/fGarch.txt Page 6 of 6