-
Notifications
You must be signed in to change notification settings - Fork 22
OES
oETS (occurrence ETS) models the probability of demand occurrence for intermittent time series data. It implements the occurrence part of the iETS (intermittent ETS) framework.
Note:
oes()is an ETS-only wrapper ofom(). It disables ARIMA, formula, and some advanced options, providing a lightweight interface for pure ETS occurrence models. For the full feature set (ARIMA, regressors, auto-selection), useom()in R or theOM/OMG/AutoOMclasses in Python — see OM.
Python: Use
OM,OMG, andAutoOM(see OM).
Note: iETS refers to the full model for demand sizes and demand occurrence. oETS refers to the occurrence part only.
Intermittent demand data contains many zero values, common in:
- Spare parts inventory
- Slow-moving items
- Event-based data
- Count data with rare occurrences
oETS models the probability of non-zero demand using ETS-style state-space models, which can then be combined with a demand sizes model for full intermittent demand forecasting.
The more details description of the models is provided in Svetunkov (2023), Chapter 13.
The general iETS model (iETS_G) is defined as:
y_t = o_t × z_t
o_t ~ Bernoulli(p_t)
p_t = μ_{a,t} / (μ_{a,t} + μ_{b,t})
Where:
-
y_t: Observed demand -
z_t: Demand size (modeled by a pure multiplicative ETS) -
o_t: Binary occurrence variable (1 = non-zero demand, 0 = no demand) -
p_t: Probability of non-zero demand -
μ_{a,t},μ_{b,t}: Conditional expectations of unobservable variablesa_tandb_t
Both a_t and b_t follow their own ETS models:
a_t = l_{a,t-1}(1 + ε_{a,t})
l_{a,t} = l_{a,t-1}(1 + α_a × ε_{a,t})
μ_{a,t} = l_{a,t-1}
And similarly for b_t.
Depending on restrictions on μ_{a,t} and μ_{b,t}, there are several iETS subtypes:
| Subtype | Code | Restriction | Description |
|---|---|---|---|
| oETS_F | "fixed" |
μ_a = const, μ_b = const | Fixed probability of occurrence |
| oETS_O | "odds-ratio" |
μ_b = 1 | Odds-ratio model (logistic transform) |
| oETS_I | "inverse-odds-ratio" |
μ_a = 1 | Inverse odds-ratio model |
| oETS_D | "direct" |
μ_a + μ_b = 1, μ_a ≤ 1 | Direct probability (TSB-like) |
| oETS_G | "general" |
No restrictions | General model with both μ_a and μ_b evolving |
| oETS_A | "auto" |
- | Automatic selection between subtypes |
The simplest model with constant probability:
o_t ~ Bernoulli(p)
p̂ = T₁/T
Where T₁ is the number of non-zero observations and T is the total observations.
Sets μ_b = 1, so:
p_t = μ_{a,t} / (μ_{a,t} + 1)
The model focuses on the odds of occurrence.
Sets μ_a = 1, so:
p_t = 1 / (1 + μ_{b,t})
Resembles logistic regression. This model underlies Croston's method when 1 + b_t equals demand intervals.
Imposes μ_a + μ_b = 1 with μ_a ∈ [0, 1]:
p_t = μ_{a,t} = min(l_{a,t-1}, 1)
Similar to the TSB (Teunter-Syntetos-Babai) method.
No restrictions - both μ_a and μ_b evolve according to their own ETS models. Most flexible but requires more parameters.
oes() is an ETS-only wrapper around om(). Calling oes(y, ...) is equivalent to om(y, ..., orders=list(ar=0,i=0,ma=0), formula=NULL). For the full feature set use om() directly.
library(smooth)
# Generate intermittent data
y <- rpois(100, 0.5)
# Fixed probability
oes(y, occurrence="fixed", h=10, holdout=TRUE)
# Odds-ratio model with ETS(M,N,N)
oes(y, model="MNN", occurrence="odds-ratio", h=10, holdout=TRUE)
# Inverse odds-ratio
oes(y, model="MNN", occurrence="inverse-odds-ratio", h=10, holdout=TRUE)
# Direct (TSB-like)
oes(y, model="MNN", occurrence="direct", h=10, holdout=TRUE)
# General model (calls oesg internally, which wraps omg)
oes(y, model="MNN", occurrence="general", h=10, holdout=TRUE)
# Automatic selection between subtypes
oes(y, model="MNN", occurrence="auto", h=10, holdout=TRUE)oesg() is the ETS-only wrapper around omg(), allowing different ETS models for a_t and b_t:
# Different models for a and b — oETS_G(M,N,N)(A,A,N)
oesg(y, modelA="MNN", modelB="AAN", h=10, holdout=TRUE)
# Same model for both
oesg(y, modelA="MNN", modelB="MNN", h=10, holdout=TRUE)# With ARIMA — not available via oes()
om(y, model="NNN", orders=list(ar=1, i=0, ma=0), occurrence="odds-ratio")
# With external regressors — not available via oes()
om(y, model="MNN", formula=~x1+x2, occurrence="direct")Combine occurrence and demand sizes in one model:
# iETS(M,M,N)_F - fixed probability
adam(y, "MMN", occurrence="fixed", h=10, holdout=TRUE)
# iETS(M,M,N)_O - odds-ratio with specified oETS model
adam(y, "MMN", occurrence="odds-ratio", oesmodel="MMN", h=10, holdout=TRUE)
# Two-step approach: estimate oETS first, then use in adam
oesModel <- oes(y, model="MMN", occurrence="odds-ratio", h=10, holdout=TRUE)
adam(y, "MMN", occurrence=oesModel, h=10, holdout=TRUE)
# General model
adam(y, "MMN", occurrence="general", oesmodel="MMN", h=10, holdout=TRUE)oes() accepts an ETS-only subset of om() parameters. For the full parameter list see OM.
| Parameter | Type (R) | Default | Description |
|---|---|---|---|
y |
vector/ts | — | Time series data; binarised automatically (non-zero → 1) |
model |
character | "ZXZ" |
ETS model for occurrence (e.g., "MNN") |
occurrence |
character | "auto" |
Occurrence subtype; see link table above |
persistence |
numeric vector | NULL | Fixed smoothing parameters |
initial |
character | "backcasting" |
Initialisation method |
phi |
numeric | NULL | Damping parameter |
ic |
character | "AICc" |
Information criterion |
h |
integer | 0 | Forecast horizon |
holdout |
logical | FALSE | Use holdout validation |
bounds |
character | "usual" |
Parameter bounds |
Parameters not available in oes() (use om() instead): orders, formula, regressors, arma, loss, verbose, nlopt_kargs.
The full iETS notation is: iETS(E,T,S)_X(E,T,S)(E,T,S)
- First brackets: ETS model for demand sizes
- Subscript letter: Subtype (F, O, I, D, G)
- Second brackets: ETS model for
a_t - Third brackets: ETS model for
b_t(only for iETS_G)
Examples:
-
iETS(M,N,N)_F: Fixed probability with MNN for sizes -
iETS(M,M,N)_O(M,N,N): Odds-ratio with MMN for sizes, MNN for occurrence -
iETS(M,N,N)_G(M,N,N)(A,A,N): General with different models for a and b
When discussing only the occurrence part, use oETS notation (e.g., oETS_O(M,N,N)).
oes() returns an object of class c("om","adam","smooth") (R). Because oes() delegates to om(), the output structure is identical to that of om(). See OM for the full attribute list.
| Element | Type (R) | Description |
|---|---|---|
model |
character | ETS model type used |
occurrence |
character | Occurrence subtype |
fitted |
vector | Fitted probability values ∈ (0,1) |
states |
matrix | State vector values |
persistence |
numeric vector | Smoothing parameters |
phi |
numeric | Damping parameter |
initial |
numeric vector | Initial states |
logLik |
numeric | Bernoulli log-likelihood |
residuals |
vector | o_t − p̂_t |
y |
vector | Binarised occurrence (0/1) |
- Svetunkov, I., & Boylan, J.E. (2023). iETS: State space model for intermittent demand forecasting. International Journal of Production Economics, 265, 109013. DOI: 10.1016/j.ijpe.2023.109013
- Svetunkov, I. Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM). Chapter 13: https://openforecast.org/adam/ADAMIntermittent.html