Skip to main content
Track Historical analog comparison
11 / 19
Library

2001issue C111-2

Constructing nearest-neighbor forecasts gated by a trend filter

A nearest-neighbor forecast locates historically similar patterns and averages those neighbors’ subsequent moves to estimate the current pattern’s next move. Analog ranking and a period-based trend-detection status can be built as separate modules and then composed when constructing a gated forecast.

  • A nearest-neighbor forecast estimates the current pattern’s next move by averaging the subsequent moves of historically similar neighbors.
  • Each pattern element can carry its own importance weight, and closer analogs can be distance-weighted with a decay that may differ by element.
  • The lookback that defines the pattern window can be fixed by the builder or searched jointly with which series and parameters enter the pattern.
  • Analog ranking and a period-based trend-detection status can be built as separate modules and then composed into a gated forecast.
Entries in this reading3 entries

How the forecast is formed

A nearest-neighbor forecast is built by locating historically similar patterns and averaging those neighbors’ subsequent moves to estimate the current pattern’s next move. Historical analog comparison ranks earlier windows of ordered observations by distance from the current window and uses the neighbors’ subsequent moves as the forecast raw material.

Treat the lookback as a searchable pattern

Pattern recognition treats a chosen lookback of prices or derived series as a multi-element signature that can be matched, classified, or assigned element-level importance. The ordered inputs that form the pattern may be past prices or other series such as oscillators and moving averages, so each pattern element can be assigned a distinct importance weight.

The lookback that defines the pattern window can be fixed by the builder or searched jointly with which series and parameters enter the pattern.

Rank analogs and form the next-move estimate

Neighbor contributions can be scaled so closer analogs receive more weight than distant ones. Distance-weighting applies that scaling, and the decay of weight with distance can be set separately for each pattern element.

Classify instead of estimating a next move

The same analog machinery can classify the current pattern into discrete act-or-stand-aside states instead of emitting only a continuous next-move estimate.

Weekly Adaptive Net Indicator one-year account returns

America Online and Dell led this weekly Adaptive Net Indicator optimization, at 117.6% and 116.8% one-year account return, with Boise Cascade at 104.0% and only one loser in eleven trades. The bars are the Optimal 1-year returns printed in the NeuroShell Trader strategy-results table; the Current column matched Optimal on every row.
America Online and Dell led this weekly Adaptive Net Indicator optimization, at 117.6% and 116.8% one-year account return, with Boise Cascade at 104.0% and only one loser in eleven trades. The bars are the Optimal 1-year returns printed in the NeuroShell Trader strategy-results table; the Current column matched Optimal on every row.BCC, AOL, DELL · Weekly

Optimal and Current backtests were identical for return, trade count, winners and losers. The All-instruments row is the three-name average return (112.8%) and is omitted so the bars show only the named stocks.

One weekly construction path

One construction path writes ordered weekly closes, optionally as the natural logarithm of the close, ranks analogs in a table after skipping the current bar, then marks the five nearest neighbors back on the price series.

Build the trend filter as its own module

A trend filter is a directional gate assembled from the signed and absolute close displacement over a chosen period. The construction compares the one-window and two-window sums of those displacements and holds the prior directional state when the index is not positive.

Compose the gated forecast

Analog ranking of a current price pattern and a period-based trend-detection status can be built as separate modules and then composed when constructing a gated forecast.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
11 of 19 in the Historical analog comparison track
20031-6 pp.Next on Historical analog comparisonRegime context for debt-era bear ralliesHolds of weeks or longer shifted weight toward major trends, market-health readings, and fundamentals, so a multi-week bounce was classified as a market-regime question before it was treated as a trade.
All readings on this track · 19 readings
  1. 1988Crash fear fails the depression regime test
  2. 1990October 1987 cycle overlay and the loss-trap
  3. 1990Constructing nested four-year market cycles
  4. 1991Evaluating quarterly return runs with historical analogs
  5. 1992Evaluating split events across correction and bear regimes
  6. 1993Mining-bullion relative strength as a gold-sleeve regime
  7. 1994A two-horizon case study of a market-breadth oscillator
  8. 1994Extreme short-rate declines as equity regime context
  9. 1997Clustered true-range days as a regime label rather than a top forecast
  10. 2001Nearest-neighbor one-week forecast from log-price patterns
  11. 2001Constructing nearest-neighbor forecasts gated by a trend filter
  12. 2003Regime context for debt-era bear rallies
  13. 2004Testing a 1987 stock and gold analog by wave degree
  14. 2004Shifting calendar regimes and election-cycle analogs
  15. 2006Aligning sugar boom phases with seasonal analogs
  16. 2009Crowd consensus and failed targets as regime context
  17. 2011Treat a long-horizon chart analog as a regime scenario
  18. 2012Build a weekly analog as a dated forecast object
  19. 2015From a drawn price shape to an event-cloud case study
All 19 readings tagged Historical analog comparison
Also on Historical analog comparison5 readings