y <- rnorm(100,10,3)
ces(y,h=20,holdout=TRUE)
ces(y,h=20,holdout=FALSE)
y <- 500 - c(1:100)*0.5 + rnorm(100,10,3)
ces(y,h=20,holdout=TRUE,intervals=TRUE,bounds="a")
library("Mcomp")
y <- ts(c(M3$N0740$x,M3$N0740$xx),start=start(M3$N0740$x),frequency=frequency(M3$N0740$x))
ces(y,h=8,holdout=TRUE,seasonality="s",intervals=TRUE,level=0.8)
## Not run: y <- ts(c(M3$N1683$x,M3$N1683$xx),start=start(M3$N1683$x),frequency=frequency(M3$N1683$x))
# ces(y,h=18,holdout=TRUE,seasonality="s",intervals=TRUE)
# ces(y,h=18,holdout=TRUE,seasonality="p",intervals=TRUE)
# ces(y,h=18,holdout=TRUE,seasonality="f",intervals=TRUE)## End(Not run)
## Not run: x <- cbind(c(rep(0,25),1,rep(0,43)),c(rep(0,10),1,rep(0,58)))
# ces(ts(c(M3$N1457$x,M3$N1457$xx),frequency=12),h=18,holdout=TRUE,
# intervals=TRUE,xreg=x,cfType="MSTFE")## End(Not run)
# Exogenous variables in CES
## Not run: x <- cbind(c(rep(0,25),1,rep(0,43)),c(rep(0,10),1,rep(0,58)))
# ces(ts(c(M3$N1457$x,M3$N1457$xx),frequency=12),h=18,holdout=TRUE,xreg=x)
# test <- ces(ts(c(M3$N1457$x,M3$N1457$xx),frequency=12),h=18,holdout=TRUE,xreg=x,updateX=TRUE)
# # This will be the same model as in previous line but estimated on new portion of data
# ces(ts(c(M3$N1457$x,M3$N1457$xx),frequency=12),model=test,h=18,holdout=FALSE)## End(Not run)
# Intermittent data example
x <- rpois(100,0.2)
# Best type of intermittent model based on iETS(Z,Z,N)
test <- ces(x,intermittent="auto")
summary(test)
forecast(test)
plot(forecast(test))
Run the code above in your browser using DataLab