Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PAR(p) Autoregressive Models

What Is a PAR(p) Model?

A Periodic Autoregressive model of order p (PAR(p)) is a time series model designed for data with strong seasonal patterns. It extends the classical autoregressive (AR) model by allowing every parameter to vary by season — the coefficients that govern January inflows are different from those that govern July inflows.

The “order p” indicates how many past time steps the model looks back. A PAR(3) model for a given month predicts the current inflow using the inflows from the previous three months. The order can differ by season: January might need only one lag while April might need four, reflecting different hydrological dynamics across the year.

The PAR(p) Equation

For hydro plant at stage falling in season , the PAR(p) model is:

In words: the inflow at stage equals the seasonal mean, plus a weighted combination of how much recent inflows deviated from their seasonal means, plus a random shock.

Parameters by Season

Each season has its own set of parameters:

ParameterSymbolRole
Seasonal meanExpected inflow for season
AR coefficientsWeights on past deviations from the mean
Residual stdScale of the random innovation
InnovationStandardized random shock

The seasonal mean and sample standard deviation are estimated from historical data. The AR coefficients are fitted using the Yule-Walker equations (see below). The residual standard deviation is derived at runtime from the other parameters (it is not stored independently).

How Lags Become State Variables

In the SDDP framework, decisions at each stage depend on a set of state variables that summarize everything the optimizer needs to know from the past. For the PAR(p) model, the state variables are the lagged inflows:

where is the reservoir volume and are the lagged inflows needed by the autoregressive equation. Each lag adds one state variable per hydro plant to the SDDP subproblem.

This is significant for problem size: a system with 150 hydro plants and a maximum PAR order of 6 adds up to state variables beyond the reservoir volumes. The LP formulation includes constraints that “shift” lagged inflows forward from one stage to the next, ensuring the autoregressive structure is respected across the Bellman recursion.

Stored vs. Computed Quantities

Cobre stores the natural outputs of the fitting process:

  • Stored: seasonal means (), seasonal sample standard deviations (), AR order (), standardized AR coefficients (, the direct Yule-Walker output), and residual_std_ratio (DEC-020)
  • Computed at runtime: original-unit AR coefficients () and the residual standard deviation , derived from the stored standardized quantities and conditioning stats

This design separates the swappable seasonal conditioning from the fixed model dynamics (DEC-020).

Yule-Walker Fitting Procedure

When fitting PAR(p) parameters from historical inflow data, the AR coefficients are estimated by solving the Yule-Walker equations — a linear system that relates the autocorrelations of the data to the model coefficients. The procedure has six steps.

Implementation status: As of v0.1.1, this full fitting procedure is implemented in cobre-stochastic’s estimation module. Steps 1–5 are carried out by the seasonal statistics, autocorrelation, and AR coefficient estimators; Step 6 selects the model order via partial autocorrelation function (PACF) significance testing before the final coefficients are computed.

Step 1 — Seasonal Statistics

For each season , compute the sample mean and standard deviation from historical observations :

where is the number of historical observations for season .

Step 2 — Seasonal Autocorrelations

Compute the cross-seasonal autocorrelation at lag for season . The cross-seasonal structure arises because lag at season reaches back to season (cyclically):

Note that is the standard deviation of season , not of season . This is the defining feature of a periodic (as opposed to stationary) autoregressive model.

Step 3 — Yule-Walker System

For each season , the coefficients in standardized form satisfy:

where:

The solution is:

The matrix is not a standard Toeplitz matrix (because consecutive rows use different seasons’ correlations), but it has a similar structure. The correlation matrix must be positive definite for the solution to exist; if not, the historical record may be too short for the requested order.

LU factorization: In the implementation, the periodic Yule-Walker system is solved via LU factorization with partial pivoting rather than direct matrix inversion or the classical Levinson-Durbin recursion. The Levinson-Durbin recursion assumes a stationary Toeplitz covariance structure, which does not hold for the periodic correlation matrix (whose consecutive rows use different seasons’ correlations). LU factorization with partial pivoting handles the general (non-Toeplitz) case correctly in time. For the per-season orders typical in hydro studies (), this cost is negligible.

Step 4 — Residual Standard Deviation

After solving the Yule-Walker system, the residual standard deviation for season is:

This equals times the square root of the unexplained variance fraction. If , the model overfits — it explains all historical variance, leaving no room for the noise term.

Step 5 — Convert to Original Units

The Yule-Walker solution yields coefficients in standardized form (dimensionless, relating standardized deviations). The LP requires original-unit coefficients:

These are computed once at initialization and used directly as LP constraint matrix entries.

Step 6 — Model Order Selection (PACF)

Before Steps 3–5 are applied at the final model order, the implementation selects the order for each season using partial autocorrelation function (PACF) significance testing. The procedure fits Yule-Walker systems at increasing orders and examines the last coefficient at each order — the partial autocorrelation at lag . Under the null hypothesis that the true order is less than , the partial autocorrelation is approximately normally distributed with standard error , where is the number of historical observations for the season.

The selected order is the largest whose partial autocorrelation is significant:

where is the critical value for the chosen significance level (typically for a 95% confidence band). If no lag is significant, the selected order is (white-noise model, no autoregressive structure).

Implementation: This procedure is implemented in select_order_pacf in the cobre-stochastic estimation module. The function evaluates PACF significance for each candidate order and returns the selected order. AIC and BIC are recognized alternatives but are not implemented.

Key Properties

  • Periodicity: All parameters vary by season, matching the strong seasonality of hydrological data.
  • Parsimony: The model order is selected per season using PACF significance testing (implemented via select_order_pacf). AIC and BIC are recognized alternatives but are not implemented.
  • Stationarity: Fitted models are validated to ensure the AR process does not diverge — the characteristic polynomial roots must lie outside the unit circle.
  • Positive residual variance: After fitting, must hold for all seasons. A zero or negative residual variance indicates overfitting.

Further Reading


See also: For implementation details and usage, see the Stochastic Modeling guide in the software book.