Skip to content

LOWESS, EMA and Polynominal Trend additions#3

Merged
buggedcom merged 2 commits into
mainfrom
branch/2-lowess-and-other-trends
Apr 9, 2026
Merged

LOWESS, EMA and Polynominal Trend additions#3
buggedcom merged 2 commits into
mainfrom
branch/2-lowess-and-other-trends

Conversation

@buggedcom

Copy link
Copy Markdown
Owner
  • version bumps from 0.4.2 to 0.5.0 because of new trends features
  • Add three new trend methods: EMA (exponential moving average), Polynomial trend (quadratic least-squares), and LOWESS (locally weighted scatterplot smoothing)
  • Fix LOWESS bug where the bandwidth parameter was accepted but never used — distances were normalised by the furthest point instead, making all window sizes produce identical curves
  • Refactor history-analysis.worker.ts to import math from @/cards/history/analysis instead of duplicating the implementations
  • Add UI options for all three methods; window selector shown/hidden appropriately per method
  • Add distinct chart render styles for each method
  • Port all three methods to anomaly_detection.py for backend trend-residual analysis
  • Add golden master fixture files and cross-language consistency tests (TS vs Python)
  • Add README section documenting each trend method with when-to-use guidance

@buggedcom buggedcom self-assigned this Apr 9, 2026
@buggedcom buggedcom added the enhancement New feature or request label Apr 9, 2026
- Add buildEmaTrend, buildPolynomialTrend, buildLowessTrend to series.ts with getEmaAlpha and getLowessBandwidth helpers
- Port all three methods to anomaly_detection.py (_build_ema, _build_polynomial_trend, _build_lowess)
- Fix LOWESS bug: bandwidth was accepted but ignored; now used as the neighbourhood cutoff and distance normaliser in both TS and Python
- Refactor history-analysis.worker.ts to import math from @/cards/history/analysis instead of duplicating it
- Widen trend_method union in history-series.ts and NormalizedAnalysis to include ema, polynomial_trend, lowess
- Add UI options for all three methods in analysis-trend-group; show window selector for rolling_average, ema, lowess; hide for linear_trend and polynomial_trend
- Add chart render options for the three new methods with distinct line styles
- Add static fixture files (trend-dataset.json, trend-expected.json) and cross-language spec covering golden master regression and TS/Python consistency
- Add README section documenting all trend methods with when-to-use guidance
- Add scripts/gen-trend-expected.py for regenerating golden fixtures
- version bump from 0.4.2 -> 0.5.0
@buggedcom buggedcom force-pushed the branch/2-lowess-and-other-trends branch from 3ba958e to fbd9ca9 Compare April 9, 2026 18:43
@buggedcom buggedcom merged commit 3054b70 into main Apr 9, 2026
15 checks passed
@buggedcom buggedcom deleted the branch/2-lowess-and-other-trends branch April 9, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant