# 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)
# Redo previous model on a new data and produce prediction intervals
## Not run: ges(rnorm(118,100,3),model=ourModel,h=18,intervals="sp")
# 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")
# 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="MSTFE")
# ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,bounds="n",cfType="aMSTFE")
## ---------------------------------------------
# Introduce exogenous variables
## Not run: ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,xreg=c(1:118))
# 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)
# 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="MSTFE")
# ourModel <- ges(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,cfType="aMSTFE")
## ---------------------------------------------
# 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))
## ---------------------------------------------
Run the code above in your browser using DataLab