library(forecast)
mg <- read.csv("/home/readejj/Dropbox/Teaching/Reading/ec313/2015/Lecture-7/mortgages_280115.csv",stringsAsFactors=F)
mg.t <- ts(mg$LPMVTVX[is.na(mg$LPMVTVX)==F],start=c(1993,4),freq=12)
mg.t.arima <- auto.arima(mg.t)
mg.t.ets <- ets(mg.t)
mg.t.arima.f <- forecast(mg.t.arima,h=1)
plot(mg.t.arima.f)
dave27 <- read.csv("Dave_270115.csv",stringsAsFactors=F)
dave27$Week <- as.Date(substr(dave27$Week,1,10))
plot(dave27$Week,dave27$david.cameron,
main="Google Search Popularity of David Cameron",
ylab="Search popularity",xlab="Date",type="l",ylim=range(0,20))
dave27.ts <- ts(dave27$david.cameron,start=c(2004,1),freq=52)
tsdisplay(dave27.ts)
dave27.arima <- auto.arima(dave27.ts)
dave27.forc <- forecast(dave27.arima,h=9)
plot(dave27.forc,include=100)
dave27.forc$mean
## Time Series:
## Start = c(2015, 7)
## End = c(2015, 15)
## Frequency = 52
## [1] 4.979808 4.971005 4.967168 4.965495 4.964765 4.964447 4.964309 4.964248
## [9] 4.964222
dave03 <- read.csv("Dave_030215.csv",stringsAsFactors=F)
tail(dave03,1)
## Week david.cameron
## 579 2015-02-01 - 2015-02-07 6
ftse <- Quandl("YAHOO/INDEX_FTSE")
ftse <- ftse[order(ftse$Date),]
ftse.0 <- ftse[ftse$Date<as.Date("2015-01-30"),]
ftse.auto <- auto.arima(ftse$Close)
ftse.forc <- forecast(ftse.auto,h=50)
plot(ftse.forc,include=100)
ftse.forc$mean[seq(1,45,5)]
## [1] 6787.733 6790.772 6794.285 6797.858 6801.430 6805.003 6808.576 6812.148
## [9] 6815.721
ftse[ftse$Date==as.Date("2015-01-30"),]
## Date Open High Low Close Volume Adjusted Close
## 2 2015-01-30 6810.6 6844 6749.4 6749.4 799357300 6749.4
trade <- read.csv("trade_030215.csv",stringsAsFactors=F)
trade$date <- as.Date(substr(trade$DateTime,1,8),"%Y%m%d")
plot(trade$date,trade$Actual,type="o",ylab="Total Trade Balance (£)",xlab="Date")
\[ \begin{align} y_{t+h\cond{t}} &= \ell_{t} + hb_{t} + s_{t-m+h_m^+} \\ \ell_{t} &= \alpha(y_{t} - s_{t-m}) + (1 - \alpha)(\ell_{t-1} + b_{t-1})\\ b_{t} &= \beta^*(\ell_{t} - \ell_{t-1}) + (1 - \beta^*)b_{t-1}\\ s_{t} &= \gamma (y_{t}-\ell_{t-1}-b_{t-1}) + (1-\gamma)s_{t-m}, \end{align} \] - Here, \(h_m^+=\lfloor(h-1)\mod~m\rfloor+1\). + Notation \(\lfloor u \rfloor\) means largest integer not greater than \(u\).} + Ensures seasonal component for forecast comes only from final year of sample. - Error correction form: \[ \begin{align} \ell_{t} &= \ell_{t-1} + b_{t-1}+\alpha e_{t}\\ b_{t} &= b_{t-1} + \alpha\beta^*e_{t}\\ s_{t} &= s_{t-m}+\gamma e_t, \end{align} \] - Here, \(e_t=y_{t} - (\ell_{t-1} + b_{t-1}+s_{t-m})=y_{t} - \pred{y}{t}{t-1}\).
Detail the steps involved in constructing a forecast using an ARIMA(1,1,1) model.
Compare forecast errors from using a first order autoregressive model, and a random walk model. Under which circumstances would you choose one over the other?
Show that forecast errors are non-decreasing in the forecast horizon.
Describe the Augmented Dickey-Fuller test. How important would you describe its role in the forecasting process?
Describe the Simple Exponential Smoothing (SES) method. What is the forecast equation?
Describe the Classical Time Series Decomposition approach. Is it recommended?
List the sources of forecast uncertainty; which would you suggest is most important, and why?
Compare and contrast the stepwise and general-to-specific model selection strategies.
Why is it not necessarily the case that the best possible in-sample model provides the best out-of-sample forecasts?
`Judgemental forecasts are always and everywhere a bad thing’. Evaluate this statement.
`The best forecast model is the most parsimonious one’. Evaluate this statement.
Describe impulse saturation; what benefits and costs do you see from the procedure?