code wiki / (root) / sketch_holt_vs_ewma_trended_bench.nx

sketch_holt_vs_ewma_trended_bench.nx

buildroot/runtime/sketch_holt_vs_ewma_trended_bench.nx

2729 B79 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind benchtopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_holt_vs_ewma_trended_bench.nx -- trend tracking paired bench. CLAIM TO VALIDATE: Holt's method (Holt 1957) = EWMA + linear trend component. On trended data, Holt's h-step forecast extrapolates the trend. EWMA tracks level only -- its forecast is FLAT (=current level), so it lags behind the trend. WORKLOAD: y_t = 100 + 5*t (linear trend, slope=5) Stream t=1..50 into both. Forecast h=5 steps ahead: truth y_55 = 100 + 5*55 = 375. At step 50: y_50 = 350. Holt forecast(5) ~ y_50 + 5*trend = 350 + 25 = 375 (matches truth) EWMA forecast = y_50 ~ 350 (flat extrapolation; lags by 25) MEASUREMENT: ACCURACY axis vs truth 375.

dependencies 5 imports · 0 importers

syscalls.nx sketch_holt.nx sketch_ewma.nx sketch_comparator.nx sketch_types.nx sketch_holt_vs_ewma_trended_be

imports: syscalls.nxsketch_holt.nxsketch_ewma.nxsketch_comparator.nxsketch_types.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_holt_alloc nx_ewma_alloc nx_holt_add nx_ewma_add nx_ewma_safe_p nx_holt_forecast nx_ewma_value nx_cmp_accuracy nx_cmp_iabs iabs_he

structs

none

consts

none

functions

26func iabs_he(x: i64) -> i64
called by 1: main
31func main() -> i64