This project implements a Static Parametric (Variance–Covariance) VaR model to estimate potential losses of an equity portfolio under the assumption of normally distributed returns.
The model is designed for snapshot risk estimation and is not intended for backtesting or regulatory capital calculations.
To calculate portfolio VaR using volatility, correlation, and confidence levels.
- User inputs portfolio constituents, weights, confidence level, holding period, portfolio value, and lookback window.
- Historical adjusted prices are downloaded from Yahoo Finance.
- Log returns are calculated for each asset.
- Portfolio returns are computed using user-defined weights.
- Mean and volatility are estimated from a fixed historical lookback window.
- Parametric VaR is computed using the normal distribution assumption.
- Multi-day VaR is scaled using the square-root-of-time rule.
- Returns are assumed to be normally distributed.
- Volatility is assumed constant over the estimation window.
- Square-root-of-time scaling assumes i.i.d. returns.
- The model is static and does not include rolling recalibration or backtesting.
Assets: AAPL, MSFT, GOOGL
Weights: 0.40, 0.25, 0.35
Confidence Level: 95%
Holding Period: 10 days
Lookback Window: 100 days
Portfolio Value: $ 1,000,000
Output: Estimated mean return: 0.001964 Estimated volatility: 0.010352 VaR (95%, 10-day): ~ $60,000k
- Value at Risk (VaR)
- Holding Period
- Portfolio volatility
- Z-score and confidence levels
- Python
- NumPy
- SciPy
Initial version – input-based VaR calculation.
- Rolling-window VaR estimation
- VaR backtesting and exception analysis
- Comparison with Expected Shortfall
- Clone the repository
- Install dependencies: pip install -r requirements.txt
- Run the script: python static_parametric_var.py
- Enter portfolio details when prompted.