library("zoo")
library("forecast")
library("tseries")
library("urca")
library ("Quandl")
library("fGarch")
library("rugarch")
library("stargazer")

Problem 2

Get data for the Microsoft stock price GOOG/NASDAQ_MSFTand construct the log return \(y_t = \Delta log MSFT_t\) .

Introduction and Data :

In this problem, data is analysed about Microsoft daily stock closing price from 1986 to 2016. The data for this problem is collectd from Quand.

microsoft_close_d<- read.csv(file = "http://www.google.com/finance/historical?q=NASDAQ%3AMSFT&startdate=Jan+1%2C+1990&output=csv", header=TRUE, sep=",")

microsoft_close<- ts(microsoft_close_d[,5], start=c(1986,3))
l.microsoft_close= log(microsoft_close)
str(microsoft_close)
##  Time-Series [1:4000] from 1988 to 5987: 54.1 53.9 53.5 54.7 54.4 ...
head(microsoft_close)
## [1] 54.07 53.86 53.49 54.66 54.35 53.59
tail(microsoft_close)
## [1] 35.28 34.94 36.72 34.88 34.91 34.00
tsdisplay(microsoft_close, lag.max = 100, xlab=" Years 1986-2016", ylab= "Stock closing price ", main ="Microsoft daily stock closing price from 1986 to 2016")

tsdisplay(l.microsoft_close, lag.max = 100, xlab=" Years 1986-2016", ylab= "log Stock closing price ", main ="Microsoft daily stock closing price from 1986 to 2016")

The plot above indicate both decreasing adn increae trend of stock price over the time frame. ACF plot is decreasing slowing, while PACK does not have any peak.

As the data is not stationary, let take a first difference to make the data stationary.

dl.microsoft_close<-diff(l.microsoft_close)
tsdisplay(dl.microsoft_close, lag.max = 100, xlab=" Years 1986-2016",ylab = "first difference of Stock closing price ", main ="Microsoft daily stock closing price from 1986 to 2016")

The pot suggests the data is stationaty. ACF and PACF plot has second and fourth peak. Let use ARMA (4,4) for modeling the data.

(a) Estimate an ARMA model: use ACF, PACF, Ljung-Box statistics, to identify and then estimate an appropriate model for log return

arma_4_4<- arima(dl.microsoft_close, order = c(4,0,4))
tsdiag(arma_4_4, gof.lag= 100)

The Ljung-Box statistics suggests model has high precdictive power for the first month only.

(b) Use ACF, PACF, Ljung-Box statistics for squared residuals from (a) to identify and then estimate an ARCH(m) model with normal innovations

par(mfcol=c(2,1)) 
 acf( arma_4_4$residuals^2 )
 pacf(arma_4_4$residuals^2 )

 par (mfcol=c(1,1)) 

In the PACF plot, peak are not significant after 8 lag. lets combine the ARCh (8) on the above ARMA(4,4)

 arch_8 <-garchFit(~ arma(4,4) + garch(8,0), data = dl.microsoft_close, trace = FALSE)
## Warning in arima(.series$x, order = c(u, 0, v), include.mean =
## include.mean): possible convergence problem: optim gave code = 1
 summary(arch_8)
