ARIMA ETS and ML regressors
Quick answer
ARIMA models serial dependence after differencing; exponential smoothing updates level, trend and seasonal states; machine-learning regressors learn mappings from available lag and calendar features. Examples are static Python snippets tested locally on CPU; Statsmodels and scikit-learn are required for selected examples. ByteMind execution is unverified.
Level smoothing by hand
level=10.;alpha=.5for y in [14,18]: level=alpha*y+(1-alpha)*levelprint(level)Expected output (locally tested): 15.0. Simple exponential smoothing updates level and forecasts it forward.
How it works
ARIMA(p,d,q) uses p autoregressive terms on a differenced series, d differences and q lagged innovations. The moving-average component models past innovations, not a simple rolling average of values. Seasonal ARIMA adds seasonal terms and differencing at period s. Exponential smoothing estimates states with more weight on recent observations; simple level smoothing updates l[t]=alpha*y[t]+(1-alpha)*l[t-1], giving constant future level forecasts. Holt adds trend; Holt-Winters adds seasonal structure. ETS denotes error, trend and seasonal components of a statistical model; smoothing recursions alone do not specify all distributional assumptions. Multiplicative components require appropriate positive values. Fit using training only and inspect convergence and residual dependence. Lag regression constructs X[t] from past outcomes and known exogenous inputs; a linear model or tree can learn these relationships. For h>1, recursive lag predictions propagate model errors, direct models train on horizon-specific targets and multi-output models forecast jointly. A model using future observed lag values is only valid for a rolling one-step protocol, not fixed-origin multistep. Choose model and hyperparameters by chronological validation, evaluate on the same forecast origins, and check input availability at inference.
ARIMA and level smoothing APIs
import numpy as npfrom statsmodels.tsa.arima.model import ARIMAfrom statsmodels.tsa.holtwinters import SimpleExpSmoothingy=np.array([10.,12.,11.,14.,13.,15.,14.,16.])a=ARIMA(y,order=(0,1,0)).fit().forecast(2)b=SimpleExpSmoothing(y,initialization_method="known",initial_level=10).fit(smoothing_level=.5,optimized=False).forecast(2)print([round(float(v),3) for v in a],[round(float(v),3) for v in b])Expected output (locally tested): [16.0, 16.0] [14.969, 14.969]. ARIMA(0,1,0) without drift repeats the last observation; the fixed smoothing level gives a different forecast.
Common mistakes
Do not confuse ARIMA q with a rolling mean, assume differencing always works, or evaluate a recursive forecast using actual future lags. Avoid model selection on the final test block.
Practice and next steps
Fit a seasonal naive and lag regressor on a training prefix, compare chronological validation MAE, and explain how the features change for a three-step fixed-origin forecast.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
ARIMA ETS and ML regressors — knowledge check
Apply arima ets and ml regressors to small examples and debugging scenarios.
What does q in ARIMA denote?
What does simple exponential smoothing forecast?
What does d specify?
Which approach uses earlier predictions as future lag inputs?
What should be checked after fitting ARIMA?