VaR in financial risk management

GARCH Models in Python

Chelsea Yang

Data Science Instructor

Risk management mindset

Rule No.1: Never lose money

Rule No.2 Never forget Rule No.1

-- Warren Buffett

Buffett cartoon

GARCH Models in Python

What is VaR

  • VaR stands for Value at Risk

  • Three ingredients:

    1. portfolio
    2. time horizon
    3. probability
GARCH Models in Python

VaR examples

_1-day 5% VaR of $1 million _

5% probability the portfolio will fall in value by 1 million dollars or more over a 1-day period

10-day 1% VaR of $9 million

1% probability the portfolio will fall in value by 9 million dollars or more over a 10-day period

GARCH Models in Python

VaR in risk management

  • Set risk limits
  • VaR exceedance: portfolio loss exceeds the VaR

VaR exceedances

GARCH Models in Python

Dynamic VaR with GARCH

  • More realistic VaR estimation with GARCH

  • VaR = mean + (GARCH vol) * quantile

VaR = mean_forecast.values + np.sqrt(variance_forecast).values * quantile
GARCH Models in Python

Dynamic VaR calculation

  • Step 1: Use GARCH model to make variance forecast
# Specify and fit a GARCH model
basic_gm = arch_model(bitcoin_data['Return'], p = 1, q = 1, 
                      mean = 'constant', vol = 'GARCH', dist = 't')
gm_result = basic_gm.fit()
# Make variance forecast
gm_forecast = gm_result.forecast(start = '2019-01-01')
GARCH Models in Python

Dynamic VaR calculation (cont.)

  • Step 2: Use GARCH model to obtain forward-looking mean and volatility

    mean_forecast = gm_forecast.mean['2019-01-01':]
    variance_forecast = gm_forecast.variance['2019-01-01':]
    

     

  • Step 3: Obtain the quantile according to a confidence level

    1. Parametric VaR
    2. Empirical VaR
GARCH Models in Python

Parametric VaR

Estimate quantiles based on GARCH assumed distribution of the standardized residuals

# Assume a Student's t-distribution 
# ppf(): Percent point function

q_parametric = garch_model.distribution.ppf(0.05, nu)
GARCH Models in Python

Empirical VaR

Estimate quantiles based on the observed distribution of the GARCH standardized residuals

q_empirical = std_resid.quantile(0.05)
GARCH Models in Python

Let's practice!

GARCH Models in Python

Preparing Video For Download...