The objective of this tool was to give a measure of the Value at Risk of the given asset class using techniques like Historical simulation and Monte Carlo simulation. I was involved in the design of a package for estimating the Initial Margin requirement for OTC Derivatives like FX Forward Contracts and Interest Rate Swaps using Historical Value at Risk. I also designed a prototype for running a Monte Carlo simulation on a given stock using Geometric Brownian Motion.
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Value at Risk Engine
1. Value at Risk Engine
To compute the Initial Margin requirements for FX Forwards using
Historical Simulation
Name:
Company:
Area:
College:
Lov Loothra
Genpact
Finance
IMT Ghaziabad
2. Introduction & Agenda
Project deals with optimal computation of the Historical Value at
Risk (Historical VaR or HVaR) of FX Forward Contracts in order to
estimate Initial Margin requirements.
A
G
E
N
D
A
What is Value at Risk?
Why use VaR?
Techniques for computing VaR
Detailed description of the methodology used in the project
References
3. What is Value at Risk?
• A statistical tool which gives a measure of the market risk of an investment
• Requires 3 quantities to express completely:
i. The holding period, t
ii. The potential loss, x
iii. The probability for the said loss, p
• VaR is stated to be no more than x for a holding period of t with a probability of p
VaR @ 99% Confidence
Holding period of 10 days
$1 Million
$50,000
4. Why use VaR?
•
A popular and traditional measure of risk is Volatility
•
Problem: it does not care about the direction of an investment's movement
•
For investors, risk is about the odds of losing money
•
VaR fits the bill perfectly because we can use it to answer questions like
• "What is my worst-case scenario?"
• "How much could I lose in a really bad month?"
•
Usage of VaR grew tremendously post October 1994 with the release of J.P. Morgan’s
RiskMetric™ system
•
Basel Committee on Banking Supervision proposed in April 1995 to allow banks to calculate their
capital requirements for market risk using VaR
•
In our project, VaR estimate for FX Forward Contracts & IRS is used to determine Initial Margin
requirements
Initial Margin is a collateral that the holder of a financial instrument has to deposit to cover some or all of the
credit risk of their counterparty. It is usually supposed to be large enough to cope with one-day losses on most
days. As VaR is capable of giving an estimate of worst case scenarios, we can use it to help the firm estimate initial
margin requirements.
7. Monte-Carlo Simulation
• Geometric Brownian motion is applied to stocks in order to simulate future scenarios.
This is modeled as:
dSt = μ St dt + σ St dWt
Here,
St
μ
σ
Wt
stock price at time t
is the ‘drift’ of the stock
is the ‘volatility’ of the stock
is the stochastic randomness factor
• Stochastic Randomness is simulated by using a pseudo random number generator (we
used the Mersenne Twister in our implementation)
• Drift, volatility and initial price of the stock are fed into the model and a large number
of simulations are run to generate simulated ‘paths’ for the stock
• P&Ls are calculated for the simulated values & sorted in descending order of losses
• Finally, the value at pth percentile of the P&Ls is selected as the VaR
9. Historical Simulation
• Non-parametric approach to VaR estimation: makes no assumption about the
distribution of the underlying observations
• Works by using historical values of assets returns over a large period of time and
applying them to the current value to generated ‘simulated’ values
• Simulated values are used to compute P&Ls w.r.t. the base price at computation date
• P&Ls are then sorted and the value lying at a certain percentile (based on the required
confidence interval) gives us the VaR estimate
• Example: For 1000 simulated values and a confidence interval of 99%, the observation
that determines VaR would be the (1% x 1000)th = 10th observation
• We used a modified historical simulation methodology in our project to compute FX
Forward margins the details of which are given in the following slides
10. Detailed Methodology
• Obtain historical rates over the last 10 years from a reliable source for the currency
pair for all required tenor points
• First 5 years are inputs pertaining to volatility computations whereas the next 5 are for
the actual simulation
• Assuming we have 16 tenor points, we get the following 5-year zero-rate matrix:
R1, 1
R1, 2
R1, 3
R2, 1
R2, 2
R2, 3
R3, 1
R3, 2
R3, 3
…
…
…
R1265, 1 R1265, 2 R1265, 3
…
…
…
…
…
R1, 16
R2, 16
R3, 16
…
R1265, 16
• Compute the 5-day Log Return Matrix by taking the log of ratio of the continuously
compounded zero rates and the fifth-previous business day
rt,j = log (Rt, j / Rt–5, j)
11. Detailed Methodology contd.
• Applying the log returns formula to our matrix, we get:
r1, 1
r2, 1
r3, 1
…
r1, 2
r2, 2
r3, 2
…
r1, 3
r2, 3
r3, 3
…
r1260, 1
r1260, 2
r1260, 3
…
…
…
…
…
r1, 16
r2, 16
r3, 16
…
r1260, 16
• Compute a time series of volatility forecasts: EWMA (exponentially-weighted moving
average) was used to construct a model capable of reacting to changes in the
underlying volatility:
σ2t, j = (1 – λ) r2t–1, j + λσ2 t–1, j
Here,
σ
r
λ
volatility forecast
log return
time decay coefficient of historical log returns
• To avoid model error, first 5 years of data was used to generate a seed value for the
EWMA forecast with the first value seeded as the square of the returns
12. Detailed Methodology contd.
• Applying the aforementioned transformation to our matrix, we get:
σ1, 1
σ2, 1
σ3, 1
…
σ1260, 1
σ1, 2
σ2, 2
σ3, 2
…
σ1260, 2
σ1, 3
σ2, 3
σ3, 3
…
σ1260, 3
…
…
…
…
…
σ1, 16
σ2, 16
σ3, 16
…
σ1260, 16
• Volatility Smoothing is performed to reduce noise and account for unwarranted
fluctuations in margins and is done by averaging the forecasted volatility over a short
look-back horizon:
σ't, j = σ't–1, j + α (σt, j – σ't–1, j)
α = 2 / (L + 1)
Here,
σ'
α
L
smoothened volatility
smoothing coefficient
look-back horizon (10 days in our project)
• Introduce the volatility floor around the least value of the implied volatility observed
in a short period to prevent low margin values
13. Detailed Methodology contd.
• Flooring is done using the following equation:
σ''t, j = max { σ't, j , X% }
Here,
σ''
σ'
X%
modified volatility after the flooring
smoothened volatility
97th percentile of recent sample of volatilities
• Calculate scaling coefficients by dividing the forecasted volatility by the historically
determined EWMA volatility:
Ct, j = σ''t, j / σ't, j
• After applying the above formula to our matrix, we get:
C1, 1
C1, 2
C1, 3
C2, 1
C2, 2
C2, 3
C3, 1
C3, 2
C3, 3
…
…
…
C1260, 1 C1260, 2 C1260, 3
…
…
…
…
…
C1, 16
C2, 16
C3, 16
…
C1260, 16
14. Detailed Methodology contd.
• Calculate scaled returns by taking the product of the scaling coefficient and the
historical 5-day log return for each scenario and tenor point
• We generate a matrix of scaled returns as follows:
r1, 1
r2, 1
r3, 1
…
r* =
r1, 3
r2, 3
r3, 3
…
r1260, 1
r* =
r1, 2
r2, 2
r3, 2
…
r1260, 2
r1260, 3
C1, 1 x r1, 1
C2, 1 x r2, 1
C3, 1 x r3, 1
…
C1260, 1 x r1260, 1
… r1, 16
… r2, 16
… r3, 16
…
…
… r1260, 16
C1, 2 x r1, 2
C2, 2 x r2, 2
C3, 2 x r3, 2
…
C1260, 2 x r1260, 2
x
C1, 1
C2, 1
C3, 1
…
C1260, 1
C1, 2
C2, 2
C3, 2
…
C1260, 2
C1, 3 x r1, 3
C2, 3 x r2, 3
C3, 3 x r3, 3
…
C1260, 3 x r1260, 3
• Here, r* represents the matrix of scaled log returns
C1, 3
C2, 3
C3, 3
…
C1260, 3
… C1, 16
… C2, 16
… C3, 16
…
…
… C1260, 16
…
C1, 16 x r1, 16
…
C2, 16 x r2, 16
…
C3, 16 x r3, 16
…
…
… C1260, 16 x r1260, 16
15. Detailed Methodology contd.
• Compute the Shocked US Zero Curves and Shocked FX Forward Curves by applying the
matrix of scaled log returns to the base curves (US Zero curve and FX Forward curve)
as on the margin date:
R*t, j = R T, j · e ^ (r*t, j)
Here,
R*t, j
RT, j
r*t, j
shocked curve of the jth tenor point
base curve on the margin date
scaled log returns at time t & tenor point j
• Base curve matrix, R, where t = the margin date for all tenors is [R1, R2, … , R16]; the
final matrix of 1260 scenarios is obtained as shown below:
R* =
R1 e^(r*1, 1)
R1 e^(r*2, 1)
R1 e^(r*3, 1)
…
R1 e^(r*1260, 1)
R2 e^(r*1, 2)
R2 e^(r*2, 2)
R2 e^(r*3, 2)
…
R2 e^(r*1260, 2)
R3 e^(r*1, 3)
R3 e^(r*2, 3)
R3 e^(r*3, 3)
…
R3 e^(r*1260, 3)
…
…
…
…
…
R16 e^(r*1, 16)
R16 e^(r*2, 16)
R16 e^(r*3, 16)
…
R16 e^(r*1260, 16)
16. Detailed Methodology contd.
• Compute Portfolio Value from the shocked forward curve for all scenarios:
SC1, 1
SC2, 1
SC3, 1
…
SC1260, 1
SC1, 2
SC2, 2
SC3, 2
…
SC1260, 2
SC1, 3
SC2, 3
SC3, 3
…
SC1260, 3
…
…
…
…
…
SC1, 16
SC2, 16
SC3, 16
…
SC1260, 16
⇒
PV1
PV2
PV3
…
PV1260
• Compute the portfolio Profit/Loss (P&L) by taking the difference between the
Portfolio Value for each scenario & the Base Portfolio Value on the margin date:
PV1
P&L1
PV2
PV3
P&L2
P&L3
…
PV1260
– Base Price margin-date =
…
P&L1260
• Sort the P&Ls in ascending order of losses and use the required confidence interval
(99.7 in our project) to extract the required margin:
Required value of Initial Margin = P&L0.3th
17. FX – Forward HVAR Implementation
Shocked US Zero Curve
18. Status and Future Scope
• The tool that I’ve developed is now capable of accepting new trades via an input form
and computing the Initial Margin for EURUSD FX Forward Contracts
• I’ve added dynamic support for up to 19 tenor points and potentially unlimited
historical data
• Support for other currency pairs would need to be added
• We also used a similar methodology to compute initial margin requirements for
Interest Rate Swaps
19. References
1. Linsmeier, Thomas J. and Pearson, Neil D. “Risk Measurement: An Introduction to
Value at Risk”, University of Illinois at Urbana-Champaign, July 1996
2. J. P. Morgan/Reuters “RiskMetrics™: Technical Document”, Fourth Edition, 17
December 1996
3. Elliot, Timothy R. “Certification of the Change in Performance Bond Methodology from
SPAN to HVaR for cleared OTC FX Spot, Forward and Swap Transactions”, Chicago
Mercantile Exchange Rule Submission, 30 March 2012
A stock can be volatile because it suddenly jumps higherVaR is closely connected with initial margin requirements of clearing corporations
> The period, of course, may vary depending upon the level of rigor required> The data should now be ‘cleansed’ by comparing to Bloomberg quotes and identifying any dates where the forward rates were not in line with a trend analysis and examination of the curves.> Where, R1, 1 ≡ Rate (Time 1, Tenor 1); R1, 2 ≡ Rate (Time 1, Tenor 2); and so on
Where, r1, 1= log (R6, 1 / R1, 1); r1260, 16= log (R1265, 16 / R1265, 16); and so on.λ was set to 0.97 in our project based on previous experience and testing.
σ22, 1= (1 – λ) r21, 1 + λσ21, 1; and so on
After applying the aforementioned floor, any volatility value falling in the calibrated lower percentile of historical volatilities is floored out to mitigate any adverse effects of sudden market correctionsWhere, C1, 1= σ''1, 1 / σ'1, 1; C1, 2= σ''1, 2 / σ'1, 2; and so on.
Where, r*1, 1= C1, 1 * r1, 1; r*1, 2= C1, 2 * r1, 2; and so on
Margin computation is portfolio specific and hence the steps from this point forward only outline the necessary approachSC1, 1= to R1 e^( C1, 1 * r1, 1)