## 
## Title:
##  GARCH Modelling 
## 
## Call:
##  garchFit(formula = ~arma(4, 4) + garch(8, 0), data = dl.microsoft_close, 
##     trace = FALSE) 
## 
## Mean and Variance Equation:
##  data ~ arma(4, 4) + garch(8, 0)
## <environment: 0x0000000011e32b58>
##  [data = dl.microsoft_close]
## 
## Conditional Distribution:
##  norm 
## 
## Coefficient(s):
##          mu          ar1          ar2          ar3          ar4  
## -4.7101e-04   9.6876e-01  -1.3792e-01  -2.6691e-01  -2.0745e-01  
##         ma1          ma2          ma3          ma4        omega  
## -1.0000e+00   1.6506e-01   3.0327e-01   1.5594e-01   7.7442e-05  
##      alpha1       alpha2       alpha3       alpha4       alpha5  
##  1.9195e-01   1.1775e-01   1.1666e-01   1.4464e-01   7.3773e-02  
##      alpha6       alpha7       alpha8  
##  8.4345e-02   9.6400e-02   6.7803e-02  
## 
## Std. Errors:
##  based on Hessian 
## 
## Error Analysis:
##          Estimate  Std. Error  t value Pr(>|t|)    
## mu     -4.710e-04   2.667e-04   -1.766 0.077424 .  
## ar1     9.688e-01   2.529e-01    3.831 0.000128 ***
## ar2    -1.379e-01   3.241e-01   -0.426 0.670408    
## ar3    -2.669e-01   6.727e-01   -0.397 0.691527    
## ar4    -2.075e-01   5.318e-01   -0.390 0.696459    
## ma1    -1.000e+00   2.551e-01   -3.920 8.85e-05 ***
## ma2     1.651e-01   3.316e-01    0.498 0.618627    
## ma3     3.033e-01   6.850e-01    0.443 0.657980    
## ma4     1.559e-01   5.480e-01    0.285 0.775979    
## omega   7.744e-05   6.317e-06   12.259  < 2e-16 ***
## alpha1  1.920e-01   2.915e-02    6.586 4.53e-11 ***
## alpha2  1.178e-01   2.515e-02    4.682 2.84e-06 ***
## alpha3  1.167e-01   2.158e-02    5.406 6.44e-08 ***
## alpha4  1.446e-01   2.634e-02    5.490 4.01e-08 ***
## alpha5  7.377e-02   2.443e-02    3.020 0.002528 ** 
## alpha6  8.434e-02   2.278e-02    3.703 0.000213 ***
## alpha7  9.640e-02   2.267e-02    4.253 2.11e-05 ***
## alpha8  6.780e-02   1.971e-02    3.440 0.000581 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Log Likelihood:
##  10671.02    normalized:  2.668422 
## 
## Description:
##  Tue Mar 22 23:37:33 2016 by user: kluitel 
## 
## 
## Standardised Residuals Tests:
##                                 Statistic p-Value  
##  Jarque-Bera Test   R    Chi^2  4480.814  0        
##  Shapiro-Wilk Test  R    W      0.9570959 0        
##  Ljung-Box Test     R    Q(10)  7.245007  0.70213  
##  Ljung-Box Test     R    Q(15)  10.722    0.7720408
##  Ljung-Box Test     R    Q(20)  13.26902  0.8655454
##  Ljung-Box Test     R^2  Q(10)  10.85226  0.3691439
##  Ljung-Box Test     R^2  Q(15)  13.70664  0.5478847
##  Ljung-Box Test     R^2  Q(20)  20.52738  0.4254037
##  LM Arch Test       R    TR^2   13.7713   0.3155506
## 
## Information Criterion Statistics:
##       AIC       BIC       SIC      HQIC 
## -5.327841 -5.299512 -5.327882 -5.317799

All the parametes estimated on error aalysis is significant except mu.

(c) Perform model checking for the ARCH model from (b): for both standardized residuals and squared standardized residuals plot ACF, examine Q(10) and Q(20) statistics. Also plot and comment on QQ plot and the results of Jarque-Bera test.

arch_8_res<-arch_8@residuals/arch_8@sigma.t
arch_8_res2<-(arch_8@residuals/arch_8@sigma.t)^2

#  standardized residuals 
par(mfcol=c(2,2)) 
  acf(arch_8_res,  na.action = na.exclude,  main="ACF for standardized residuals" )
  pacf( arch_8_res, na.action = na.exclude, main="PACF for standardized residuals" ) 

  # squared standardized residuals
  acf( arch_8_res2 , na.action = na.exclude,  main="ACF for Squared standardized residuals")
  pacf( arch_8_res2, na.action = na.exclude,  main="PACF for Squared standardized residuals" )

par (mfcol=c(1,1)) 

In ACF plot there is no peak, while in PACF there is peak at 12 lag in standard residual and at 16 lag in squared residual.

Box.test( (arch_8@residuals/arch_8@sigma.t)^2, lag = 10, type = "Ljung")
## 
##  Box-Ljung test
## 
## data:  (arch_8@residuals/arch_8@sigma.t)^2
## X-squared = 10.852, df = 10, p-value = 0.3691
Box.test( (arch_8@residuals/arch_8@sigma.t)^2, lag = 20, type = "Ljung")
## 
##  Box-Ljung test
## 
## data:  (arch_8@residuals/arch_8@sigma.t)^2
## X-squared = 20.527, df = 20, p-value = 0.4254

