A forecasting package that implements the methodology from the paper "At Risk Transformation for U.S. Recession Prediction".
Working paper link: https://www.philadelphiafed.org/-/media/frbp/assets/working-papers/2025/wp25-34.pdf
at_risk/ # Core Package
├── forecasting.py # Recursive OOS Loop
├── models.py # ModelRegistry & Templates
├── evaluation.py # Metrics
├── data.py # Data Prep
├── config.py # Configuration
└── cli.py # Command Line Interface
data/ # Data Directory
├── raw/ # Original CSVs
└── processed/ # Pickle files
results/ # Outputs
├── predictions/ # Forecast .pkl files
└── figures/ # Exported Plots
notebooks/ # Visualization
└── Analysis.ipynb # Figures and tables for Publication
Install the package in editable mode:
pip install -e .Use the CLI to generate OOS forecasts:
python -m at_risk --horizons 3 6 12 --lags 3 6 12 --specific-sets Deter_StatesIncluded flags:
--horizons: Set forecasting horizon.
--lags: Add specific lags.
--rerun-all: Regenerate all results from scratch and overwrite existing results files.
--specific-sets: Rerun the forecasting loop for a specific predictor set.
--use-subset: Run the predictor set specifications with the parsimonious set identified in the paper.
Open notebooks/Analysis.ipynb to view performance tables and generate plots.