1996issue C021-4
Constructing an endpoint moving average from a least-squares line
The same lookback can be written as a rolling mean or as the last point of a short price-versus-time fit. This archive note reconstructs how the endpoint moving average is entered, how its window advances, and which lookbacks yield integer coefficients.
- An endpoint moving average is defined for every integer lookback of two or more observations as the last fitted value of a least-squares line of price against time.
- A rolling window advances one period at a time for an average, a correlation, or a regression, and a paired regression is entered as one shared array formula.
- Integer-coefficient lookbacks occur when the lookback plus one is a multiple of three, including 2, 5, 8, and 11. With a two-observation lookback the endpoint average equals the last price.
- Two closed-form expressions for the general endpoint moving average produce identical numerical results because an inner sum is an arithmetic progression.
The same lookback, two constructions
An endpoint moving average is defined for every integer lookback of two or more observations. It is a constructed smoother equal to the last fitted value of a least-squares line through a price window of that length, rather than the arithmetic mean of the window.
Endpoint averaging is that least-squares line: ordered prices are fitted against time, and mismatch is absorbed only on the price axis. The last point on the fitted line is the smoother.
How the formula is entered
A 26-week regression written across two spreadsheet cells is entered as one shared array formula rather than as two independently typed cell formulas. The array formula keeps the paired outputs on a single expression so the multi-output regression stays internally consistent.
How the window advances
A 30-week correlation feature is computed on a 30-observation rolling window that advances one period at a time, the same way a moving average advances. The same rolling-window rule recomputes an average, a correlation, or a regression at each new observation.
A 30-week regression feature can be formed as an estimate-to-actual ratio: the fitted estimate for the current interval divided by the contemporaneous actual value of the series being explained.
Which coefficients the algebra produces
Integer endpoint-average coefficients arise when the lookback plus one is a multiple of three. Those integer-coefficient lookbacks include 2, 5, 8, and 11.
With a two-observation lookback, the endpoint average equals the last price because the unique line through two points ends at that last price.
Two closed forms, one numerical result
Two different closed-form expressions for the general endpoint moving average produce identical numerical results. Those expressions match because an inner sum is an arithmetic progression with a closed-form total whose first and last terms depend on the lookback.
All readings on this track · 43 readings
- 1990Constructing dollar baselines from rates, inflation, and residuals
- 1990Constructing a nominal index value from forward earnings and fitted yield
- 1990Constructing a nominal index price from earnings and a fitted yield
- 1990Endpoint-pinned price paths are not forecasts
- 1990Constructing least-squares polynomial smoothers
- 1991Endpoint growth rates versus linear-regression consistency
- 1991Out-of-sample checks for linear growth fits
- 1991Trend as persistence, not a straight line
- 1991Quadratic trend, residual oscillator, and a secondary cycle calendar
- 1991Time-origin offset and residual-price divergence on a quadratic least-squares fit
- 1991A least-squares trendline from ordered prices
- 1992Constructing log-linear growth and reliability screens
- 1992Constructing log-linear growth-rate baselines
- 1992Next-session high, low, and close from rolling linear regression
- 1993Auditing an index price-earnings multiple with short-rate regression
- 1994Regression-seeded nested exponential price filter
- 1994Constructing the double exponential average from lag cancellation
- 1994Evaluating money supply as a linear leading-index baseline
- 1995Constructing least-squares trend channels
- 1995Linear baseline holdout checks for annual bill-rate forecasts
- 1995Projection bands from high and low regression slopes
- 1995Evaluating a least-squares end-point moving average on a known test series
- 1996Constructing an endpoint moving average from a least-squares line
- 1996Scoring equity path consistency with a k-ratio overlay
- 1996Evaluating month-end yield gaps for equity regimes
- 1996Constructing session-indexed standard error bands
- 1998Evaluating linear regression baselines for index valuation
- 1998R-squared as a two-state trend filter from a price-time fit
- 2000Second-order moving-average lag correction
- 2002Price regression line versus beta for index tracking
- 2003Regression slope with an r-squared trend confidence gate
- 2003Constructing finite-volume-element divergence with slope comparison
- 2004Building a daily score from regression, retracement, and volume
- 2004Constructing least-squares trendlines from ordered prices
- 2007Rectangle breakout targets beyond height
- 2007Confirming a price trend with regression slope and r-squared
- 2008A linear-regression angle assembled as one trend filter
- 2010A two-state swing machine from four running extremes
- 2016Score oil-complex tightness before divergence or regression
- 2017Nikkei-yen intermarket divergence as a regime case study
- 2017Constructing Calmar ratio and linear regression baselines
- 2019Pair-trade layer construction versus average-spread management
- 2020A convolution slope built from nested linear regression