Learn R Programming

smooth (version 4.5.2)

oes: Occurrence ETS model

Description

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.

Usage

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, ...)

Value

An object of class c("om","adam","smooth").

Arguments

y

Univariate numeric vector or time-series. Non-binary input is binarised (any non-zero value becomes 1).

model

Three-letter ETS specification (e.g. "MNN", "AAdN"). Wildcards "Z"/"X"/"Y" trigger automatic selection.

lags

Vector of seasonal lags. Defaults to frequency(y).

persistence

Optional persistence (smoothing) parameter vector.

phi

Optional damping parameter. Only used for damped-trend models.

initial

Initialisation method: "backcasting", "optimal", "two-stage", or "complete".

occurrence

Type of link function mapping the state to a probability: "fixed", "odds-ratio", "inverse-odds-ratio", or "direct".

ic

Information criterion for model selection.

h

Forecast horizon.

holdout

If TRUE, a holdout sample of size h is withheld.

bounds

Parameter bounds type.

ets

Type of ETS model: "conventional" or "adam".

smoother

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.

xreg

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.

regressors

How to handle regressors: "use" or "select".

silent

If TRUE, suppresses output and plot.

...

Additional arguments forwarded to om (e.g. maxeval, xtol_rel, algorithm, print_level).

Details

This is the analogue of es for occurrence models: a lightweight ETS-only entry point that delegates the heavy lifting to om.

See Also

om, es

Examples

Run this code
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