1. MATLAB® Products for Financial Risk Management & ModelingUse of COPULAS ANURAG JAIN
2.
3. Needs, Uses and Target Users Returns in real world are not normal, simple Pearson correlations don’t always work especially in tails Fat Tails and Tail Dependence need to be modeled separately Internal models for credit, market & operational risks (for Bank Capital Allocation based on Basel II): Problem: modeling of joint distributions of different risks Equity Portfolios: Estimation of covariances alone not sufficient to capture the real extreme movements among individual equities: portfolio risk manager has to optimize allocation Demo shown later 3/29/2010 3
4. Needs, Uses and Target Users Credit Portfolio: Individual default risk of an obligor can be better handled but not the dependence among default risks for several obligors Need better estimation of credit risk of a portfolio and corresponding VaR, Expected Shortfall Identify particular sector exposure and dependencies Energy & Commodities Trading Spread relationships dominate physical markets and asset hedging activities Need dependence among various spreads: refinery crack, spark, storage time, geographical (shipping and pipelines) A commodity or energy trader/quant would need to model these 3/29/2010 4
5. Needs, Uses and Target Users Pricingof Credit Derivatives, Structured Products First-to-default swap credit-linked products, CDOs, other exotic options etc. Li made Gaussian Copula famous but needed to look beyond normality assumption {Recall : Formula that killed Wall Street} Actuarial: Pricing of Life Insurance Products Relationship between individuals' incidence of disease Joint survival time distributions of multiple dependent life times Reinsurance: e.g. Pricing of Sovereign Risk Products Assess the risk of a large political risk reinsurance portfolio based on historical country risk ratings, sovereign ceilings, default rates and severity assumptions 3/29/2010 5
6. Advantages Understanding of dependence at a deeper level Highlight the fallacies and dangers of dependence only on correlation Copulas are easily simulated: allow Monte Carlo studies of risk Express dependence on quantile scale: useful for describing dependence of extreme outcomes VaR and Expected Shortfall express risk in terms of quantiles of loss distributions Allow fitting to MV risk factor data ; separate problem into 2 steps Finding marginal models for individual risk factors Copula models for their dependence structure 3/29/2010 6
7. Most Common Marginal Distributions Market portfolio returns Generalized hyperbolic (GH), or special cases such as: Normal inverse Gaussian (NIG) Student t and Gaussian Credit portfolio returns Beta Weibull Insurance portfolio returns and operational risk Pareto Log-normal Gamma All (and more) can be handled by “Statistics Toolbox” Model return time series with “Econometrics Toolbox”: ARMA & GARCH 3/29/2010 7
8. Copula Functions in MATLAB MATLAB’s “Statistics Toolbox” has many copula related functions and capabilities Probability density functions (copulapdf) and the cumulative distribution functions (copulacdf) Rank correlations from linear correlations (copulastat) and vice versa (copulaparam) Random vectors (copularnd) Parameters for copulas fit to data (copulafit) Available Copulas: Gaussian, Student -t and 3 bivariate Archimedean: One parameter families defined directly in terms of their cdfs: Clayton , Frank, Gumbel Combined with related toolboxes (Econometrics, Optimization, Financial etc.) MATLAB provides comprehensive, unique platform for risk modeling 3/29/2010 8
9. Demo Case Study: Joint Extreme Events For 1/1/1996 to 12/31/2000 daily (1262) logarithmic returns Xt = (Xt1, …Xt5) for 5 stocks (MSFT, GE, INTC, AAPL, IBM), interested in probability: P[X1 ≤ qa(F1),……, X5 ≤ qa (F5)] for a = 0.05 using four different models MV normal distribution N5( m, S ) calibrated via sample mean vector and covariance matrix Gaussian copula CPGa calibrated by estimating P via rank correlation Student-t copula Cnt calibrated via covariance matrix and degrees of freedom Clayton copula CqCl calibrated by MLE for 5 dimensional Clayton Copula 3/29/2010 9
10. Demo Case Study Results (Probabilities) Model 1): CRGa (a,....,a) = 0.035% Model 2): CPGa (a,….,a) = [0.062%; 0.066%] (for Kendall's or Spearman's method used to estimate P) Model 3): Cnt (a,….,a) = 0.162% for n = 4 Model 4): CqCl (a,….,a) = 0.25% for q = 0.465 Comparing these with historical frequency of event in 1996 - 2000 period qi is a-quantile under empirical distribution of Xi (for a = 0.05 and n = 1262 the qi is the 64th smallest of observations X1i, ..…, Xni), phist = 0.158% 3/29/2010 10
11. Demo Case Study Summary Estimating probability by simple MV normal distribution underestimates by factor of 4.5 Improvement using Gaussian copula via Spearman or Kendall’s tau Rank correlation Student – t copula gives the closest match with empirical probability Clayton copula : Best copula for modeling lower tail dependence MATLAB function for MLE parameter estimation for Clayton Copula would be a good addition 3/29/2010 11
12. Possible Extension & Improvements in Functionality: Future opportunities for demos by AE Dependencies among any kind of asset returns can be modeled using Copulas: Enable risk modeling and estimation, portfolio optimization and allocation, pricing Equities, Indices, Options Fixed Income, Credit products, Structured products Hedge funds and other alternatives Commodities, Electricity Insurance Macroeconomic Relationships Some examples in literature already exist A separate “Risk Management” toolbox or visible added related functionalities in Financial or Econometrics toolbox 3/29/2010 12
13. Alternatives R is the only other package that has most of the Copula functionalities Limited copula capabilities in Mathematica Can work in others: C++, Java etc. but need to build all functions/routines from scratch MATLAB has many advantages as discussed in following slides 3/29/2010 13
14. MATLAB vs. R Power/friendliness of user interfaces and documentation of MATLAB and R is light years apart MATLAB has a really mature GUI, help and documentation well laid out and browsable, for R need to search through multiple pages for simple task MATLAB, unlike R, has a working debugger, tool to find syntax errors and suggest improvements, a file dependency checker No Standards and Control for R: CRAN package repository features 2274 available packages Study by D. Knowles, U. Cambridge using (MATLAB R2008b & R 2.8.0 with Intel Core 2- 1.86 GHz processor, 4 GB RAM) showed MATLAB at par or better than R in speed 3/29/2010 14
15. MATLAB allows to develop complete models & applications with other toolboxes Example: Marginal distributions of an asset may require GARCH modeling Image taken from one of the recorded webinar at MathWorks site 3/29/2010 15
16. Deployment with multiple platforms possible Image taken from one of the recorded webinar at MathWorks site 3/29/2010 16
17. Selected References Bouy’e et al., Copulas for Finance, A Reading Guide and Some Applications, July 2000 Claudio Romano, Applying Copula Functions to Risk Management, part of PhD Thesis Trivedi & Zimmer, Copula Modeling: An Introduction for Practitioners, Foundations & TrendsinEconometrics, 1(1) (2005) 1–111 Schuermann, Integrated Risk Management in a Financial Conglomerate, http://nyfedeconomists.org/schuermann/ 3/29/2010 17
18. Backup: In Mathematical Terms For an m-variate function F, copula associated with F is distribution function C : [0, 1]m -> [0, 1] that satisfies F(y1, . . . , ym) = C(F1(y1),...,Fm(ym);θ) where θ is a parameter of the copula called the dependence parameter, which measures dependence between the marginals. 3/29/2010 18