The p-value of Ljung test is not significat for lag 10 and lag 20 are 0.3598 and 0.3397, respectively.

plot( arch_8, which= 13)

#qqnorm(arch_8_res) #another method to qq plot
#qqline(arch_8_res)

The qq-plot suggests data is not normally distributed.

jarque.bera.test(arch_8_res)
## 
##  Jarque Bera Test
## 
## data:  arch_8_res
## X-squared = 4480.8, df = 2, p-value < 2.2e-16

The p value of Jarque–Bera Test is less than 0.0001.

(d) Estimate a GARCH(m, s) model with Student-t innovations. Perform model checking.

garch11<-garchFit(~arma(4,4)+ garch(1,1), data = dl.microsoft_close, trace=FALSE, cond.dist="sstd")
## Warning in arima(.series$x, order = c(u, 0, v), include.mean =
## include.mean): possible convergence problem: optim gave code = 1
summary(garch11)
## 
## Title:
##  GARCH Modelling 
## 
## Call:
##  garchFit(formula = ~arma(4, 4) + garch(1, 1), data = dl.microsoft_close, 
##     cond.dist = "sstd", trace = FALSE) 
## 
## Mean and Variance Equation:
##  data ~ arma(4, 4) + garch(1, 1)
## <environment: 0x00000000468c8900>
##  [data = dl.microsoft_close]
## 
## Conditional Distribution:
##  sstd 
## 
## Coefficient(s):
##          mu          ar1          ar2          ar3          ar4  
## -5.5383e-04  -6.0244e-01  -3.6384e-01   7.6224e-02   6.3205e-01  
##         ma1          ma2          ma3          ma4        omega  
##  5.7657e-01   3.2724e-01  -1.0526e-01  -6.6193e-01   3.0846e-06  
##      alpha1        beta1         skew        shape  
##  7.1937e-02   9.2381e-01   9.2912e-01   4.5226e+00  
## 
## Std. Errors:
##  based on Hessian 
## 
## Error Analysis:
##          Estimate  Std. Error  t value Pr(>|t|)    
## mu     -5.538e-04   3.515e-04   -1.576  0.11507    
## ar1    -6.024e-01   1.409e-01   -4.277 1.90e-05 ***
## ar2    -3.638e-01   1.606e-01   -2.266  0.02347 *  
## ar3     7.622e-02   1.651e-01    0.462  0.64426    
## ar4     6.321e-01   1.206e-01    5.242 1.59e-07 ***
## ma1     5.766e-01   1.358e-01    4.247 2.17e-05 ***
## ma2     3.272e-01   1.536e-01    2.130  0.03319 *  
## ma3    -1.053e-01   1.579e-01   -0.667  0.50490    
## ma4    -6.619e-01   1.161e-01   -5.700 1.20e-08 ***
## omega   3.085e-06   1.174e-06    2.627  0.00861 ** 
## alpha1  7.194e-02   1.539e-02    4.674 2.95e-06 ***
## beta1   9.238e-01   1.610e-02   57.375  < 2e-16 ***
## skew    9.291e-01   2.001e-02   46.423  < 2e-16 ***
## shape   4.523e+00   3.222e-01   14.035  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Log Likelihood:
##  10938.85    normalized:  2.735397 
## 
## Description:
##  Tue Mar 22 23:37:42 2016 by user: kluitel 
## 
## 
## Standardised Residuals Tests:
##                                 Statistic p-Value  
##  Jarque-Bera Test   R    Chi^2  9504.006  0        
##  Shapiro-Wilk Test  R    W      0.9426393 0        
##  Ljung-Box Test     R    Q(10)  6.680128  0.7552583
##  Ljung-Box Test     R    Q(15)  14.63704  0.4778638
##  Ljung-Box Test     R    Q(20)  16.5612   0.6812552
##  Ljung-Box Test     R^2  Q(10)  3.245137  0.9750524
##  Ljung-Box Test     R^2  Q(15)  7.462484  0.9435239
##  Ljung-Box Test     R^2  Q(20)  8.731585  0.9858127
##  LM Arch Test       R    TR^2   4.260435  0.9782651
## 
## Information Criterion Statistics:
##       AIC       BIC       SIC      HQIC 
## -5.463793 -5.441759 -5.463818 -5.455983
garch11_res<-garch11@residuals/garch11@sigma.t
garch11_res2<-(garch11@residuals/garch11@sigma.t)^2

