Forecasts time series with classical statistical models (ARIMA, SARIMAX, ETS, ARAR) via ForecasterStats. Covers model selection, Auto-ARIMA, backtesting, and parameter tuning for short series or interpretable baselines.
Ships in skforecast. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use statistical models when:
autocorrelation-and-lag-selection (read ACF/PACF to identify ARIMA orders p, d, q before fitting)baseline-forecasting (the other benchmark family: naive equivalent-date baselines)prediction-intervals (ForecasterStats provides built-in parametric intervals via the interval_method argument)hyperparameter-optimization (tune ARIMA order / seasonal_order via grid search)Scan before writing code. Each row lists a rule, the symptom when it is broken, and the recovery. Full pitfall catalog: the troubleshooting-common-errors skill.
| Rule | Symptom | Recovery |
|---|---|---|
Backtest and tune with backtesting_stats and grid_search_stats, not the ML variants | backtesting_forecaster / grid_search_forecaster raises on ForecasterStats | Call backtesting_stats / grid_search_stats |
Arima takes a 3-tuple seasonal_order=(P, D, Q) plus m; Sarimax takes a 4-tuple (P, D, Q, m) | Wrong model order or TypeError | Use Arima(order=(p,d,q), seasonal_order=(P,D,Q), m=12) |
Ets uses model='AAA' + m, not error= / trend= / seasonal= | Deprecated-argument error | Use Ets(model='AAA', m=12) (A/M/N/Z per position) |
Seasonal models require m | Seasonality silently ignored | Pass m=<seasonal period> to Arima / Ets |
| Model | Class | Description |
|---|---|---|
| ARIMA | Arima | AutoRegressive Integrated Moving Average |
| Auto-ARIMA | Arima(order=None) | Automatic order selection |
| SARIMAX | Sarimax | ARIMA with exogenous variables (seasonal) |
| ETS | Ets | Exponential Smoothing (Error-Trend-Seasonal) |
| ARAR | Arar | Autoregressive model with memory shortening |
import pandas as pd
from skforecast.recursive import ForecasterStats
from skforecast.stats import Arima
from skforecast.model_selection import backtesting_stats, TimeSeriesFold
# 1. Load data
data = pd.read_csv('data.csv', index_col='date', parse_dates=True)
data = data.asfreq('MS') # Monthly Start frequency
# 2. Manual ARIMA: specify order and seasonal_order
arima_model = Arima(
order=(1, 1, 1), # (p, d, q)
seasonal_order=(1, 1, 1), # (P, D, Q)
m=12, # Seasonal period
)
forecaster = ForecasterStats(estimator=arima_model)
forecaster.fit(y=data['target'])
predictions = forecaster.predict(steps=12)
# 3. Prediction intervals (all stat models support this natively,
# no bootstrapping needed). Default (no `interval` nor `alpha`): 95%.
predictions_interval = forecaster.predict_interval(
steps=12,
interval=[0.1, 0.9], # symmetric quantiles (0-1), or its alias alpha=0.2
)
# Set order=None and seasonal_order=None to enable automatic order selection
auto_arima = Arima(order=None, seasonal_order=None, m=12)
forecaster = ForecasterStats(estimator=auto_arima)
forecaster.fit(y=data['target'])
# Check the selected model (fitted estimators are stored in `estimators_`)
print(forecaster.estimators_[0].best_params_)
# {'order': ..., 'seasonal_order': ..., 'm': 12, 'fit_intercept': ...,
# 'include_drift': ..., 'lambda_bc': ...}
predictions = forecaster.predict(steps=12)
from skforecast.stats import Ets
# Model string: 1st=Error, 2nd=Trend, 3rd=Seasonal
# A=Additive, M=Multiplicative, N=None. Automatic selection only as model='ZZZ'
# (partial specs like 'ZZN' raise an error: use 'ZZZ' with seasonal=False, trend=...)
ets_model = Ets(model='AAA', m=12)
forecaster = ForecasterStats(estimator=ets_model)
forecaster.fit(y=data['target'])
predictions = forecaster.predict(steps=12)
# Use model='ZZZ' (or model=None) to let ETS automatically select
# the best Error, Trend, and Seasonal components
auto_ets = Ets(model='ZZZ', m=12)
forecaster = ForecasterStats(estimator=auto_ets)
forecaster.fit(y=data['target'])
# Check the selected model configuration
print(forecaster.estimators_[0].best_params_)
predictions = forecaster.predict(steps=12)
from skforecast.stats import Sarimax
sarimax_model = Sarimax(
order=(1, 1, 1),
seasonal_order=(1, 1, 1, 12), # (P, D, Q, seasonal_period)
)
forecaster = ForecasterStats(estimator=sarimax_model)
forecaster.fit(y=data['target'], exog=exog_train)
# For prediction, exog must cover the forecast horizon
predictions = forecaster.predict(steps=12, exog=exog_test)
from skforecast.stats import Arar
arar_model = Arar()
forecaster = ForecasterStats(estimator=arar_model)
forecaster.fit(y=data['target'])
predictions = forecaster.predict(steps=12)
cv = TimeSeriesFold(
steps=12,
initial_train_size=len(data) - 60,
refit=False,
)
metric, predictions_bt = backtesting_stats(
forecaster=forecaster,
y=data['target'],
cv=cv,
metric='mean_absolute_error',
freeze_params=True, # Model selected in the first fit reused in refits (auto selection runs once)
)
# If freeze_params=False, auto selection runs independently each fold and output
# includes an extra 'estimator_params' column with the parameters selected per fold.
# ForecasterStats accepts a list of models — fits each independently
from skforecast.stats import Arima, Ets
models = [
Arima(order=(1, 1, 1), seasonal_order=(1, 1, 1), m=12),
Ets(model='AAA', m=12),
]
forecaster = ForecasterStats(estimator=models)
forecaster.fit(y=data['target'])
# predict returns DataFrame with one column per model
predictions = forecaster.predict(steps=12)
Ets(error=, trend=, seasonal=) syntax: Use Ets(model='AAA', m=12) with a model string instead.m parameter: ARIMA and ETS seasonal models require m (seasonal period).backtesting_stats: Use backtesting_stats() for statistical models, NOT backtesting_forecaster().grid_search_stats() or random_search_stats() instead.seasonal_order=(1,1,1,12) to Arima: Arima uses a 3-tuple seasonal_order=(P,D,Q) plus a separate m=12 parameter. The 4-tuple (P,D,Q,s) format is only for Sarimax.See references/model-parameters.md for complete constructor signatures of all statistical models (Arima, Sarimax, Ets, Arar), the Ets model string format, Auto-ARIMA parameters, seasonal_order differences between Arima and Sarimax, and grid search param_grid examples.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
17 skills in this plugin
/autocorrelation-and-lag-selectionAnalyzes time series dynamics with the fast skforecast.stats functions acf, pacf and calculate_lag_autocorrelation. Covers reading ACF/PACF patterns to identify AR/MA orders and seasonality, ranking lags by partial autocorrelation, and feeding the result to the lags argument of any skforecast forecaster. Use when the user wants to understand the dynamics of a series, choose a candidate set of lags before hyperparameter tuning, or replace a slow statsmodels acf/pacf call.
/backtesting-configurationConfigures TimeSeriesFold parameters for backtesting based on deployment scenarios. Maps business requirements (retraining frequency, forecast horizon, data budget) to cross-validation strategy parameters. Use when the user describes how they plan to deploy or evaluate a model.
/baseline-forecastingBuilds and evaluates simple baseline forecasts with ForecasterEquivalentDate (equivalent-date / seasonal-naive / moving-average) to benchmark machine learning models. Covers offset (int vs pandas DateOffset), n_offsets with agg_func, backtesting a baseline, comparing against ML with MASE, conformal intervals, and grid_search_equivalent_date. Use when the user wants a baseline, a naive or seasonal reference, or to check whether a model beats a simple rule. Not for choosing among ML forecasters (see choosing-a-forecaster) or tuning ML hyperparameters (see hyperparameter-optimization).
/choosing-a-forecasterGuides selection of the appropriate skforecast forecaster based on the user's data characteristics and requirements. Provides a decision matrix mapping use cases to forecaster classes. Use when the user is unsure which forecaster to use or asks for a recommendation.
/complete-api-referenceProvides complete constructor and method signatures for all skforecast forecasters, backtesting functions, search functions, cross-validation classes, preprocessing, feature selection, and drift detection. Use when the user needs exact parameter names, types, or defaults for any skforecast class or function.
/deep-learning-forecastingForecasts time series using recurrent neural networks (RNN, LSTM, GRU) with ForecasterRnn and the create_and_compile_model helper. Covers model architecture, training, and multi-series deep learning. Use when the user wants to use deep learning / neural networks for time series forecasting.
/skforecast:statistical-modelsfrom skforecast
npx claudepluginhub skforecast/skforecast --plugin skforecastOther plugins' skills for the same job