Skip to main content
Track Linear regression
26 / 43
Library

1996issue C091

Constructing session-indexed standard error bands

A 21-observation linear regression of closes on a session index supplies a local trend level and a residual width. After both series are smoothed, they form a standard-error band, and a band-location reading is taken only once that shared clock is in place.

  • Use a session index as the independent variable so each bar advances the clock by one unit and non-trading days do not widen the spacing.
  • Estimate the latest fitted level and the residual standard error on the same 21-observation window of closes, then smooth both with a three-period simple moving average.
  • Place the upper and lower envelopes a distance of twice the smoothed residual standard error from the smoothed fitted level.
  • Map the close onto the interval between those envelopes only after both series exist, and keep the smoothed coefficient of determination and the slope as tightness and direction companions.
Entries in this reading2 entries

Three series on one clock

A standard-error band is assembled from closing prices and a session index. Linear regression fits those ordered closes to the session index over a fixed lookback. The latest fitted value is the local trend level. The same lookback also yields residual width, a slope, and tightness of fit.

A short simple moving average is applied to the latest fitted level, the residual-width series, and the tightness-of-fit series. Each published value then changes more slowly than the raw statistic.

Why the independent variable is a session index

The independent variable is a running integer index rather than calendar dates. The session index assigns a consecutive integer to each trading observation so the independent variable advances one unit per bar instead of by calendar spacing. Non-trading days do not widen the x-spacing.

Session-indexed close with two-standard-error bands

Closes rise from 95.5 in session 1 to a 106.875 peak in session 13, then settle in the low 100s. The smoothed regression and the upper and lower two-standard-error bands first print on session 23, and later closes stay inside that envelope. Every point is copied from the Andersen SBar worksheet.
Closes rise from 95.5 in session 1 to a 106.875 peak in session 13, then settle in the low 100s. The smoothed regression and the upper and lower two-standard-error bands first print on session 23, and later closes stay inside that envelope. Every point is copied from the Andersen SBar worksheet.Daily sessions, 1 March–10 April 1996 · 1996-03-01T00:00:00.000Z to 1996-04-10T00:00:00.000Z

Regression and band columns stay blank until the lookback is full: raw regression level and standard error begin on session 21; the smoothed line and the two plotted bands begin on session 23.

One window for the centerline and the residual width

A 21-observation linear regression of closing prices supplies the latest fitted value as the local trend level. The residual standard error is estimated over the same 21-observation window of closes and integer index values.

Smooth both series, then place the envelopes

Both the latest fitted level and the residual-standard-error series are then smoothed with a three-period simple moving average. The upper envelope equals the smoothed fitted level plus twice the smoothed residual standard error. The lower envelope subtracts that same quantity. Those envelopes are the standard-error band: a pair placed a fixed multiple of the smoothed residual error above and below the smoothed fitted level.

The location reading after both series exist

A band-location reading maps the close onto the interval between the lower and upper envelopes. The reading exceeds 100 when the close is above the upper envelope and falls below 0 when the close is beneath the lower envelope.

Editorial note: the location reading is a rescaling of the close onto that interval. It is not available until the centerline and the residual-width series already share the session index.

Tightness of fit beside the band

The coefficient of determination is the squared correlation of closes with the integer index over the 21-observation window. That coefficient of determination is itself smoothed with a three-period simple moving average. A companion slope is taken from a linear estimate of closes against the same integer index.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
26 of 43 in the Linear regression track
19981-5 pp.Next on Linear regressionEvaluating linear regression baselines for index valuationA linear specification can treat an equity index level as the joint outcome of several estimated influences, so any single correlation is not a finished specification.
All readings on this track · 43 readings
  1. 1990Constructing dollar baselines from rates, inflation, and residuals
  2. 1990Constructing a nominal index value from forward earnings and fitted yield
  3. 1990Constructing a nominal index price from earnings and a fitted yield
  4. 1990Endpoint-pinned price paths are not forecasts
  5. 1990Constructing least-squares polynomial smoothers
  6. 1991Endpoint growth rates versus linear-regression consistency
  7. 1991Out-of-sample checks for linear growth fits
  8. 1991Trend as persistence, not a straight line
  9. 1991Quadratic trend, residual oscillator, and a secondary cycle calendar
  10. 1991Time-origin offset and residual-price divergence on a quadratic least-squares fit
  11. 1991A least-squares trendline from ordered prices
  12. 1992Constructing log-linear growth and reliability screens
  13. 1992Constructing log-linear growth-rate baselines
  14. 1992Next-session high, low, and close from rolling linear regression
  15. 1993Auditing an index price-earnings multiple with short-rate regression
  16. 1994Regression-seeded nested exponential price filter
  17. 1994Constructing the double exponential average from lag cancellation
  18. 1994Evaluating money supply as a linear leading-index baseline
  19. 1995Constructing least-squares trend channels
  20. 1995Linear baseline holdout checks for annual bill-rate forecasts
  21. 1995Projection bands from high and low regression slopes
  22. 1995Evaluating a least-squares end-point moving average on a known test series
  23. 1996Constructing an endpoint moving average from a least-squares line
  24. 1996Scoring equity path consistency with a k-ratio overlay
  25. 1996Evaluating month-end yield gaps for equity regimes
  26. 1996Constructing session-indexed standard error bands
  27. 1998Evaluating linear regression baselines for index valuation
  28. 1998R-squared as a two-state trend filter from a price-time fit
  29. 2000Second-order moving-average lag correction
  30. 2002Price regression line versus beta for index tracking
  31. 2003Regression slope with an r-squared trend confidence gate
  32. 2003Constructing finite-volume-element divergence with slope comparison
  33. 2004Building a daily score from regression, retracement, and volume
  34. 2004Constructing least-squares trendlines from ordered prices
  35. 2007Rectangle breakout targets beyond height
  36. 2007Confirming a price trend with regression slope and r-squared
  37. 2008A linear-regression angle assembled as one trend filter
  38. 2010A two-state swing machine from four running extremes
  39. 2016Score oil-complex tightness before divergence or regression
  40. 2017Nikkei-yen intermarket divergence as a regime case study
  41. 2017Constructing Calmar ratio and linear regression baselines
  42. 2019Pair-trade layer construction versus average-spread management
  43. 2020A convolution slope built from nested linear regression
All 112 readings tagged Linear regression
Also on Linear regression5 readings