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', h=0, holdout=False, persistence=None, phi=None, initial='backcasting', n_iterations=None, arma=None, ic='AICc', bounds='usual', verbose=0, nlopt_kargs=None, ets='conventional', **kwargs)

Occurrence model — Python port of R’s om().

Inherits the ADAM API surface and overrides the bits that differ: cost function (Bernoulli likelihood with link transform), distribution (always "plogis"), scale (nan), and model-name format ("oETS(...)[F|O|I|D]").

Methods

fit(y[, X])

Fit the ADAM model to time series data.

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).

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.

rmultistep([h])

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

rstandard()

Return standardised residuals.

rstudent()

Return studentised (leave-one-out) residuals.

select_best_model()

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

summary([digits])

Generate a formatted summary of the fitted model.

Attributes

actuals

Binary 0/1 occurrence indicator (matches R's actuals.om).

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).

constant_value

$constant).

data

$data).

distribution_

Always "plogis" for occurrence models.

error_type

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

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

Always NaN for occurrence models (no continuous error scale).

sigma

Same as scale.

states

$states).

time_elapsed

Time taken to fit the model in seconds.

transition

$transition).