smooth.OM

class smooth.OM(model='ZXZ', lags=None, ar_order=0, i_order=0, ma_order=0, orders=None, constant=False, formula=None, regressors='use', occurrence='odds-ratio', loss='likelihood', reg_lambda=None, h=0, holdout=False, persistence=None, phi=None, initial='backcasting', n_iterations=None, arma=None, ic='AICc', bounds='usual', verbose=0, nlopt_kwargs=None, ets='conventional', smoother='default', **kwargs)

Occurrence model — state-space model for the probability of demand occurrence.

Inherits the ADAM API surface and overrides the bits that differ for an occurrence model: cost function (Bernoulli likelihood applied to the link-transformed fitted values), distribution (always "plogis"), scale (nan), and model-name format ("oETS(...)[F|O|I|D]").

Methods

coefbootstrap([nsim, size, replace, prob, ...])

Bootstrap the coefficient sampling distribution by refitting subsamples.

confint([parm, level, type, bootstrap, ...])

Confidence intervals for the estimated parameters.

fit(y[, X])

Fit the ADAM model to time series data.

multicov([type, h, nsim])

Covariance matrix of multi-step-ahead forecast errors.

outlierdummy([level, type])

Detect outliers and return a matrix of indicator dummy variables.

plot([which, level, legend, lowess])

Diagnostic plots for the fitted ADAM model (R: plot.adam).

point_lik([log])

Per-observation log-likelihood of the occurrence model.

predict(h[, X, interval, level, side, ...])

Probability forecast for the occurrence model.

predict_intervals(h[, X, levels, side, nsim])

Generate prediction intervals using the fitted ADAM model.

reapply([nsim, type, bootstrap, heuristics, ...])

Re-run the model on the in-sample data for nsim parameter draws.

reforecast([h, X, occurrence, interval, ...])

Produce h-step-ahead forecasts via Monte-Carlo reforecasting.

rmultistep([h])

Return the (T-h) × h matrix of rolling in-sample multistep forecast errors.

rstandard()

Pearson standardised residuals for the occurrence model.

rstudent()

Pearson studentised (leave-one-out) residuals for the occurrence model.

select_best_model()

Select the best model based on information criteria and update model parameters.

simulate([nsim, seed, obs, randomizer])

Re-simulate probabilities + 0/1 occurrence indicators.

summary([level, digits, type])

Coefficient-table summary, mirroring R's summary.om.

vcov([type, bootstrap, heuristics, step_size])

Variance-covariance matrix of the estimated parameters.

Attributes

actuals

In-sample actuals.

aic

Return Akaike Information Criterion.

aicc

Return corrected Akaike Information Criterion.

b_value

$B).

bic

Return Bayesian Information Criterion.

bicc

Return corrected Bayesian Information Criterion.

coef

Return estimated coefficients (parameter vector B).

coef_names

Parameter names aligned with coef (the B vector).

constant_value

$constant).

data

$data).

distribution_

Always "plogis" for occurrence models.

error_type

'A' (additive) or 'M' (multiplicative).

fisher_information_

Observed Fisher Information matrix at the estimated parameters.

fitted

In-sample fitted probabilities in [0, 1].

holdout_data

$holdout).

ic_weights

$ICw).

initial_type

$initialType).

initial_value

$initial).

is_combined

Return True if model is a combination of multiple models.

lags_used

Return the vector of lags used in the model.

loglik

Return log-likelihood of the fitted model.

loss_

$loss).

loss_value

$lossValue).

measurement

$measurement).

model_name

Model name in oETS(...)[X] form (uppercase X = F/O/I/D).

model_type

Return ETS model type code (e.g., 'AAN', 'AAA', 'MAdM').

models

$models).

n_param

$nParam).

nobs

Return number of observations used for fitting.

nparam

Return number of estimated parameters.

occurrence

Occurrence type used for fitting (e.g. "odds-ratio").

occurrence_char

Single-letter occurrence flag handed to the C++ fitter.

om_model

Fitted occurrence model (OM / OMG / AutoOM), or None.

orders

Return ARIMA orders as dict with 'ar', 'i', 'ma' keys.

persistence_vector

$persistence).

phi_

$phi).

profile

$profile).

residuals

ot - p_fitted (binary indicator minus fitted probability).

scale

Link-scale residual std-dev — alias for sigma.

sigma

sqrt(mean(residuals²)).

states

$states).

time_elapsed

Time taken to fit the model in seconds.

transition

$transition).