How longtuge-w/bond-risk-premium-by-machine-learning works
This repository is a bond-excess-return forecasting and strategy research project. Its principal workflow is to transform yield data into bond features and excess-return targets, generate recursive out-of-sample forecasts with conventional, neural, and ranking models, evaluate forecast accuracy, and backtest trading strategies. The README also describes macroeconomic predictors and predictor-importance analysis. The notebook’s implementation is not sampled, so those documented capabilities are represented without asserting unverified internal calls.
Main entry points: train_model.py Recursive forecasting · main.ipynb Research walkthrough · main.py Model experiments · preprocess.py Bond preprocessing
Components 14
Data preparation
- Bond preprocessing
preprocess.py - Research walkthrough
main.ipynb
Forecasting
- Recursive forecasting
train_model.py - Model fitting
train_model.py - Ranking forecasts
train_model.py - Model experiments
main.py
Evaluation and analysis
- Forecast metrics
train_model.py - Predictor importance
utils.py - Result visualizations
utils.py
Trading strategy
- Strategy backtesting
backtest.py - Strategy performance
backtest.py
Other components
- Researcher
- Yield data
- Macro data
Connections 13
- Researcher → Research walkthrough: runs analysis
README.md - Yield data → Bond preprocessing: provides yields
README.md - Macro data → Research walkthrough: provides predictors
README.md - Bond preprocessing → Recursive forecasting: prepares targets
README.md - Research walkthrough → Recursive forecasting: trains forecasts
README.md - Model experiments → Recursive forecasting: requests forecasts
- Recursive forecasting → Model fitting: fits models
train_model.py - Recursive forecasting → Forecast metrics: computes metrics
train_model.py - Model experiments → Ranking forecasts: runs rankers
- Forecast metrics → Result visualizations: summarizes results
README.md - Model experiments → Predictor importance: analyzes predictors
README.md - Research walkthrough → Strategy backtesting: runs backtests
README.md - Strategy backtesting → Strategy performance: calculates performance
backtest.py