Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Value-at-Risk (VaR) Modeling

This project implements Value-at-Risk (VaR) using two standard approaches:

  1. Historical Simulation (non-parametric)
  2. Parametric Variance–Covariance (assuming normal returns)

The objective is to estimate potential portfolio losses at 95% and 99% confidence levels, and to compare how assumptions about return distributions affect risk estimates.


1. Project Structure

  • main.ipynb — Jupyter notebook with full implementation
  • plots/ — saved figures (histograms, VaR cutoffs, comparisons)
  • requirements.txt — dependencies
  • README.md — project documentation

2. Methods

  • Data: Daily adjusted close prices from Yahoo Finance (yfinance) for selected tickers (AAPL, MSFT, GOOGL, AMZN, META, JPM, XOM, SPY).
  • Returns: Daily log returns.
  • Historical Simulation VaR: Empirical quantiles of the return distribution.
  • Parametric VaR: Normal distribution assumption, formula:
    [ \text{VaR}\alpha = - \big( \mu + z\alpha \sigma \big) ]
  • Portfolio: Equal-weight portfolio of all tickers.

3. Results & Interpretation (1-Day Horizon)

Sample window: 2020-01-01 → Current
Portfolio: Equal-weight, daily log returns

Historical Simulation VaR

  • Asset AAPL: VaR_95 = 3.17 %, VaR_99 = 5.22 %
  • Portfolio: VaR_95 = 2.3 %, VaR_99 = 4.47 %

Parametric VaR

  • Asset AAPL: VaR_95 = 3.25 % , VaR_99 = 4.63 %
  • Portfolio: VaR_95 = 2.49 % , VaR_99 = 3.55 %

Comparison (portfolio).

  • Historical VaR is typically more conservative, capturing empirical fat tails.
  • Parametric VaR assumes normality, which can underestimate tail risk.
  • Diversification reduced risk at the portfolio level vs single assets.

Figures:

  • hist_var_portfolio.png — histogram of portfolio returns with VaR cutoffs
  • var_comparison_portfolio.png — overlay of historical vs parametric VaR

4. Reflection

This project highlighted the importance of distributional assumptions in risk modeling. Historical VaR captured heavier tails compared to normal-based estimates, underscoring how parametric methods can underestimate risk.

Diversification effects were visible in the portfolio VaR, though tail sensitivity remains.

Next steps:

  • Extend to multi-day horizons (10-day VaR via square-root-of-time rule)
  • Implement Conditional VaR (Expected Shortfall)
  • Evaluate robustness with rolling windows and alternative weighting schemes

5. Requirements

Install dependencies with:

pip install -r requirements.txt

About

Value-at-Risk (VaR) modeling using Historical Simulation and Parametric (variance–covariance) methods at 95% and 99% confidence levels. Applied to equities and portfolio data with Python.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages