Rolling quadratic turning-point analysis for two time series.
ROLL_QUADRATIC estimates a quadratic relationship between
two time series repeatedly through a moving window and calculates the
turning point of each fitted quadratic.
For every rolling window, RainbowStats estimates:
The location of the quadratic turning point is:
The sign of the quadratic coefficient determines the nature of the turning point:
| Condition | Interpretation |
|---|---|
| β₂ < 0 | Concave quadratic — X* is a maximum. |
| β₂ > 0 | Convex quadratic — X* is a minimum. |
| β₂ ≈ 0 | The relationship is effectively linear and no stable quadratic turning point is reported. |
| Argument | Description |
|---|---|
Y |
The dependent time series. |
X |
The explanatory time series whose turning point is calculated. |
window |
The number of aligned observations included in each rolling quadratic regression. |
The two series are automatically restricted to their common date range before estimation.
The operator returns a D3LineChartOperator showing the
estimated turning point through time.
Two series may appear:
| Series | Meaning |
|---|---|
| Maximum | The value of X* when β₂ is negative. |
| Minimum | The value of X* when β₂ is positive. |
Maximum and minimum are therefore not two independently estimated variables. They are the same quadratic vertex classified according to the sign of the fitted curvature.
RainbowStats reports a turning point only when it lies within the observed range of X in that particular rolling window:
A calculated vertex outside this range is treated as an extrapolation and is not plotted.
The following example examines the relationship between U.S. capital deepening and the wage-and-salary share of gross domestic income.
Here:
capgrowth is growth in estimated real capital stock per worker.labor is wages and salaries as a percent of gross domestic income.30 specifies a 30-observation rolling estimation window.A full-sample quadratic produces an interior maximum near a wage-and-salary share of 44.14 percent.
The rolling analysis asks a more demanding question:
It does not have to.
The estimated turning point may move through time. More importantly, the sign of β₂ may change, causing an estimated maximum to become a minimum or vice versa.
For example, in the U.S. wage-share experiment the rolling relationship changes substantially around the Global Financial Crisis. During the 2009–2011 windows, the fitted curvature reverses and the interior turning point is classified as a minimum rather than a maximum. Subsequent windows again produce maxima.
A quadratic fitted to an entire historical sample can produce an apparently precise turning point:
But that number may conceal substantial instability.
ROLL_QUADRATIC provides a robustness test by asking whether
the turning point:
This makes the operator useful for identifying possible structural change and economic regimes without assuming that a full-sample relationship is constant through history.
The window determines the tradeoff between local sensitivity and statistical stability.
| Window | Typical Behavior |
|---|---|
| Short | More responsive to local changes but potentially unstable. |
| Medium | Balances regime sensitivity with estimation stability. |
| Long | Smoother estimates but may obscure shorter structural changes. |
For annual macroeconomic data, comparing several windows can be more informative than relying on a single choice.
| Command | Purpose |
|---|---|
POLY_SCATTER(Y,X) |
Fits and graphs the full-sample polynomial relationship. |
ROLL_BETA(Y,X,window) |
Examines the stability of a linear regression coefficient through time. |
BINARY_SPLIT(...) |
Examines relationships across subsamples. |
MVTransfer_Function(...) |
Models dynamic multivariate relationships and lag structures. |