MLCrack

    TIME SERIES & FORECASTING ยท INTERVIEW QUESTION

    Explain ARIMA. What are the p, d, q parameters and how do you select them?

    ๐ŸŸก intermediate ยท Statistical Methods

    Hint: AR = autoregressive, I = integrated, MA = moving average. Think about ACF and PACF plots.

    Answer

    ARIMA(p,d,q): p = autoregressive order (how many past values), d = differencing order (for stationarity), q = moving average order (how many past errors).

    Interview reasoning

    Selection:

    1. Check stationarity (ADF test), difference until stationary (sets d).

    2. ACF plot: if cuts off at lag q โ†’ MA(q). PACF plot: if cuts off at lag p โ†’ AR(p).

    3. Information criteria: minimize AIC/BIC across candidate models.

    4. auto_arima automates this. Seasonal ARIMA adds (P,D,Q,s) for seasonal patterns.

    Limitations: assumes linearity, struggles with complex patterns.

    For complex series: Prophet (trend + seasonality decomposition), or deep learning (N-BEATS, temporal fusion transformers).

    ARIMA models differences of a series with autoregressive lag terms and moving-average innovation terms: p controls AR order, d differencing and q MA order. Seasonal ARIMA adds corresponding seasonal terms. Use stationarity diagnostics, ACF/PACF and information criteria for candidate generation, then select by rolling-origin forecasts at relevant horizons.

    Worked example. For ARIMA(1,1,0), model the first difference using its previous difference plus an innovation. If the first differences still trend, this specification needs further diagnosis rather than automatic higher AR order.

    Validation

    Inspect residual dependence and variance, compare seasonal-naive baselines, and evaluate candidates with training-only transforms and untouched final origins.

    Common pitfalls

    AIC is not a direct estimate of inventory value. Excessive differencing adds noise, and clean fitted residuals do not guarantee multi-step forecast quality.