# NOT RUN {
# Something simple:
ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,bounds="a",intervals="p")
# A more complicated model with seasonality
# }
# NOT RUN {
ourModel <- ges(rnorm(118,100,3),orders=c(2,1),lags=c(1,4),h=18,holdout=TRUE)
# }
# NOT RUN {
# Redo previous model on a new data and produce prediction intervals
# }
# NOT RUN {
ges(rnorm(118,100,3),model=ourModel,h=18,intervals="sp")
# }
# NOT RUN {
# Produce something crazy with optimal initials (not recommended)
# }
# NOT RUN {
ges(rnorm(118,100,3),orders=c(1,1,1),lags=c(1,3,5),h=18,holdout=TRUE,initial="o")
# }
# NOT RUN {
# Simpler model estiamted using trace forecast error cost function and its analytical analogue
# }
# NOT RUN {
ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,bounds="n",cfType="TMSE")
ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,bounds="n",cfType="aTMSE")
# }
# NOT RUN {
# Introduce exogenous variables
# }
# NOT RUN {
ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,xreg=c(1:118))
# }
# NOT RUN {
# Ask for their update
# }
# NOT RUN {
ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,xreg=c(1:118),updateX=TRUE)
# }
# NOT RUN {
# Do the same but now let's shrink parameters...
# }
# NOT RUN {
ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,xreg=c(1:118),updateX=TRUE,cfType="TMSE")
ourModel <- ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,cfType="aTMSE")
# }
# NOT RUN {
# Or select the most appropriate one
# }
# NOT RUN {
ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,xreg=c(1:118),xregDo="s")
summary(ourModel)
forecast(ourModel)
plot(forecast(ourModel))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab