Wrapper of omg that fits a general occurrence (probability) model — two parallel ETS sub-models A and B combined via a Beta-distribution link — to a univariate intermittent time series. ARIMA components and regression formulas are disabled; use omg directly if those are needed.
oesg(y, modelA = "MNN", modelB = modelA, lags = c(frequency(y)),
persistenceA = NULL, persistenceB = persistenceA, phiA = NULL,
phiB = phiA, initial = c("backcasting", "optimal", "two-stage",
"complete", "gradient"), ic = c("AICc", "AIC", "BIC", "BICc"), h = 0,
holdout = FALSE, bounds = c("usual", "admissible", "none"),
etsA = c("conventional", "adam"), etsB = etsA, smoother = c("default",
"ma", "lowess", "supsmu", "global"), xregA = NULL, xregB = NULL,
regressorsA = c("use", "select"), regressorsB = regressorsA,
silent = TRUE, ...)An object of class c("omg","om","smooth","occurrence").
Univariate numeric vector or time series. Non-binary input is binarised internally by omg.
Three-letter ETS specification for sub-model A.
Three-letter ETS specification for sub-model B.
Defaults to modelA.
Vector of seasonal lags. Defaults to frequency(y).
Optional persistence vector for sub-model A.
Optional persistence vector for sub-model B.
Defaults to persistenceA.
Optional damping parameter for sub-model A.
Optional damping parameter for sub-model B. Defaults to phiA.
Initialisation method passed to both sub-models.
Information criterion for model selection.
Forecast horizon.
If TRUE, a holdout of size h is withheld.
Parameter bounds type.
ETS type for sub-model A: "conventional" or "adam".
ETS type for sub-model B. Defaults to etsA.
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.
Optional numeric vector or matrix of exogenous regressors for
sub-model A, aligned with y.
Optional numeric vector or matrix of exogenous regressors for
sub-model B, aligned with y.
How to handle xregA: "use" or "select".
How to handle xregB. Defaults to regressorsA.
If TRUE, suppresses output and plot.
Additional arguments forwarded to omg.
omg, oes
set.seed(42)
y <- rbinom(120, 1, 0.3)
m <- oesg(y, modelA="MNN", modelB="MNN")
forecast(m, h=12)
Run the code above in your browser using DataLab