19.3 Cheat sheet for adam() function
This Chapter summarises the main ways of using adam()
in R with references to the chapters and sections, where specific elements were discussed.
Estimate the best ETS model for the provided data (Section 15.1):
<- adam(y) ourModel
The best ETS, taking the last 10 observations of time series as a holdout to test the performance of model:
<- adam(y, h=10, holdout=TRUE) ourModel
Build a pure multiplicative seasonal ETS with an arbitrary seasonal lag of 7 (can be applied to an object y
of any class, including ts
, vector
, matrix
, zoo
, tibble
etc):
<- adam(y, model="YYM", lags=7) ourModel
Estimate the best ARIMA model for the provided data (assuming seasonal lag of 7, Section 15.2):
<- adam(y, model="NNN", lags=7,
ourModel orders=list(ar=c(3,2),
i=c(2,1),
ma=c(3,2),
select=TRUE))
Build ARIMA(0,1,1) with drift (Chapter 8 for the general ARIMA and Section 8.1.4 for the one with constant):
<- adam(y, model="NNN",
ourModel orders=c(0,1,1), constant=TRUE)
Estimate ETS(A,N,N)+ARIMA(1,0,0) model (Sections 8.4 and 9.4):
<- adam(y, model="ANN", orders=c(1,0,0)) ourModel
Use Generalised Normal distribution for the residuals of ADAM ETS(A,A,N) (Sections 5.5, 6.5 and 11.1):
<- adam(y, model="AAN", distribution="dgnorm") ourModel
Select the best distribution for the specific ADAM ETS(A,A,N) (Chapter 15):
<- auto.adam(y, model="AAN") ourModel
Select the most appropriate ETSX model for the provided data
(which can be any 2-dimensional object, such as matrix
, data.frame
or tibble
, see Chapter 10):
<- adam(data) ourModel
Specify, which explanatory variables to include and in what form (Section 10.1):
<- adam(data, formula=y~x1+x2+I(x2^2)) ourModel
Select the set of explanatory variables for ETSX(M,N,N) based on AIC (Section 15.3):
<- adam(data, model="MNN",
ourModel regressors="select", ic="AIC")
Estimate ETS(A,Ad,N) model using a multistep loss function, GTMSE (Section 11.3):
<- adam(y, model="AAdN",
ourModel h=10, loss="GTMSE")
Estimate ARIMA(1,1,2) using a multistep loss function (Section 11.3) with backcasting of initials (Section 11.4):
<- adam(y, model="NNN", orders=c(1,1,2),
ourModel h=10, loss="GTMSE", initial="backcasting")
Select and estimate the most appropriate ETS model on the data with multiple frequencies (Chapter 12):
<- adam(y, model="ZXZ", lags=c(24,24*7,24*365)) ourModel
Select and estimate the triple seasonal ARIMA on the data with multiple frequencies (Chapter 12):
<- adam(y, model="NNN", lags=c(1,24,24*7,24*365),
ourModel orders=list(ar=c(3,2,2,2),
i=c(2,1,1,1),
ma=c(3,2,2,2),
select=TRUE),
initial="backcasting")
Apply an automatically selected occurrence part of the model to intermittent data (Section 13.1):
<- oes(y, model="YYY", occurrence="auto") oesModel
Use the estimated occurrence model in adam()
to model intermittent data (Section 13.2):
<- adam(y, model="YYY", occurrence=oesModel) ourModel
Or alternatively just use the same model for occurrence and demand sizes part (Chapter 13):
<- adam(y, model="YYY", occurrence="auto") ourModel
Estimate the scale model for previously estimated ADAM (Chapter 17):
<- sm(ourModel, model="YYY") scaleModel
Implant the scale model into the ADAM for future use (e.g. for forecasting):
<- implant(ourModel, scaleModel) mergedModel
Produce diagnostics plots to see if the ADAM can be improved any further (Chapter 14):
par(mfcol=c(2,2))
plot(ourModel, which=c(1,2,4,6))
Extract conventional, standardised and studentised residuals (Chapter 14):
residuals(ourModel)
rstandard(ourModel)
rstudent(ourModel)
Plot time series decomposition according to ADAM ETS (Section 4.1):
plot(ourModel, which=12)
Produce point forecast and prediction interval from ADAM for 10 steps ahead (Chapter 18):
forecast(ourModel, h=10, interval="prediction")
Produce point forecast and prediction interval for ADAM, cumulative over the lead time of 10 (Subsection 18.4.3):
forecast(ourModel, h=10, interval="prediction",
cumulative=TRUE)
Produce point forecast and empirical prediction interval for upper bound (upper quantile of distribution, Sections 18.3.5 and 18.4.2):
forecast(ourModel, h=10, interval="empirical",
side="upper")
Produce summary of ADAM (Chapter 16):
summary(ourModel)
Reapply ADAM with randomly selected initials and parameters (to capture the uncertainty of parameters) and produce forecasts from each of these models (Section 16.5):
reapply(ourModel)
reforecast(ourModel, h=10, interval="prediction")
Extract multistep forecast errors from ADAM (Subsection 14.7.3):
rmultistep(ourModel, h=10)
Extract covariance matrix of multistep forecast errors from ADAM (Section 11.3):
multicov(ourModel, h=10)
Extract actual and fitted values from ADAM:
actuals(ourModel)
fitted(ourModel)