-
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. Currently implemented in the R function oes().
Note: oETS is currently available only in R.
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.
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)
oes(y, model="MNN", occurrence="general", h=10, holdout=TRUE)
# Automatic selection between subtypes
oes(y, model="MNN", occurrence="auto", h=10, holdout=TRUE)The oesg() function allows specifying 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)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)| Parameter | Type (R) | Default | Description |
|---|---|---|---|
y |
vector/ts | - | Time series data |
model |
character | "MNN" | ETS model for occurrence (e.g., "MNN", "MMN") |
occurrence |
character | - | Occurrence subtype |
persistence |
numeric vector | NULL | Fixed smoothing parameters |
initial |
character | "optimal" | Initialization method |
initialSeason |
numeric vector | NULL | Initial seasonal states |
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 |
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)).
The oes() function returns an object of class "occurrence" containing:
| Element | Type (R) | Description |
|---|---|---|
model |
character | ETS model type used |
occurrence |
character | Occurrence subtype |
fitted |
vector | Fitted probability values |
forecast |
vector | Probability forecasts |
states |
matrix | State vector values |
persistence |
numeric vector | Smoothing parameters |
phi |
numeric | Damping parameter |
initial |
numeric vector | Initial states |
logLik |
numeric | Log-likelihood |
residuals |
vector | Model residuals |
y |
vector | Actual 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