/forecasting:forecast-regressionfrom forecasting
Builds regression forecasts with predictors, from linear regression with trend, season dummies, Fourier terms and intervention dummies to regression with ARIMA errors when the residuals are autocorrelated, plus dynamic harmonic regression for weekly or other long seasonal periods, lagged predictors and scenario forecasts, keeping ex-ante and ex-post accuracy apart. Use when the user says "regression forecast", "TSLM", "forecast with predictors", "season dummies", "piecewise trend", "regression with ARIMA errors", "ARIMAX", "exogenous variables", "Fourier terms", "lagged predictor", "weekly data", "forecast with temperature" or "scenario forecast". Also use it for questions about choosing predictors for a forecast model. Not for estimating causal effects or the effect of an intervention.
Ships in forecasting. 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.
None: SKILL.md is the whole skill.
You build time series regressions that forecast, not only fit. Start with a linear regression; when its residuals are autocorrelated, keep the predictors and model the errors as ARIMA. Book chapters 7 and 10.
../../references/lessons.md and docs/forecast-plans/lessons.md if present.../../references/diagnostics/regression.md and
../../references/diagnostics/dynamic-regression.md.explore.md, baselines.md and any arima.md in
docs/forecast-plans/*/ if present.../../references/workflow.md.../../templates/regression.py (linear regression) and, for ARIMA errors,
../../templates/dynamic_regression.py, with fpp_data.py and fc_checks.py.
Replace the data sections you need.ndiffs). Why: regressing non-stationary
series gives inconsistent coefficients. When the target is differenced, the
predictors are differenced the same way (statsforecast does this when d > 0).model.model_["residuals"], dof = p + q + P + Q). The regression residuals are
expected to be autocorrelated; plot them separately.DeterministicProcess(index, constant=True, order=1, seasonal=True, drop=True) for trend and m - 1 dummies, or Fourier(period, order=K) for long periods. K = m/2 reproduces the dummies.AutoARIMA().fit(y, X=X); the predictor coefficients are ex_1,
ex_2, ... in model.model_["coef"]. With the StatsForecast API, add the
predictors as columns and pass future values in X_df.Fourier(period=365.25/7, order=K) for weekly data) and
AutoARIMA(season_length=1) for the errors. Choose K by AICc with d fixed.
If the best K is the largest tried, extend the range or cap K and say so.
Why: the seasonal shape is fixed over time; if it drifts, prefer STL or ETS.
Several seasonal periods (daily, sub-daily): forecast-advanced.fc_checks.rolling_origin against the
benchmarks from baselines.md, same forecast origins. Compare the linear and the
ARIMA-error model on those origins when both were fitted.Apply workflow.md. Quote the selected predictors and their selection table, the
error model, the residual checks (innovation residuals for ARIMA errors), ex-ante
and ex-post accuracy against the benchmark, and how future predictor values were
obtained.
Write docs/forecast-plans/<project>/regression.md. Explain coefficients as
associations: "a quarter with 1 point higher income growth had on average 0.74
points higher consumption growth, holding the other predictors fixed". Say that
this is not a causal effect. Intervals do not include uncertainty in forecast
predictors, and scenario intervals are conditional on the scenario; say so beside
the forecast.
Next: /forecasting:forecast-auditor. Several seasonal periods or nonlinear
effects: /forecasting:forecast-advanced.
| Mistake | Why it is wrong | Instead |
|---|---|---|
| Selecting predictors by p-value | p-values do not measure forecast value | AICc, BIC or leave-one-out CV |
| Reporting R squared as accuracy | Rises with every predictor; in-sample | Cross-validated accuracy |
| m season dummies plus an intercept | Perfect collinearity | m - 1 dummies (drop=True) |
| Ignoring autocorrelated residuals | Intervals too narrow; possible spurious fit | ARIMA errors |
| Residual check on the regression residuals of an ARIMA-error model | They are autocorrelated by design | Check the innovation residuals |
| Non-stationary predictors with d = 0 | Inconsistent coefficients | Difference all variables alike |
| AICc across lag counts on different rows | Not comparable | Same rows, then refit |
| K chosen at the edge of the range | Search stopped early | Extend or cap and report |
| m = 52 seasonal ARIMA for weekly data | Wrong period; slow and unstable | Fourier terms, period 365.25/7 |
| Deterministic trend for long forecast horizons | Too narrow intervals | Stochastic trend (d = 1 with drift) |
| Ex-post accuracy as the headline | Uses future values no one has | Ex-ante accuracy |
| Intervals presented as unconditional | They ignore predictor uncertainty | Label them conditional |
| Reading coefficients as causal effects | Confounders and reverse links | State them as associations |
| Cubic spline trend for forecasting | Extrapolates a cubic | Piecewise linear trend |
FPP3 chapter 7: 7.1 the linear model, 7.2 least squares, 7.3 evaluating the model,
7.4 useful predictors, 7.5 selecting predictors, 7.6 forecasting with regression,
7.7 nonlinear regression, 7.8 correlation, causation and forecasting. Chapter 10:
10.1 estimation, 10.2 regression with ARIMA errors, 10.3 forecasting, 10.4
stochastic and deterministic trends, 10.5 dynamic harmonic regression, 10.6 lagged
predictors; 13.1 weekly, daily and sub-daily data. R:
https://otexts.com/fpp3/regression.html, dynamic-regression.html,
practical.html#sec-weekly. Python edition: https://otexts.com/fpppy/ chapters
7 and 10. URLs checked 2026-10-22.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub robinicole/skills --plugin forecasting13 skills in this plugin
/forecast-advancedApplies the book's advanced methods when standard models miss a feature, namely multiple seasonal periods with MSTL or Fourier terms, Prophet, vector autoregression, neural network autoregression and bagged ETS, always compared with ETS or ARIMA. Use when the user says "Prophet", "VAR model", "multiple seasonality", "half-hourly", "hourly data", "neural network forecast", "NNAR" or "bagging". Also use it for questions about data with two or more seasonal cycles, or about nonlinear models. Not for a first model on an ordinary monthly or quarterly series./forecast-arimaFits ARIMA and seasonal ARIMA models, deciding stationarity and differencing with KPSS and seasonal strength tests, reading ACF and PACF, running the automatic order search, checking residuals, and comparing ARIMA with ETS by cross-validation. Use when the user says "ARIMA model", "seasonal ARIMA", "SARIMA", "auto ARIMA", "stationarity", "unit root test", "differencing" or "PACF". Also use it for questions about differencing and reading ACF or PACF plots. Not for regression with ARIMA errors (use forecast-regression).Other plugins' skills for the same job
/forecast-auditorStress-tests a finished forecast in five categories (problem fit, data, model, evaluation, uncertainty), rates each finding fatal, serious or minor, and hands fixes to the right skill without making them. Use when the user says "audit my forecast", "review this forecast", "what could go wrong", "is this forecast reliable" or "check my forecasting code for leakage". Also use it when the user doubts how a forecast or its accuracy was evaluated. Not for building or fixing a forecast.