# NOT RUN {
# ARIMA(1,1,1) fitted to some data
ourModel <- ssarima(rnorm(118,100,3),orders=list(ar=c(1),i=c(1),ma=c(1)),lags=c(1),h=18,
holdout=TRUE,intervals="p")
# The previous one is equivalent to:
# }
# NOT RUN {
ourModel <- ssarima(rnorm(118,100,3),ar.orders=c(1),i.orders=c(1),ma.orders=c(1),lags=c(1),h=18,
holdout=TRUE,intervals="p")
# }
# NOT RUN {
# Model with the same lags and orders, applied to a different data
ssarima(rnorm(118,100,3),orders=orders(ourModel),lags=lags(ourModel),h=18,holdout=TRUE)
# The same model applied to a different data
ssarima(rnorm(118,100,3),model=ourModel,h=18,holdout=TRUE)
# Example of SARIMA(2,0,0)(1,0,0)[4]
# }
# NOT RUN {
ssarima(rnorm(118,100,3),orders=list(ar=c(2,1)),lags=c(1,4),h=18,holdout=TRUE)
# }
# NOT RUN {
# SARIMA(1,1,1)(0,0,1)[4] with different initialisations
# }
# NOT RUN {
ssarima(rnorm(118,100,3),orders=list(ar=c(1),i=c(1),ma=c(1,1)),
lags=c(1,4),h=18,holdout=TRUE)
ssarima(rnorm(118,100,3),orders=list(ar=c(1),i=c(1),ma=c(1,1)),
lags=c(1,4),h=18,holdout=TRUE,initial="o")
# }
# NOT RUN {
# SARIMA of a peculiar order on AirPassengers data
# }
# NOT RUN {
ssarima(AirPassengers,orders=list(ar=c(1,0,3),i=c(1,0,1),ma=c(0,1,2)),lags=c(1,6,12),
h=10,holdout=TRUE)
# }
# NOT RUN {
# ARIMA(1,1,1) with Mean Squared Trace Forecast Error
# }
# NOT RUN {
ssarima(rnorm(118,100,3),orders=list(ar=1,i=1,ma=1),lags=1,h=18,holdout=TRUE,cfType="TMSE")
ssarima(rnorm(118,100,3),orders=list(ar=1,i=1,ma=1),lags=1,h=18,holdout=TRUE,cfType="aTMSE")
# }
# NOT RUN {
# SARIMA(0,1,1) with exogenous variables
ssarima(rnorm(118,100,3),orders=list(i=1,ma=1),h=18,holdout=TRUE,xreg=c(1:118))
# SARIMA(0,1,1) with exogenous variables with crazy estimation of xreg
# }
# NOT RUN {
ourModel <- ssarima(rnorm(118,100,3),orders=list(i=1,ma=1),h=18,holdout=TRUE,
xreg=c(1:118),updateX=TRUE)
# }
# NOT RUN {
summary(ourModel)
forecast(ourModel)
plot(forecast(ourModel))
# }
Run the code above in your browser using DataLab