A0067927 amit sinha_thesis


Published on

copyright reserved. copying allowed after consent.

Published in: Economy & Finance, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

A0067927 amit sinha_thesis

  1. 1. Thesis to get the degree of Master of Science in Financial EngineeringPricing and Exposure measurementof IR derivatives:A Short rate model approach A0067927 SINHA Amit Kumar 25/11/2011 National University of Singapore Risk Management Institute
  2. 2. Dedicated to my parents
  3. 3. ContentsAbstract 11 Theory and Implementation Notes 3 1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Quantitative measure of Counter-Party Exposure . . . . . . . . . . . 4 1.3 Interest rate derivatives and their analytical pricing . . . . . . . . . . 9 1.4 Short Rate Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.5 Simulation Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Model Implementation and Results 23 2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2 Bootstrapping yield curve . . . . . . . . . . . . . . . . . . . . . . . . 23 2.3 Calibrating CIR Model . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.4 Calibrating Hull-White 1 Factor Model . . . . . . . . . . . . . . . . . 29 2.5 Exposure Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . 313 Appendix 41 3.1 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.2 Market Data and Matlab Code . . . . . . . . . . . . . . . . . . . . . 41Nomenclature 47 i
  4. 4. AbstractPricing and Exposure measurement of IR derivatives:A Short rate model approachShort rate models have been very popular and still in use for term-structure mod-elling, pricing and hedging interest rate derivatives. Under short rate model, bothequillibrium model and no-arbitrage models have been actively used for derivativepricing and risk management. Potential Future Exposure ,however, is a relativelynew entrant. PFE modelling can be used effectively to calculate exposure at dif-ferent level: trade level, portfolio level,counteryparty level. We compare the resultsobtained from these two models and show that PFE evolution for a longer term isvery much model dependent and initial.Here we use one tradtional term-structure approach model: Cox–Ingersoll–Ross(CIR)model and no-arbitrage model: Hull-White 1-factor model to evolve interest rate,price interest rate swaps and calulated exposure metrics. We assume pure interestrate risk to reduce correlation measurement. Term structure modelling: Market In-terest Rate data(US) is used to construct an initial discount curve. Term-structuremodelling/fitting is performed based on this initial Zero coupon yield curve. CIRmodel parameters are estimated based on intial DF curve. HW1F model is cali-brated based to interest rate caps. Pricing Methodology: Pricing of Interest rateswap is performed under deterministic model, assuming expected forward rate can becalculated based on inital discount curve. For interest rate options, pricing modelis also a short model based approach. Market simulation modelling: Short ratemodels with monte-carlo, which are also risk neutral models, are used to simulatefuture IR risk variables( short rate,instanenous forward rate,etc) . PFE measure-ment: Based on the simulated future risk variables ,MTM of contract/portfolio iscalculated at for number of simulations and at a particular monitoring frequency.Netting/non-netting effects amd effect of diversification in a IR portfolio is studied.In conclusion we demonstrate the effect of netting and diversification in a port-folio.Effect of downward and upard sloping yield curve on exposure measurement.Also, as shown in different literature a comparison of HW1F and CIR model. 1
  5. 5. 1 Theory and Implementation NotesThis section contains some of the theory relevant to this thesis as well as somespecific implementation notes.1.1 MotivationSince Barings in 1995 to Lehman, AIG in 2008, finance domain has experiencedmany disasters in last two decades. Other than incurring great losses and economicslowdown these incidents have also forced us to think about better ways to managerisk. Credit crisis of 2008 was particularly important in bringing risk managementat the heart of financial institutions.Particularly, managing risk in OTC instrumentshas become very crucial.Value at Risk(VaR) has been adopted and recommendedwidely as a measure to check market risk. Another component of financial risk iscounter-party risk. Profit and loss over an OTC contract becomes even more diceyand asymmetric in in case of counter-party default. A lot of effort has recently goneinto account for the counter-party credit risk in OTC market. It turns out thata methodology for pricing and measuring future exposure of derivatives contractand their portfolio forms most important component of Counter-party credit riskmeasurement. We will use a dynamic term structure modeling and pricing coupledwith Monte-carlo simulation technique to capture Price and exposure of derivativescontract/portfolio.In rest of the thesis , we will discuss methodology to captureportfolio/contract exposure of interest rate derivatives.Counter-party exposure measurement serves as very effective risk management toolto manage credit limits on a given counter-party. Just like VaR, it can give asimple and easy to explain representation of exposure to a counter-party to be putin front of the management board or regulatory bodies. This can be used top decidedifferent policies w.r.t to lending and amount of credit limit to each counter-party.A good counter-party can worsen and a bad counter-party can improve on its creditworthiness.These exposures can also be updated and monitored from time to time.Management or regulatory bodies can set a cap on credit line to a particular counter-party and limit the losses in case there is a actual counter-party default. Firms canuse other mitigation methods like netting and collateral to reduce loss if counter-party defaults. These effects can also be incorporated in Exposure measurementand effects of these measures can be demonstrated. Therefore a metric to measurecounter-party exposure also helps in implementing exposure aggregation provisions. 3
  6. 6. Chapter 1 Theory and Implementation NotesFuture pricing and exposure measurement can serve as input to other quantitativemeasures like Counter-party value adjustment (CVA).These measures have becomesexceedingly important in present times and they are part of internal rating basedmodel under Basel II accord..1.2 Quantitative measure of Counter-Party ExposureExposure can be aggregated at different hierarchies: 1. Trade/Contract level: Considering exposure of each trade separately. 2. Counterparty level:Considering exposure against each counterparty along with credit risk mitigation techniques 3. Portfolio level: Considering exposure of portfolio as a whole against all counter- parties.Asymmetric nature of Exposure:As in other circumstances , the contracts at the timeof default are settled based on MTM values.If a defaulted counter-party cannot paythe MTM value then its a loss to the party (+MTM ). If the party owes MTM to adefaulted counter-party, the party is still obliged to make payments (-MTM).A simple illustration:We consider a single IR swap with current MTM value asMTM(t). So exposure is defined as E(t) = max(M T M (t)i , 0)Credit risk mitigation techniques:ISDA Master agreement and Credit support annex outline several agreement thatcounterpaties can have in a OTC contract to limit exposure in time of counter-partydefault. • Netting agreement: It is a legal contract that allows parties to aggregate positions in case of default. Agreement could be made to decide on the trades that could be netted together. Typically in a portfolio, there would be some netting and some non-netting. Exposure with Netting: E(t) = max( M T M (t), 0)i A combination of netting and non-netting sets: E(t) = max( M T M (t), 0)i + max(M T M (t)i , 0)4 4
  7. 7. 1.2 Quantitative measure of Counter-Party Exposure Without Netting 5
  8. 8. Chapter 1 Theory and Implementation Notes With Netting • Collateral and margin agreement: It is one of the most commonly used risk mitigation method. Collateral agreement is a legally binding agreement where the counter-party has to provide securities when it is ’out of the money’. Collat- eral is posted if the MTM is more than a per-determined threshold. Exposure with collateral can be modeled as : E(t) = M ax( M T Mi − C(t))Trade level counter-party credit exposure metricWe will start with a figure to represent different exposure related quantities.6 6
  9. 9. 1.2 Quantitative measure of Counter-Party ExposureAll the risk measures can be approximated either analytically or by simulation ofmarket risk factors. As we shall see later, we have used Monte-carlo simulation basedapproach to calculate there exposure related metrics. Simulation based approachprovides us extra flexibility in terms of evolving risk factor such as interest rate likeany popular practitioners model( like HW1F,HJM,CIR, etc). 7
  10. 10. Chapter 1 Theory and Implementation NotesValue of these exposure metrics depend on two most important factors: 1. Evolution of risk factor in future time and underlying risk factor volatility.This factor is more of a model dependent phenomenon. For example- A mean reversion model will control the evolution of risk factor in longer term by models rate of mean reversion and long term rate. 2. Secondly the nature of the contract also plays an important role. In some contracts the exposure increases with time as they may only have a single or concentrated cash-flow towards the maturity of the deal. Others may have uniform payment at a particular frequency and thus, exposure gets amortized as we reach towards the maturity of the deal. • Current Exposure: Current exposure is the value of contract lost if the the counter-party defaults now. Current exposure for any contract is typically same as the MTM value. At the start of a par contract, current exposure is usually zero. • Expected Exposure: It is the average value of counterparty exposure at any given time before the maximum tenor in the portfolio. EE(t) = AV ERAGE[M ax( Vi (t), 0)] • PFE or Potential future exposure : It is the exposure that will not be exceeeded with certain confidence interval a. P F E(t) = inf {X(t) : P (E(t) ≥ X(t)) ≤ 1 − α} PFE reminds very closely of Var for except there are certain differences: – VaR will typically be calculated at one fixed horizon, where as PFE is evaluated at different points(t) before the maturity of a contract. Com- bination of all these PFE(t) gives us a PFE profile. – VaR is a loss where as PFE represents a gain in the contract. – VaR is a measure of Market Risk where as PFE is a measure of Counter- party credit risk. • Maximum PFE: It is maximum value of PFE through time ,through all sce- narios at t given confidence interval. maxP F E(α) = max[EE(ωi , tk )] where w(i),tk represent each path and each time step respectively. • Expected Positive Exposure: It is the weighted average of Expected Exposure over time. EP E = Average(EE(t))8 8
  11. 11. 1.3 Interest rate derivatives and their analytical pricing • Effective Expected Exposure: It is a non decreasing function of Expected Exposure through time. EEE = M ax(EEi , EEEi−1 ) • Effective EPE:Time weighted average of EEE. 1 Ef f EP E = EEE(ti ) t tIt is important to understand that bottle-neck in Expsoure measurement is the com-bination of pricing methodology,factor simulation modeling and MTM calculationat each time step for number of simulation. Our work mainly will focus on theselines. Generating different exposure metric is quite simple once MTM simulationsthrough time is available.Exposure at Default(EAD):As part of regulatory capital calculation under Basel II , EAD is used as a parameterto calculate economic capital. EAD calculation under internal rating based modelis based on Effective EPE methodology. EAD = a x Effective EPEwhere a lies between 1.2 to Interest rate derivatives and their analytical pricingOur portfolio will consist of IR instruments so, its worthwhile to understand basicnature and popular pricing methods. In this section we will touch upon IR swapsand IR options. We will also discuss procedure to construct discount curve givenset of liquid market instruments. This procedure will be utilized in our analysis.IR Swap:We will discuss the most vanilla form of Interest rate swaps which a fixed-float samecurency swap instrument. 9
  12. 12. Chapter 1 Theory and Implementation NotesA swap has two payment legs: 1. Fixed Leg:fixed payer pays fixed rate through out the swap maturity on pre- determined coupon payment dates. In the figure above, Fixed leg payers pays two coupons of size C/2 at 6m and 1y respectively. Floating leg payer receives these fixed leg payments. 2. Floating Leg: Floating leg payer pays floating leg which a benchmark rate (like LIBOR) every floating leg coupon payment date. A vanilla swap has floating leg which is reset in advance which means that floating rate paid at 3m is being set at 0m (figure above).Price of a receiver IRS is given by : P rice(IRS) = P V (F ixedleg) − P V (F loatleg)IR Options:We will discuss European calls and puts on interest rates. These calls(or puts) areon a liquid benchmark which is usually of short maturity. There are also other kindof options on interest rate derivatives like swaptions ,but we are not delving in tothem for the sake of being focused.The most basic building block for a Interest rate option is a caplet or a floorlet.Caplet can be defined as a ’single’ option to buy a floating rate at a particular strikerate. For instance- A Caplet can be an option on 6M LIBOR to buy this particularbenchmark at ,say, 5%. Lets suppose today is t and 6M LIBOR will be resetting onT and end of period will be T+6MTherefore the payoff from caplet at the end of T+6M will be : M ax(L6M (T,T +6M ) − 5%) ∗ DCF (T, T + 6M )10 10
  13. 13. 1.3 Interest rate derivatives and their analytical pricingPrice of a caplet ,therefore , will be simple the discounted expected value of abovepayoff. P rice = Z(t, T + 6M ) ∗ E[M ax(L6M (T,T +6M ) − 5%) ∗ DCF (T, T + 6M )]Cap then is just a series of caplets with same strike rate.Market practice is to priceeach caplet with Black’s formula (to be discussed soon) and add them to get capprice. As we will see, Cap prices are usually quotes in in terms of volatility impliedby Black’s formula.Bootstrapping DF curve:In order to price swap , we need to discount each coupon payment of each leg toits present value. One way to calculate initial discount curve is by bootstrappingdiscount factors from actively traded interest rate instruments: 1. Money market instruments like interbank lending rates (example-LIBOR rates) which can available up to one year maturity. 2. Euro dollar futures: Some of these instruments are very liquid. Instruments with high liquidity have very lower liquidity. 3. Swaps: We get market quoted swap rates for a large tenor (up to 30y).Below we describe procedure to boot strap DF from MM instruments and Swap:First part is to build DF curve using cash rates quoted in the marketDiscount factor Z(T)of the cash rates can be calculated using simple present valueformula: 1 Z(T ) = ((1+r(T )a(0,T ))Where a is the Day count factor as per the money market day count basis. Discountfactors for rates up to 9M cash deposit rates can be calculated using above relation-ship. Day count fraction basis used is Act/360. We can define DF as of today as 1,in that case DF at spot date(t+2) will not be 1.The discount factors calculated for all the maturities staring 3m will be adjustedusing overnight(o/n) and tom-next rate(t/n). First we calculate overnight discountfactor as : 11
  14. 14. Chapter 1 Theory and Implementation Notes 1 ((1+.29 = 0.999998Next, we use the tomorrow next rate to calculate the discount factor for the spotdate. The tomorrow next rate is a forward rate between trade day plus one businessday to trade date plus two business days. Therefore, the discount factor for the spotdate is: 1 ((1+.302 = 0.99998Discount factors from Swap rates:In order to extract DF from swap rate, we consider following par swap rate, S(t).We also assume that Libor Swaps are quoted mid-market, semi-annual swap ratesand pay the floating 3-month Libor rate.The fixed leg of a swap is calculated by adding up the PVs of all future cash flows: nf ixedP V F IXED = S(t) (J=1) αj Z(0, Tj )For the Floating leg: nf loatP V F LOAT = (J=1) Lj αj Z(0, Tj )Where Lj is the LIBOR forward rate for settlement at Tj-1 .Lj = F (Tj , Tj − 1) 1 Z(0,T(j−1) )Lj = αj ( Z(0,Tj ) − 1)Using above relationship in floating PV calculation we get: (nf loat) 1 Z(0,T(j−1) )P V F LOAT = (J=1) αj ( Z(0,Tj ) − 1)αj Z(0, Tj ) (nf loat) Z(0,T(j−1) )P V F LOAT = (J=1) )( Z(0,Tj ) − 1)Z(0, Tj ) (nf loat)P V F LOAT = (J=1) (Z(0, T(j−1) ) − Z(0, Tj ))P V F LOAT = 1 − Z(0, T(nF loat) )For a par swap, P VF LOAT IN G = P VF IXEDTherefore we can put them together as: (nf ixed)S(tn ) (J=1) αj Z(0, Tj ) = 1 − Z(0, T(nF loat) )After rearranging for nth period DF and assuming nf ixed = nf loat we get, (n−1) (1−S(tn ) (J=1) αZ(0,Tj ))Z(0, Tn ) = (1+αn S(tn ))We can use the expression above to calculate the discount factor associated with thelast swap coupon payment. In order to use this expression to calculate 1YR DF, we12 12
  15. 15. 1.3 Interest rate derivatives and their analytical pricingneed 1 YR swap rate and discount factor associated with fixed leg of the underlyingpar swap. (6M ) (1−S(t1Y ) (J=1) aZ(0,Tj ))Z(0, T1Y ) = (1+a6M −12M S(t!Y )) )Here assumption is that the underlying swap is quoted semi-annually with Act/360For Swap rate 1Y=0.5180%, DF 1Y is Z(0, T1Y ) = 0.99477Interpolation:It is also worth noticing that Swap are not quoted for all tenors, therefore it usuallycomes down to a good interpolation method to back out DF at in-between points.We can either interpolate between rates or we can interpolate between DF. It isusually better to interpolate between DF because DF curve is monotonically de-creasing with tenor so it is usually provides smoother and better approximation formissing DF points. Zero coupon curve on the other hand may have different shapesdepending on the market forces it may exhibit a uniformly increasing then flatten-ing curve or a hump shaped curve of a decreasing curve. This makes interpolationbetween rates less accurate. Once DF is calculating rates can be backed out basedon formulas we discussed already.For example-The 2-year semiannual par-swap rate is quoted as 0.770%.In order to calculate Z(2Y ) we need to use following relationship: (18M ) (1−S(t2Y ) (J=1) aZ(0,Tj ))Z(0, T2Y ) = (1+a18M −24M S(t2Y )) )Above is an equation with two unknowns: Z(0, 18m), Z(0, 2Y R).We order to esti-mate Z(0, 2Y ) ,we have to use some interpolation method. We use linear interpola-tion method in discount factors: 1Z(0, 18m) = 2 (Z(0, 1Y R + Z(0, 2Y R))Using above equation is our standard discount factor calculation formula we obtainZ(0, 2Y R) as: 0.98450Forward LIBOR:Putting it all together we have Discount factor curve from trade date to 5Y forstandard tenor points. These discount factors can be used to generate forward ratecurve for valuation of swaps in our problem statement Forward rate between anytwo dates T1 and T2 from the discount curve for a given trade/ spot date can becalculated as: 1 Z(0,T1 )L1X2 = a1X2 ( Z(0,T2 ) − 1) 13
  16. 16. Chapter 1 Theory and Implementation NotesDF Curve:Putting all these relationships in a tabular form we get following discount factors:Below is the DF curve as obtained from the market instruments upto 5Y Data:This Market data used here is just for illustration purpose. In order to obtain resultsfor the thesis more data points have been used. Results will be produced in the nextsection.After boot-strapping with the full market data we will also fit a cubic slpine usingmatlab sub-routine so that we can get a DF for any tenor.14 14
  17. 17. 1.3 Interest rate derivatives and their analytical pricingPricing a vanilla swap using deterministic model:Deterministic pricing of swap has the same underlying principle as bootstrapping.We say that Expected forward LIBOR rate can be calculated from present yieldcurve. E(F (t, T, S) = 1 ( Z(t,T ) αT XS Z(t,S) − 1)Where E= expected valueWe will define following convention:LongSwap = F ixedleg − F loatingleg(Receivef ixed, payf loating)ShortSwap = F loatingleg − F ixedleg((Receivef ixed, payf loating)Value of swap is given by : P rice(IRS) = P V (F ixedleg) − P V (F loatleg)The fixed leg of a swap is calculated by adding up the PVs of all future cash flows: nf ixedP V F IXED = S(t) (J=1) αj Z(0, Tj ) x NotionalWhere S(t) is the swap rateFor the Floating leg: nf loatP V F LOAT = (J=1) Lj αj Z(0, Tj ) x NotionalWhere Lj is the LIBOR forward rate for settlement at T(j−1) .L1X2 = 1 ( Z(0,T1 ) α1x2 Z(0,T2 ) − 1)Pricing a IR Cap using Black model:Under Black’s model we assume that forward libor rate/forward interest rate is log-normally distributed. Under BS framework it becomes intuitive to have closed formsolution like this for each caplet: N∗ t ∗ Z(t, T + t) ∗ [f (t0 , T, T + t)N (d1) − K ∗ M (d2)]Where ln(f (t0 ,T,T + t)) σ 2 ∗T K + 2 d1 = √ σ∗ T 15
  18. 18. Chapter 1 Theory and Implementation Notes ln(f (t0 ,T,T + t)) σ 2 ∗T √ K − 2 d2 = √ = d1 − σ ∗ T σ∗ TPlease note the discounting and volatility scaling used in the above formula. Capletis discounted for the full period and volatility is scaled only till the point of obser-vation.Therefore price of a European cap is simply the summation of caplets using aboveformula. Formula floorlets put can be obtained in the similar way.1.4 Short Rate ModelsThough short rate models are not the only and most advanced models that currentlyin use, We will use two short rates models( CIR and HW1F) because of two mainreasons: 1. They are fast: We can restore to market model frame work like HJM or BGM but calibration process is too time consuming. The idea of measuring exposure is not get the most accurate pricing ,but to get fairly accurate results based on a market accepted model. Typically the size of portfolio to be examined will have thousand of contracts and will be become very computationally expensive if we resort to very complex modeling methodology. 2. They are still in use: short rate models have performed reasonably well and are still being used. They have consistently provided accurate pricing of vanilla swaps and options.Short rate: it is an instantaneous interest rate r(t) applicable for an investmentbetween period tand t + dt .For a bond maturing at Time T , price can be written in terms of short rate : ´T P (t, T ) = E[e− t r(t)dt ]Where E is the expected value under risk neutral world.CIR Interest Rate ModelCIR model belongs a family of processes given by: dr = a(t)[θ(t) − r(t)]dt + σ(t)r(t)β dW (t)16 16
  19. 19. 1.4 Short Rate ModelsFor Cox-Ingersoll-Ross process β = .5, a square root process, This ensures that theshort rate never goes negative. Sigma in CIR process will change in proportion thethe square of short rate. We will estimate a and θbased on discount curve generatedusing boot strapping method and cubic spline DF generation.For Estimation , We will compute zero coupon prices for current market data usingfollowing closeed form formulas: P (t, T ) = A(t, T )e−B(t,T )rWhere r is short rate. Short rate assumed in the overnight rate for current marketdata. φ1 eφ2 (T −t) A(t, T ) = ( )φ3 φ2 (eφ1 (T −t) − 1) + φ1 eφ1 (T −t) B(t, T ) = ( ) φ2 (eφ1 (T −t) − 1) + φ1 √ φ1 = a2 + 2σ 2 a + φ2 φ2 = 2 2aθ φ3 = σ2Estimation of CIR parameters 1. While we already constructed a DF curve we can use observed Discount factors and unit zero coupon bonds. Then we can compare the ZC DF curve with the model implied bond prices for different tenors( of quoted instruments) . Then we can minimize the sum of the square of the differences between these two prices to get best fit. 2. Second approach can be to get zero coupon yield curve and then try to fit model paramters by minimizing sqaured errors. 17
  20. 20. Chapter 1 Theory and Implementation NotesJohn C hull and Rebonato in two independent research works have suggested cali-bration to prices not zero coupon yield. However, Tuckman suggested that pricingto rates does away the weightage problem associated with bonds of differnet matu-rities. The problem stems from the fact that in shorter term interest rate are notvery senstive compared to longer term.We, however, tried both method and showresults.Hull and White 1-Factor Interest Rate ModelOne problem with the CIR model is that it doesnt exactly fit the term-structure.If the drift in basic SDE is coverted to a time varying function, it turns out thatit can excatly fir the term-structure of current interest rates.drift term θmade surethat the dynamic term-structure modeling is consistent with initial term structure.That is to say that DF curve evolved from will ensure a no-arbitrage situation in arisk neutral world.Second model that we have used is a Hull-While 1-factor model.SDE for a HW1F model is as follows: dr = [θ(t) − αr]dt + σdzWhere ∂f (0, t) σ2 θ(t) = + αf (0, t) + (1 − e−2αt ) ∂t 2αDiscount Curve in terms of HW1F can be calculated as: P (t, T ) = A(t, T )e−B(t,T )r(t)where 1 B(t, T ) = (1 − e−α(T −t) ) α DF (0, s) ∂lnP (0, t) 1 lnA(t, T ) = ln − B(t, T ) − 3 σ 2 (e−αT − e−αt )2 (e2αt − 1) DF (0, T ) ∂t 4α r(t) = shortrate18 18
  21. 21. 1.4 Short Rate ModelsCaplet pricing using HW1F model P ayof fcaplet = τ max(R − K, 0)Above is the payoff of a caplet at time tk+1 with reset at tk .payoff at tk 1 P ayof fcaplet = τ max(R − K, 0) (1 + τ R) 1 1 P ayof fcaplet = max( − , 0)(1 + τ K) (1 + τ K) (1 + τ R)Therefore caplet price with strike K and Notional L is same as a european putoptions with strike = (1+ 1 τ K) and (1 + τ K) notionalTherefore price of a caplet under HW1F has a analytical form dependent on modelparameters : caplet(t, T, T + T ) = KD(t, T )N (−d2 ) − D(t, T + T )N (−d1 )Where ln D(t,T + ) ) KD(t,T T σP d1 = + σP 2 d2 = d1 − σP σ2 σP = (1 − e−2α(T −t) )(1 − e−α(T +∆T ) )2 2α3 D = DiscountF actor 1 K= (1 + T Rk ) D(t, T + T ) = D(t, T + T ) ∗ (1 + T Rk ) 19
  22. 22. Chapter 1 Theory and Implementation NotesCalibration ProcedureHW1F model parameters are computed by calibrating it to market quoted cap prices.We will use market quotes cap volatility to back-out Black implied Cap prices.Assuming market has N liquid cap volatility and hence N cap prices, Calibation isdone by minimizing following expresssion: minσ,α = (modeli (σ, α) − marketi (σ, α))2If we don’t want to fit cap volatilities we can directly fit the σ, α to zero couponcurve formula given in the above section. However, We have done the calibration toATM cap volatlities to get the comparison between the two models.Cap volatilty as obtained from the market data is assumed to be flat volatility (notspot volatility). Same volatility is applied to all caplets in a cap.1.5 Simulation ModelAfter calibrating our two models to market data and obtaining the model parame-ters, We simulate future market data. This can be very slow and needs judgementto decide between • Risk factors • Time steps • Number of pathsIn our case , we have one source of randomness(short rate), we will simulate riskfactors at each coupon payment date. If there are more than one instrument in aportfolio we will simulate risk factors at smallest time interval up to longest maturity.CIR model Simulation r(t + t) = r(t) + α(θ − r(t)) t + σ r(t) t (0, 1)where ∼ N (0, 1)For each simulation step,r(t) is evolved at every time step upto the maturity of thecontract. Based on r(t) at each time step, Discount curve is obtained. DF curveis then used to calculate the exposure of IR instruments/portfolio. For short ratevolatility ,we use the same model parameters as the initial calibration.20 20
  23. 23. 1.5 Simulation ModelAbove discretization of r(t) can produce negative values ,therefore we will use adifferent implementation to simulate CIR short rate.Milstein approach for :4αθ > σ 2 √ r(t) + αθ t + σ r(t) t (0, 1) + 1 σ 2 ( (0, 1)2 − 1) 4 r(t + t) = 1+αelse r(t + t) = r(t) + α(θ − max(r(t), 0)) t + σ max(r(t), 0) t (0, 1)HW1F model Simulation r(t + t) = r(t) + (θ(t) − αr(t)) t + σ t (0, 1)where ∼ N (0, 1) ∂f (0, t) σ2 θ(t) = + αf (0, t) + (1 − e−2αt ) ∂t 2αAs we can see, drift term θ(t) evolves with time,and is a function initial forwardcurve. f(0,t) is same as intial ZCYC that we have already bootstrapped and splinedin section 1.3. Thereforef (0, t) and ∂f∂t can be easily obtained from the initial (0,t)curve.Same as CIR ,for each simulation step r(t) is evolved at every time step upto thematurity of the contract. Based on r(t) at each time step, Discount curve is obtained.DF curve is then used to calculate the exposure of IR instruments/portfolio. Forshort rate volatility ,we use the same model parameters as the initial calibration.Please note that exposure is always calculated under r.n measure.Pricing ModelOnce risk factors are simulated instruments are priced as: 1. IR swap: Deterministic model 2. IR Caps:Caplet pricing using HW1F model 21
  24. 24. Chapter 1 Theory and Implementation NotesCollateral ModelFor Collateral modeling, we have assumed a simple collateral construction.We assume that there are no minimum transfer amount and collateral is postedimmediately.Also in event of default ,there is a immidiate settle vis-a-vis collateral.Under these simplifications, C(t) = M ax(M T M (t) − CTcounterparty )Where C(t) = collateral CTcounterparty = CollateralT hresholdUnder this condition, expsoure of the portfolio is : Ecollaternal = min(E(t), CTcounterparty )MTM MatrixBy simulating the value of portfolio through time steps and number of paths weobtains a matrix of portfolio MTM.For example, for 12 timesteps and 1000 simulation paths we have a 12x1000 MTMmatrix. These represent the value of the exposure at each time step calculated usingan anlytical formula( as described under Pricing model). From the MTM matrix dif-fernet exosure related metrics can be calculated.(Potential future exposure,ExpectedExposure ,etc.)1.6 SummaryIn this section we outlined theory and methodology used to build the pricing andexposure measurement model. In the next section , we will go through each of thesesteps in detail with actual market data and results. We will also present an analysisand comparative study based on choice of model,instrument,effects of netting andaggregation on the portfolio.22 22
  25. 25. 2 Model Implementation and Results2.1 OverviewIn this part, we will go through each step of model implementation and show resultsbased on our sample market data. Underlying theory and implementational nittygrittys have been explained in previous section. Here we will support claims madein previous section and take note of any deviation. Plots and parameters presentedhere can be regenerated with matlab programs and market data attached in theappendix.2.2 Bootstrapping yield curveMarket data date used for Boot Strapping Interest Rates is of 21/10/2005.Below is the discount curve as obtained by boot-strapping cash rates(o/n to 1Y)and Swap rates(2Y to 50Y). In-between interpolation is done in matlab using ppvalmatlab function. 23
  26. 26. Chapter 2 Model Implementation and ResultsBelow is the Zero coupon yield curve as obtained from DF curve (for points af-ter Money market rates ) and by boot-strapping cash rates(o/n to 1Y) and Swaprates(2Y to 50Y). In-between interpolation is done in matlab using ppval matlabfunction.2.3 Calibrating CIR ModelCIR model is calibrated to the given DF curve at each circular point(each quotedinstrument) in the Discount curve of section 2.2. Model params calibrated values description a 0.4415 rate of mean reversion θ 0.0519 long-term rate σ 0.0233 volatility r 0.0378 shortrate(observed o/n)24 24
  27. 27. 2.3 Calibrating CIR ModelCalibration comparison with full term structure(O/N to 50Y):Using full term structure, fit for short term maturity is not very good as long termmaturity.Since we are going analyse swap instruments only upto five years, It’s worth tryingto estimate CIR model paramters to a shorts Zero coupon curve. However the 25
  28. 28. Chapter 2 Model Implementation and Resultsoptimization of three parameters does not fare very well when the tenor is shortened.It throws a negative value for the volatility parameter.Constant volatility parameterTo avoid this problem, we fix the volatility to 3Y cap ATM volatility as obtainedfrom the cap surface. Model params calibrated values description note a 2.1007 rate of mean reversion from estimation θ 0.0483 long-term rate from estimation σ 0.1940 volatility 3YR ATM CAP VOLEstimation in zero rates by minimizing error in model rate andzero coupon rate: Model params calibrated values description note a 4.2936 rate of mean reversion from estimation θ 0.04747 long-term rate from estimation σ 0.1940 volatility 3YR ATM CAP VOL26 26
  29. 29. 2.3 Calibrating CIR ModelAs we can observe , estimation by minimizing squared error in interest rates providesthe best fit. We will use model parametera backed-out by this method.Risk factor simulationBased on estimated parameters , we can simulate risk factors at different interval.In the plot below, 1000 paths are simulated at each 3m period upto 3years( 12 timesteps) 27
  30. 30. Chapter 2 Model Implementation and ResultsAs expected we observe a faster mean reversion (a=4.2936)If we just change the mean reversion rate to 0.5 ,we obtain a much smoother picture.28 28
  31. 31. 2.4 Calibrating Hull-White 1 Factor Model2.4 Calibrating Hull-White 1 Factor ModelWe calibrate Hull white 1-factor model to intertest rate caps such that it minimizesthe squared difference between model cap prices and market cap prices.By calibrating to cap prices upto 10Y we obtain α = 0.0023and σ = 0.0084Below is the plot comparing Model Cap prices with Market cap prices as calculatedusing Market quoted volatility. Please note that we could have done optimiztion forthree parameters (α, σ, r)where r is the short rate. But the optimization would runinto problem of negative short rate.A check on Yield curve fitting: Hull-White 1F model is a no-arbitrage model. Thatimplies that it should fit the today’s yield curve . Here try to compare the modelimplied Discount curve with market discount curve: 29
  32. 32. Chapter 2 Model Implementation and ResultsPlease note that the calibration is doneto cap prices upto 10Y. In the above plot,upto 10Y point the fit is reasonable ,after which model implied DF drops faster andtouching almost zero as 50Y point.Risk factor simulationBased on estimated parameters , we can simulate risk factors at different interval.In the plot below, 1000 paths are simulated at each 3m period upto 3years( 12 timesteps)30 30
  33. 33. 2.5 Exposure Measurement2.5 Exposure MeasurementSwap simulationAll results are for a 3Y reciever vanilla swap , swpa rate= 8.4% . Swap is actuallya par swap with 8.4% determined by setting P V (f loat) = P V (f ixed).CIR model calibration to partial term-struture( up to 5Y):MTM profile: 31
  34. 34. Chapter 2 Model Implementation and ResultsPFE Profile(95 %tile):32 32
  35. 35. 2.5 Exposure MeasurementExposure can be extracted from the MTM profile as Exposure = M AX(M T Mt , 0)CIR model calibration to full term-struture:MTM profile:PFE Profile(95 %tile) 33
  36. 36. Chapter 2 Model Implementation and ResultsHW model calibration to CAP volatilities:MTM profile:PFE profile(95%tile)34 34
  37. 37. 2.5 Exposure MeasurementA comparison of PFEs using HW1F and CIR model:As we can see in the above plot, CIR model produces higher PFE profile than theHW1F model. This can be explained on the basis of standard deviation component √of CIR process. In the CIR process ,standard deviation of r is varies with r. 35
  38. 38. Chapter 2 Model Implementation and ResultsHigher Short rate will increases the volatity of change in short rate. This accountsfor higher dispersion of MTM values under CIR model.Exposure MetricsA brief recap of exposure formulas: • EE(t) = AV ERAGE[M ax( M T Mi (t), 0)] • P F E(t) = inf {X(t) : P (E(t) ≥ X(t)) ≤ 1 − α} • maxP F E(α) = max[EE(ωi , tk )] • EP E = Average(EE(t)) • EEE = M ax(EEi , EEEi−1 )A comparison of different exposure metrics. Plot below is generated with HW modelcalibrated to CAP volatilities:36 36
  39. 39. 2.5 Exposure MeasurementLegend:green:Expected Exposureblue:Potenrial Future Exposurered:maxPFEmagenta:Effective Expected Exposure’+’: Expected Postive ExposureAll results from this point onwards are based on CIR model with model parametersestimated to full term structure.Effect of Netting:Portfolio of two swaps : 1. Payer swap unit notional , 6M payment frequency 2. Reciever swap unit notional ,3M payment frequencyWithout Netting:Exposure=Max(MTM_3M,0)+Max(-MTM_6M,0)With Netting:Exposure=Max(MTM_3M-MTM_6M,0) 37
  40. 40. Chapter 2 Model Implementation and ResultsEffect of Collateral:Collateral threshold: We assume a simple collateral model. Everytime the MTMexposure exceeds 8% of notional, counterparty posts collateral: C(t) = max(M T Mt − T hreshold, 0) Exposure(t) = max(M T Mt − C(t), 0)f rom above two equations : Exposurecollaterlized = min(Exposure(t), T hreshold)We fixed threshold arbitratily to show to effect of collateral:38 38
  41. 41. 2.5 Exposure Measurement 39
  42. 42. 3 Appendix3.1 References 1. Counterparty Credit Risk: The New Challenge for Global Financial Markets" by Jon Gregory 2010 2. Measuring and marking counterparty risk by Eduardo Canabarro Head of Credit Quantitative Risk Modeling, Goldman Sachs, Darrell Duffie Professor, Stanford University Graduate School of Business 2008 3. Implementing Derivatives Models by Les Clewlow and Chris Strickland 2001 4. Options, Futures, and. Other Derivatives, Seventh Edition John C. Hull 2010 5. Interest Rate Models by Damiano Brigo and Fabio Mercurio 2004 6. A guide to modelling counterparty credit risk by pykhtin and Zhu 20073.2 Market Data and Matlab CodeMarket Data :Market Data used is of 21/10/2005 as obtained from bloomberg: • BBA LIBOR US O/N to 12 Months • United States Dollar USD Fixed Float Swap 1Y to 30Y • Caps - Black ATM Volatility BBIR Mid 10/21/11Market Data is has been submitted in csv format( as read by the matlab code).Matlab Codes :There are close to 20 matlab files and they are attached as a part of thesis submission.However to make sure that results could be reproduced , main function that callsall other sub-routines is submitted here:%This Procedure Generates the short rate paths for the Interest Rate 41
  43. 43. Chapter 3 Appendix%Swap(reciever swap)%PFE Calculation using the Cox, Ingersoll Ross model(CIR) and Hull-White 1-factor model.function pfe_irswap(model,iscalibrated,pathstr,nsim)[ini_DF_curve ini_fwd_curve difnumdate cap_data]=DF_capvol(pathstr);swap_details=csvread([pathstr ’swap.csv’],1);if iscalibrated==0model_calibration(ini_DF_curve,ini_fwd_curve,difnumdate,cap_data,model);end%load model params%swap trade detailsNotional=swap_details(1);maturity=swap_details(2);freq=swap_details(3);DCF=1/freq;delta_t=DCF;tenor=zeros(freq*maturity,1);%swap payment schedulefor i=1:size(tenor,1)tenor(i)=i*DCF;end%nsim=1000;shortrate_paths=ones(nsim,size(tenor,1));dfcurve_paths=ones(nsim,size(tenor,1),size(tenor,1));MTM_paths=zeros(nsim,size(tenor,1));PFE_profile=zeros(size(tenor,1)+1);MTM_paths1=zeros(nsim,size(tenor,1));PFE_profile1=zeros(size(tenor,1)+1);if strcmp(model,’HW’)model_params=load_params(model,pathstr);alpha=model_params(1);sigma=model_params(2);42 42
  44. 44. 3.2 Market Data and Matlab Coder_0=ppval(ini_fwd_curve,0);for I=1:nsimshortrate_paths(I,:)=HW_short_rate(tenor,alpha,sigma,r_0,ini_fwd_curve,delta_t);last=size(tenor,1);for J=1:size(tenor,1)if(J==1)dfcurve_paths(I,J,:)=shortrate_paths(I,1:last);elsedfcurve_paths(I,J,:)=[shortrate_paths(I,1:last) zeros(size(tenor,1)-last,1)’];end%Change the maturity and ZCYC used in the calculationRates=squeeze(dfcurve_paths(I,J,:));%for short rateDF=Givenshortrate_getDF_HW(Rates(1:last),tenor(1:last),model_params,ini_DF_curve);if(J==1)Swaprate=SwapRate(DF,DCF);endMTM_paths(I,J)=SwapValue(Notional,Swaprate,DF,DCF);% endlast=size(tenor,1)-J;endendfor I=1:1:size(tenor,1)if I~=size(tenor,1)+1PFE_profile(I)=prctile(MTM_paths(:,I),95);endendelseif strcmp(model,’CIR’)model_params=load_params(model,pathstr);k=model_params(1);theta=model_params(2); 43
  45. 45. Chapter 3 Appendixsigma=cap_data(3,2);r_0=ppval(ini_fwd_curve,0);for I=1:nsimshortrate_paths(I,:)=CIR_short_rate(tenor,k,theta,sigma,r_0,delta_t);last=size(tenor,1);for J=1:size(tenor,1)if(J==1)dfcurve_paths(I,J,:)=shortrate_paths(I,1:last);elsedfcurve_paths(I,J,:)=[shortrate_paths(I,1:last) zeros(size(tenor,1)-last,1)’];end%Change the maturity and ZCYC used in the calculationRates=squeeze(dfcurve_paths(I,J,:));%for short rateDF=Givenshortrate_getDF(Rates(1:last),tenor(1:last),model_params,sigma);if(J==1)Swaprate=SwapRate(DF,DCF);endMTM_paths1(I,J)=SwapValue(Notional,Swaprate,DF,DCF);% endlast=size(tenor,1)-J;endendfor I=1:1:size(tenor,1)if I~=size(tenor,1)+1PFE_profile1(I)=prctile(MTM_paths(:,I),95);endendsave(’PFE_data.mat’,’MTM_paths1’,elseerror(’Invalid Model: Please enter HW or CIR as Model’);44 44
  46. 46. 3.2 Market Data and Matlab Codeend% for I=1:1:size(tenor,1)% if I~=size(tenor,1)+1% PFE_profile(I)=prctile(MTM_paths(:,I),95);% end%% endend 45
  47. 47. NomenclatureDF Discount FactorIR Interest RateMTM Mark to MarketOTC Over the counterPFE Potential Future ExposureSDE Stochastic Differential EquationVaR Value at Risk 47