#  standardized residuals 
par(mfcol=c(2,2)) 
  acf(garch11_res,  na.action = na.exclude,  main="ACF for standardized residuals" )
  pacf( garch11_res, na.action = na.exclude, main="PACF for standardized residuals" ) 

  # squared standardized residuals
  acf( garch11_res2 , na.action = na.exclude,  main="ACF for Squared standardized residuals")
  pacf( garch11_res2, na.action = na.exclude,  main="PACF for Squared standardized residuals" )

par (mfcol=c(1,1)) 

plot(garch11, which= 13)

The Ljung BOx-Test for Q(10) and Q(20) p-value is no significant. The parameter estimates of model are mostly significan. There is no peak in ACF and PACF residual plot except in the PACF plot of standard residual has peak at 12 lag. The qq-plot suggests the data is skewed at the right side.

(e) Estimate a TGARCH(m, s) model, again perform model checking. What does this model tell us about the effects of negative vs positive shocks?

In TGARCH model dealta is equal to 1.

Tgarch11<-garchFit(~arma(4,4)+ garch(1,1), data = dl.microsoft_close, delta = 1, trace=FALSE, leverage = TRUE,  cond.dist="sstd")
## Warning in arima(.series$x, order = c(u, 0, v), include.mean =
## include.mean): possible convergence problem: optim gave code = 1
summary(Tgarch11)
## 
## Title:
##  GARCH Modelling 
## 
## Call:
##  garchFit(formula = ~arma(4, 4) + garch(1, 1), data = dl.microsoft_close, 
##     delta = 1, cond.dist = "sstd", leverage = TRUE, trace = FALSE) 
## 
## Mean and Variance Equation:
##  data ~ arma(4, 4) + garch(1, 1)
## <environment: 0x0000000011e43580>
##  [data = dl.microsoft_close]
## 
## Conditional Distribution:
##  sstd 
## 
## Coefficient(s):
##          mu          ar1          ar2          ar3          ar4  
## -7.6564e-05  -3.5884e-01  -4.3180e-02   3.9578e-01   8.5424e-01  
##         ma1          ma2          ma3          ma4        omega  
##  3.5020e-01   3.2243e-02  -4.0004e-01  -8.6685e-01   9.0936e-05  
##      alpha1       gamma1        beta1         skew        shape  
##  6.7544e-02   3.0112e-01   9.4621e-01   9.1519e-01   4.8053e+00  
## 
## Std. Errors:
##  based on Hessian 
## 
## Error Analysis:
##          Estimate  Std. Error  t value Pr(>|t|)    
## mu     -7.656e-05   8.337e-05   -0.918 0.358420    
## ar1    -3.588e-01   9.151e-02   -3.921 8.80e-05 ***
## ar2    -4.318e-02   4.157e-02   -1.039 0.298943    
## ar3     3.958e-01   7.076e-02    5.594 2.23e-08 ***
## ar4     8.542e-01   5.908e-02   14.459  < 2e-16 ***
## ma1     3.502e-01   8.775e-02    3.991 6.58e-05 ***
## ma2     3.224e-02   4.054e-02    0.795 0.426376    
## ma3    -4.000e-01   6.656e-02   -6.010 1.85e-09 ***
## ma4    -8.668e-01   5.889e-02  -14.720  < 2e-16 ***
## omega   9.094e-05   3.826e-05    2.377 0.017460 *  
## alpha1  6.754e-02   9.773e-03    6.912 4.79e-12 ***
## gamma1  3.011e-01   8.910e-02    3.380 0.000726 ***
## beta1   9.462e-01   8.318e-03  113.751  < 2e-16 ***
## skew    9.152e-01   2.025e-02   45.187  < 2e-16 ***
## shape   4.805e+00   3.527e-01   13.623  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Log Likelihood:
##  10969.88    normalized:  2.743155 
## 
## Description:
##  Tue Mar 22 23:37:51 2016 by user: kluitel 
## 
## 
## Standardised Residuals Tests:
##                                 Statistic p-Value  
##  Jarque-Bera Test   R    Chi^2  33452.5   0        
##  Shapiro-Wilk Test  R    W      0.9133639 0        
##  Ljung-Box Test     R    Q(10)  12.09046  0.2790481
##  Ljung-Box Test     R    Q(15)  21.97301  0.1085135
##  Ljung-Box Test     R    Q(20)  24.32253  0.228587 
##  Ljung-Box Test     R^2  Q(10)  172.1581  0        
##  Ljung-Box Test     R^2  Q(15)  174.0975  0        
##  Ljung-Box Test     R^2  Q(20)  174.8971  0        
##  LM Arch Test       R    TR^2   4.743178  0.9660115
## 
## Information Criterion Statistics:
##       AIC       BIC       SIC      HQIC 
## -5.478808 -5.455201 -5.478836 -5.470440
Tgarch11_res<-Tgarch11@residuals/Tgarch11@sigma.t
Tgarch11_res2<-(Tgarch11@residuals/Tgarch11@sigma.t)^2

