R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

 y5.adf.nc.2
## 
## ############################################################### 
## # Augmented Dickey-Fuller Test Unit Root / Cointegration Test # 
## ############################################################### 
## 
## The value of the test statistic is: -0.5779 1.0282 1.4516
 summary(y5.adf.nc.2)@testreg$coef 
##                  Estimate   Std. Error    t value  Pr(>|t|)
## (Intercept)  8.919711e-04 7.820973e-04  1.1404861 0.2552498
## z.lag.1     -5.520094e-03 9.552198e-03 -0.5778873 0.5638959
## tt          -8.762567e-06 5.662198e-06 -1.5475556 0.1230807
## z.diff.lag   3.582966e-02 6.555305e-02  0.5465750 0.5851916
 y5.adf.nc.2@testreg$coefficients[2,3]
## [1] -0.5778873

Forecast GRIP with information {\(GRIP_{t-j}\),\(GRCLI_{t-j}\), \(j\)=3,4,5…}

1. Item 1
2. Item 2
3. Item 3
    + Item 3a
    + Item 3b

* Item 1
* Item 2
    + Item 2a
    + Item 2b
library(lmtest)
bgtest(GRIP~lag(GRIP,3),order=3)
## 
##  Breusch-Godfrey test for serial correlation of order up to 3
## 
## data:  GRIP ~ lag(GRIP, 3)
## LM test = 1.9032, df = 3, p-value = 0.5927
bgtest(GRIP~lag(GRIP,3)+lag(GRIP,4)+lag(GRIP,5)+lag(GRIP,6)
                           +lag(GRIP,7)+lag(GRIP,8)+lag(GRIP,9)+lag(GRIP,10)
                           +lag(GRIP,11)+lag(GRIP,12),order=3)
## 
##  Breusch-Godfrey test for serial correlation of order up to 3
## 
## data:  GRIP ~ lag(GRIP, 3) + lag(GRIP, 4) + lag(GRIP, 5) + lag(GRIP,     6) + lag(GRIP, 7) + lag(GRIP, 8) + lag(GRIP, 9) + lag(GRIP,     10) + lag(GRIP, 11) + lag(GRIP, 12)
## LM test = 1.9032, df = 3, p-value = 0.5927
plot(res03[-(229:237)],res12,xlab="residual model lag3",
       ylab="resid model lag 3-12",main="AR model for GRIP",col=c("red","blue")) #lec 6.5,slide 8/15

par(mfrow=c(1,2))
plot(GRIP[-(229:240)],res12,xlab="GRIP", ylab="RES LAG3-12",main="GRIP vs RES LAG 3-12")
plot(GRIP[-(238:240)],res03,xlab="GRIP", ylab="RES LAG3",main="GRIP vs RES LAG 3")

\(GRIP_t\)=0.0017+0.247\(GRIP_{t-3}\)+\(\epsilon_t\) (\(t_b\)=3.9,\(R^2\)=0.061)

ADL model for GRIP

GRC<-estSample$GRCLI
GRCLI<-ts(GRC)
regADL<-lm(formula=dyn(GRIP~lag(GRIP,3)+lag(GRCLI,6)))