Learn R Programming

smooth (version 4.5.2)

omg: General occurrence model

Description

Fits two parallel ETS occurrence models (A: odds-ratio, B: inverse-odds-ratio) jointly using a shared Bernoulli log-likelihood. The combined probability at each time point is \(p_t = p_{At} / (p_{At} + p_{Bt})\).

Usage

omg(data, modelA = "MNN", modelB = modelA, ordersA = list(ar = c(0), i =
  c(0), ma = c(0), select = FALSE), ordersB = ordersA, constantA = FALSE,
  constantB = constantA, formulaA = NULL, formulaB = formulaA,
  regressorsA = c("use", "select", "adapt"), regressorsB = regressorsA,
  persistenceA = NULL, persistenceB = persistenceA, phiA = NULL,
  phiB = phiA, armaA = NULL, armaB = armaA, etsA = c("conventional",
  "adam"), etsB = etsA, lags = c(frequency(data)), h = 0,
  holdout = FALSE, initial = c("backcasting", "optimal", "two-stage",
  "complete", "gradient"), loss = c("likelihood", "MSE", "MAE", "HAM",
  "LASSO", "RIDGE"), ic = c("AICc", "AIC", "BIC", "BICc"),
  bounds = c("usual", "admissible", "none"), model = NULL,
  smoother = c("default", "ma", "lowess", "supsmu", "global"),
  silent = TRUE, ...)

Value

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

Arguments

data

Binary time series (0/1), vector or data frame.

modelA

ETS model string for model A (default "MNN").

modelB

ETS model string for model B (default "MNN").

ordersA

ARIMA orders list for model A.

ordersB

ARIMA orders list for model B.

constantA

Logical, include constant in model A.

constantB

Logical, include constant in model B.

formulaA

Formula for exogenous variables in model A.

formulaB

Formula for exogenous variables in model B.

regressorsA

How to handle regressors in model A.

regressorsB

How to handle regressors in model B.

persistenceA

Persistence vector for model A.

persistenceB

Persistence vector for model B.

phiA

Damping parameter for model A.

phiB

Damping parameter for model B.

armaA

ARMA parameters for model A.

armaB

ARMA parameters for model B.

etsA

ETS variant for model A ("conventional" or "adam").

etsB

ETS variant for model B.

lags

Seasonal lags (shared).

h

Forecast horizon.

holdout

If TRUE, hold out the last h observations.

initial

Initialisation method (shared).

loss

Loss function (shared).

ic

Information criterion (shared).

bounds

Parameter bounds type (shared).

model

An already-fitted omg object. When supplied, the per-side parameters are lifted from model$modelA and model$modelB and no estimation is performed; passing FI=TRUE alongside computes the observed Fisher information over the joint parameter vector (the path used by vcov.omg).

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, suppress output.

...

Additional arguments passed to the optimiser.

See Also

om, forecast.omg

Examples

Run this code
set.seed(41)
y <- rpois(100, 0.5)
m <- omg(y)
forecast(m, h=10)

Run the code above in your browser using DataLab