om: Occurrence Model

View source: R/om.R

omR Documentation

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"),
  arma = NULL, ic = c("AICc", "AIC", "BIC", "BICc"), bounds = c("usual",
  "admissible", "none"), ets = c("conventional", "adam"), silent = TRUE,
  ...)

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", or "complete".

arma

Optional fixed ARMA parameters.

ic

Information criterion for model selection.

bounds

Parameter bounds type.

ets

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

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")

Value

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

See Also

forecast.om, adam

Examples

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


smooth documentation built on June 21, 2026, 9:06 a.m.