Prediction intervals for stock returns using conformal prediction.
Outputs 5-day return intervals for any ticker. The intervals have coverage guarantees - if you ask for 90% coverage, backtesting shows ~90% of actual returns fall within the intervals.
- Model: Quantile regression trained on ~20 features (momentum, volatility, RSI, MA distances, etc.)
- Calibration: Split conformal prediction to adjust intervals based on recent residuals
- Validation: Walk-forward backtesting to verify coverage holds out-of-sample
Backtest results (SPY, AAPL, MSFT, GOOGL, NVDA, 2021-2024):
- Target: 95% coverage
- Actual: 92.3% coverage
- 3,755 total predictions
Backend:
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000Frontend:
cd frontend
npm install
npm run devcurl -X POST http://localhost:8000/predict \
-H "Content-Type: application/json" \
-d '{"tickers": ["SPY", "AAPL"], "coverage": 0.9}'- FastAPI, scikit-learn, yfinance
- React, Recharts
- Data from Yahoo Finance