Learn R Programming

smooth (version 4.5.2)

om: Occurrence Model

Description

Function returns the occurrence part of the ADAM model with the specified probability update and model types.

Usage

om(data, model = "ZXZ", lags = c(frequency(data)), orders = list(ar =
  c(0), i = c(0), ma = c(0), select = FALSE), constant = FALSE,
  formula = NULL, regressors = c("use", "select", "adapt"),
  occurrence = c("auto", "fixed", "odds-ratio", "inverse-odds-ratio",
  "direct", "general"), loss = c("likelihood", "MSE", "MAE", "HAM", "LASSO",
  "RIDGE"), h = 0, holdout = FALSE, persistence = NULL, phi = NULL,
  initial = c("backcasting", "optimal", "two-stage", "complete", "gradient"),
  arma = NULL, ic = c("AICc", "AIC", "BIC", "BICc"), bounds = c("usual",
  "admissible", "none"), ets = c("conventional", "adam"),
  smoother = c("default", "ma", "lowess", "supsmu", "global"),
  silent = TRUE, ...)

Value

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

Arguments

data

Numeric vector, time series, or data frame. Non-binary input is automatically binarised: any non-zero value becomes 1.

model

Three-letter ETS specification such as "MNN" or "AAN". Automatic selection with "Z" / "X" / "Y" wildcards is supported.

lags

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

orders

ARIMA orders list: list(ar, i, ma, select).

constant

Logical; whether to include a constant term.

formula

Optional formula for external regressors.

regressors

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

occurrence

Type of link function mapping state to probability: "fixed" (constant), "odds-ratio", "inverse-odds-ratio", or "direct".

loss

Loss function: "likelihood" (Bernoulli) or "MSE".

h

Forecast horizon.

holdout

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

persistence

Optional persistence (smoothing) parameter vector.

phi

Optional damping parameter.

initial

Initialisation method: "backcasting", "optimal", "two-stage", "complete", or "gradient" (solves the initial states by profiling the occurrence loss; falls back to backcasting for a custom loss or an out-of-scope specification).

arma

Optional fixed ARMA parameters.

ic

Information criterion for model selection.

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.

silent

If TRUE, suppresses output and plot.

...

Additional arguments passed to the optimiser (maxeval, xtol_rel, algorithm, print_level).

Details

The function estimates probability of demand occurrence, using the selected ADAM state space model. It supports ETS, ARIMA and explanatory variables, also allowing to have multiple frequencies and doing variables selection. It is an ADAM analogue for the binary occurrence variable modelling.

For the details about the model and its implementation, see the respective vignette: vignette("om","smooth")

See Also

forecast.om, adam

Examples

Run this code
set.seed(42)
y <- rbinom(120, 1, 0.6)
m <- om(y, model="MNN", occurrence="odds-ratio")
forecast(m, h=12)

Run the code above in your browser using DataLab