#  standardized residuals 
par(mfcol=c(2,2)) 
  acf(Tgarch11_res,  na.action = na.exclude,  main="ACF for standardized residuals" )
  pacf( Tgarch11_res, na.action = na.exclude, main="PACF for standardized residuals" ) 

  # squared standardized residuals
  acf( Tgarch11_res2 , na.action = na.exclude,  main="ACF for Squared standardized residuals")
  pacf( Tgarch11_res2, na.action = na.exclude,  main="PACF for Squared standardized residuals" )

par (mfcol=c(1,1)) 

plot(Tgarch11, which= 13)

plot(Tgarch11, which= 3)# series y with +/- 2*sigma superimposed

plot(Tgarch11, which= 9)# standardized residuals

The parameter estimates of model are mostly significan at 10% level. The Ljung BOx-Test for square of teh residual test for Q(10), Q(15),and Q(20) p-value is significant. In PACF plot of standard residual there is peak at 11 lag. In lag 4 there is peak in both ACF and PACF of the square residual plot.

The qq-plot suggests the data is more skewed at the right side. The plot of series y with +/- 2*sigma superimposed and standardized residuals suggests the positive and negative shocks have same effects on volatility

(f) Create a summary table using stargazerX showing the models side by side.

stargazer(arma_4_4,arch_8,garch11,Tgarch11,align=TRUE,column.sep.width="0pt", report="vc*", single.row=TRUE, header=FALSE,model.numbers=FALSE,dep.var.caption="", dep.var.labels="Microsoft Daily Returns",column.labels=c("ARMA(1,1)","ARCH(8)","GARCH(1,1)","TGARCH(1,1)"))
## 
## Call:
## arima(x = dl.microsoft_close, order = c(4, 0, 4))
## 
## Coefficients:
##          ar1      ar2     ar3      ar4      ma1     ma2      ma3      ma4
##       0.1326  -0.3941  0.2365  -0.0059  -0.1608  0.3564  -0.2493  -0.0538
## s.e.     NaN      NaN  0.1389   0.0531      NaN     NaN   0.0969   0.0491
##       intercept
##          -1e-04
## s.e.      3e-04
## 
## sigma^2 estimated as 0.0003754:  log likelihood = 10096.52,  aic = -20173.04
## 
## Training set error measures:
##                         ME       RMSE       MAE MPE MAPE      MASE
## Training set -9.590539e-06 0.01937634 0.0130522 NaN  Inf 0.6812664
##                      ACF1
## Training set -0.001652477
## 
## \begin{table}[!htbp] \centering 
##   \caption{} 
##   \label{} 
## \begin{tabular}{@{\extracolsep{0pt}}lD{.}{.}{-3} D{.}{.}{-3} D{.}{.}{-3} D{.}{.}{-3} } 
## \\[-1.8ex]\hline 
## \hline \\[-1.8ex] 
## \\[-1.8ex] & \multicolumn{4}{c}{Microsoft Daily Returns} \\ 
## \\[-1.8ex] & \multicolumn{1}{c}{\textit{ARIMA}} & \multicolumn{3}{c}{\textit{GARCH}} \\ 
##  & \multicolumn{1}{c}{ARMA(1,1)} & \multicolumn{1}{c}{ARCH(8)} & \multicolumn{1}{c}{GARCH(1,1)} & \multicolumn{1}{c}{TGARCH(1,1)} \\ 
## \hline \\[-1.8ex] 
##  mu &  & -0.0005^{*} & -0.001 & -0.0001 \\ 
##   ar1 & 0.133 & 0.969^{***} & -0.602^{***} & -0.359^{***} \\ 
##   ar2 & -0.394 & -0.138 & -0.364^{**} & -0.043 \\ 
##   ar3 & 0.237^{*} & -0.267 & 0.076 & 0.396^{***} \\ 
##   ar4 & -0.006 & -0.207 & 0.632^{***} & 0.854^{***} \\ 
##   ma1 & -0.161 & -1.000^{***} & 0.577^{***} & 0.350^{***} \\ 
##   ma2 & 0.356 & 0.165 & 0.327^{**} & 0.032 \\ 
##   ma3 & -0.249^{**} & 0.303 & -0.105 & -0.400^{***} \\ 
##   ma4 & -0.054 & 0.156 & -0.662^{***} & -0.867^{***} \\ 
##   intercept & -0.0001 &  &  &  \\ 
##   omega &  & 0.0001^{***} & 0.00000^{***} & 0.0001^{**} \\ 
##   alpha1 &  & 0.192^{***} & 0.072^{***} & 0.068^{***} \\ 
##   alpha2 &  & 0.118^{***} &  &  \\ 
##   alpha3 &  & 0.117^{***} &  &  \\ 
##   alpha4 &  & 0.145^{***} &  &  \\ 
##   alpha5 &  & 0.074^{***} &  &  \\ 
##   alpha6 &  & 0.084^{***} &  &  \\ 
##   alpha7 &  & 0.096^{***} &  &  \\ 
##   alpha8 &  & 0.068^{***} &  &  \\ 
##   gamma1 &  &  &  & 0.301^{***} \\ 
##   beta1 &  &  & 0.924^{***} & 0.946^{***} \\ 
##   skew &  &  & 0.929^{***} & 0.915^{***} \\ 
##   shape &  &  & 4.523^{***} & 4.805^{***} \\ 
##  \hline \\[-1.8ex] 
## Observations & \multicolumn{1}{c}{3,999} & \multicolumn{1}{c}{3,999} & \multicolumn{1}{c}{3,999} & \multicolumn{1}{c}{3,999} \\ 
## Log Likelihood & \multicolumn{1}{c}{10,096.520} & \multicolumn{1}{c}{-10,671.020} & \multicolumn{1}{c}{-10,938.850} & \multicolumn{1}{c}{-10,969.880} \\ 
## $\sigma^{2}$ & \multicolumn{1}{c}{0.0004} &  &  &  \\ 
## Akaike Inf. Crit. & \multicolumn{1}{c}{-20,173.040} & \multicolumn{1}{c}{-5.328} & \multicolumn{1}{c}{-5.464} & \multicolumn{1}{c}{-5.479} \\ 
## Bayesian Inf. Crit. &  & \multicolumn{1}{c}{-5.300} & \multicolumn{1}{c}{-5.442} & \multicolumn{1}{c}{-5.455} \\ 
## \hline 
## \hline \\[-1.8ex] 
## \textit{Note:}  & \multicolumn{4}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ 
## \end{tabular} 
## \end{table}

