From 453df222d6408b9a766730d4eac0e6209937af0a Mon Sep 17 00:00:00 2001 From: Sam Fredrickson Date: Sat, 16 Nov 2024 14:07:52 -0800 Subject: [PATCH] Tweak the backtests. * Start from 2011 instead of 2013. * Validate over two years instead of one. --- NOTES.md | 2 +- model.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NOTES.md b/NOTES.md index 93842aa..724db16 100644 --- a/NOTES.md +++ b/NOTES.md @@ -112,7 +112,7 @@ After running comprehensive backtests across multiple periods from 2013-2024, we 1. Refined Backtest Framework - Implemented more granular 6-month step testing periods -- Standardized minimum training period (1 years) and validation window (8 years) +- Standardized minimum training period (2 years) and validation window (8 years) - Separated results into "normal" and "stress" periods for clearer performance assessment 2. Performance Evaluation Approach diff --git a/model.py b/model.py index 6e25075..5b97722 100644 --- a/model.py +++ b/model.py @@ -1019,6 +1019,8 @@ def run_projection(args): def run_projections(df): # Create main projection projection_starts = [ + "2011-01-01", + "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", @@ -1073,7 +1075,7 @@ def run_single_backtest(args): return {"params": params, "error": str(e), "success": False} -def run_systematic_backtests(df, validation_years=1, min_training_years=8): +def run_systematic_backtests(df, validation_years=2, min_training_years=8): """ Run a comprehensive suite of backtests with consistent validation periods. Uses sliding windows for both start and end dates. @@ -1083,7 +1085,7 @@ def run_systematic_backtests(df, validation_years=1, min_training_years=8): min_training_days = min_training_years * 365 # Define start date for reliable data - mature_start = pd.Timestamp("2013-01-01") + mature_start = pd.Timestamp("2011-01-01") last_possible_start = df["Date"].max() - pd.Timedelta( days=min_training_days + validation_days )