Wrapper of om that fits an occurrence (probability) ETS
model to a univariate intermittent time series. ARIMA components, ARMA
parameters, and explanatory-variable formulas are disabled (orders,
arma, formula are all forced to NULL); use
om directly if those features are needed.
oes(y, model = "MNN", lags = c(frequency(y)), persistence = NULL,
phi = NULL, initial = c("backcasting", "optimal", "two-stage",
"complete", "gradient"), occurrence = c("auto", "fixed", "odds-ratio",
"inverse-odds-ratio", "direct", "general"), ic = c("AICc", "AIC", "BIC",
"BICc"), h = 0, holdout = FALSE, bounds = c("usual", "admissible",
"none"), ets = c("conventional", "adam"), smoother = c("default", "ma",
"lowess", "supsmu", "global"), xreg = NULL, regressors = c("use",
"select"), silent = TRUE, ...)An object of class c("om","adam","smooth").
Univariate numeric vector or time-series. Non-binary input is binarised (any non-zero value becomes 1).
Three-letter ETS specification (e.g. "MNN",
"AAdN"). Wildcards "Z"/"X"/"Y" trigger
automatic selection.
Vector of seasonal lags. Defaults to frequency(y).
Optional persistence (smoothing) parameter vector.
Optional damping parameter. Only used for damped-trend models.
Initialisation method: "backcasting",
"optimal", "two-stage", or "complete".
Type of link function mapping the state to a
probability: "fixed", "odds-ratio",
"inverse-odds-ratio", or "direct".
Information criterion for model selection.
Forecast horizon.
If TRUE, a holdout sample of size h is
withheld.
Parameter bounds type.
Type of ETS model: "conventional" or "adam".
The smoother used by msdecompose to obtain the
initial level, trend and seasonal indices (and the seasonal profiles for
multiple seasonal models). "default" (the default) uses "ma" for
initial="optimal" and "global" otherwise; "ma",
"lowess", "supsmu" and "global" force the respective smoother.
Optional numeric vector or matrix of exogenous regressors, aligned
with y. Merged with y into a multi-column data matrix before
being passed to om.
How to handle regressors: "use" or "select".
If TRUE, suppresses output and plot.
Additional arguments forwarded to om (e.g.
maxeval, xtol_rel, algorithm, print_level).
This is the analogue of es for occurrence models: a lightweight ETS-only entry point that delegates the heavy lifting to om.
om, es
set.seed(42)
y <- rbinom(120, 1, 0.6)
m <- oes(y, model="MNN", occurrence="odds-ratio")
forecast(m, h=12)
Run the code above in your browser using DataLab