(g) Reestimate the best model from (a)-(e) using rugarch package. Create and plot 100 rolling 1 day ahead forecasts

re_model_spec <- ugarchspec(mean.model=list(armaOrder=c(4,4), archm=TRUE, archpow=2, include.mean=TRUE),
variance.model=list(model="sGARCH", garchOrder=c(1,1)))
re_model_spec
## 
## *---------------------------------*
## *       GARCH Model Spec          *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## ------------------------------------
## GARCH Model      : sGARCH(1,1)
## Variance Targeting   : FALSE 
## 
## Conditional Mean Dynamics
## ------------------------------------
## Mean Model       : ARFIMA(4,0,4)
## Include Mean     : TRUE 
## GARCH-in-Mean        : TRUE 
## 
## Conditional Distribution
## ------------------------------------
## Distribution :  norm 
## Includes Skew    :  FALSE 
## Includes Shape   :  FALSE 
## Includes Lambda  :  FALSE
re_model <- ugarchfit(data=dl.microsoft_close, spec=re_model_spec, out.sample=200)
re_model
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(4,0,4)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error   t value Pr(>|t|)
## mu     -0.001159    0.000331 -3.503513 0.000459
## ar1     0.998218    0.377134  2.646855 0.008124
## ar2    -0.021385    0.384726 -0.055586 0.955672
## ar3    -0.343943    0.363359 -0.946566 0.343860
## ar4    -0.117405    0.350843 -0.334636 0.737900
## ma1    -1.034100    0.378842 -2.729634 0.006340
## ma2     0.054028    0.388679  0.139004 0.889447
## ma3     0.377676    0.363384  1.039329 0.298652
## ma4     0.048616    0.344056  0.141302 0.887631
## archm   2.739474    1.178752  2.324046 0.020123
## omega   0.000012    0.000001 15.908190 0.000000
## alpha1  0.148011    0.006777 21.838754 0.000000
## beta1   0.826811    0.010524 78.563412 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error   t value Pr(>|t|)
## mu     -0.001159    0.000389 -2.976987 0.002911
## ar1     0.998218    0.624798  1.597666 0.110117
## ar2    -0.021385    0.486650 -0.043944 0.964949
## ar3    -0.343943    0.436681 -0.787631 0.430913
## ar4    -0.117405    0.587893 -0.199704 0.841712
## ma1    -1.034100    0.626498 -1.650605 0.098819
## ma2     0.054028    0.487139  0.110909 0.911689
## ma3     0.377676    0.426412  0.885707 0.375775
## ma4     0.048616    0.574042  0.084690 0.932508
## archm   2.739474    1.128350  2.427858 0.015188
## omega   0.000012    0.000002  6.923694 0.000000
## alpha1  0.148011    0.015099  9.802975 0.000000
## beta1   0.826811    0.016746 49.374869 0.000000
## 
## LogLikelihood : 10281.66 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -5.4060
## Bayes        -5.3846
## Shibata      -5.4060
## Hannan-Quinn -5.3984
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.1438  0.7046
## Lag[2*(p+q)+(p+q)-1][23]    6.2122  1.0000
## Lag[4*(p+q)+(p+q)-1][39]   16.0648  0.8884
## d.o.f=8
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.4409  0.5067
## Lag[2*(p+q)+(p+q)-1][5]    2.2596  0.5585
## Lag[4*(p+q)+(p+q)-1][9]    3.3349  0.7026
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.1855 0.500 2.000  0.6667
## ARCH Lag[5]    1.1439 1.440 1.667  0.6908
## ARCH Lag[7]    1.5234 2.315 1.543  0.8167
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  20.3802
## Individual Statistics:              
## mu     0.09248
## ar1    0.20516
## ar2    0.53657
## ar3    0.33501
## ar4    0.14497
## ma1    0.14367
## ma2    0.51698
## ma3    0.34966
## ma4    0.16415
## archm  0.04318
## omega  3.04198
## alpha1 0.10461
## beta1  0.11251
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value   prob sig
## Sign Bias           0.3004 0.7639    
## Negative Sign Bias  0.2703 0.7869    
## Positive Sign Bias  0.2255 0.8216    
## Joint Effect        0.1310 0.9879    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     169.8    3.055e-26
## 2    30     182.2    3.926e-24
## 3    40     190.9    6.742e-22
## 4    50     209.7    9.130e-22
## 
## 
## Elapsed time : 4.29943
re_model.fcst <- ugarchforecast(re_model, n.ahead=10, n.roll=100)
plot(re_model.fcst, which="all")

The trend of forecast is on average same as the real value for the 100 rolling 1 day ahead.