December 20, 2018 1 QF 622: Assignment 1 Sukanya Mukherjee (SMU) ANALYTICAL RESULTS: EQUITY SWAP Given, dS t = S t ( μdt + σdW t ) For the calculation of exposures, consider the drift to be μ , so applying Ito’s Lemma, log S t S t − 1 = ( μ − σ 2 2 ) ∆ t + σ · x √ ∆ t, x ∼ N (0 , 1) ∆ t = 1 1 Positive Exposure: E [( log S t S t − 1 − K ) + ] = ( μ − σ 2 2 − K ) Φ( − x ∗ ) + σφ ( x ∗ ) Negative Exposure: E [( log S t S t − 1 − K ) − ] = ( − μ + σ 2 2 + K ) Φ( x ∗ ) − σφ ( x ∗ ) Where, log S t S t − 1 − K ≶ 0 = ⇒ μ − σ 2 t 2 + σ · x ≶ K = ⇒ x ≶ K − μ + σ 2 2 σ ∴ x ∗ = K − μ + σ 2 2 σ For the calculation of cva and dva, consider the drift to be the risk-free rate for the purpose of risk-neutral pricing. ANALYTICAL RESULTS: PORTFOLIO SWAP The portfolio is a combination of five independent equity swaps, so the exposures of the whole portfolio will be the sum of the exposures of the individual swaps. Also, the nominal value of each swap is 20 and the portfolio is equally weighted in each swap with weight = 0 2. Σ 5 i =1 ( log S i,t S i,t − 1 − K ) = 5 μ − 5 σ 2 2 + σ · Σ 5 i =1 x i − 5 K, x i ∼ iid.N (0 , 1) ∀ i For any time period t, = ⇒ Σ 5 i =1 x i ∼ N (0 , 5) ∴ Let, y = Σ 5 i =1 x i √ 5 ∼ N (0 , 1) ∴ The Positive Exposure: E [ 0 2Σ 5 i =1 ( log S i,t S i,t − 1 − K )] + = 0 2 · E [5 μ − 5 σ 2 2 + σ √ 5 y − 5 K ] + = 0 2 · ( 5 μ − 5 σ 2 2 − 5 K ) Φ( − y ∗ ) + 0 2 · σ √ 5 φ ( y ∗ ) ∴ The Negative Exposure: E [ 0 2Σ 5 i =1 ( log S i,t S i,t − 1 − K )] − = 0 2 E [5 μ − 5 σ 2 2 + σ √ 5 y − 5 K ] − = 0 2 · ( − 5 μ + 5 σ 2 2 + 5 K ) Φ( y ∗ ) − 0 2 · √ 5 σφ ( y ∗ ) Where, y ≶ 5 K − 5 μ + 5 σ 2 2 σ √ 5 = ⇒ y ∗ = 5 K − 5 μ + 5 σ 2 2 σ √ 5 Thus, for the expected exposures over all five years is the mean of the expected exposures of the portfolio for every year. Reported values are multiplied with nominal value of 20. As before, for the valuation of the CVA and DVA, consider risk-neutral pricing with drift at the risk-free rate. 1 Since the cashflows are annual, the time interval is ∆ t = 1. December 20, 2018 2 QF 622: Assignment 1 Sukanya Mukherjee (SMU) EXPOSURES AND XVA The expected exposure is calculated using the absolute values of cashflows so that the posi- tive and negative cashflows do not undermine each other. The comparison between the single swap and the portfolio of swaps reveals that diversifi- cation is beneficial to reducing risk. The risk measures are all less for the equally weighted portfolio, than for the single equity swap. SIMULATION RESULTS: PORTFOLIO SWAP The log-returns distribution is that derived from the solution of the Black-Scholes SDE, so, log S t S t − 1 = μ − σ 2 2 + σ · x, x ∼ N (0 , 1) = ⇒ log S t S t − 1 ∼ N ( μ − σ 2 2 , σ 2 ) The simulation of log-returns for the exposures are, thus, sims = 2 ∗∗ 17 mean ret = mu − ( s i g ∗ s i g /2 ) s d r e t = s i g s t o c k r e t = np . random . normal ( s i z e = ( sims , 5 , 5 ) , l o c=mean ret , s c a l e=s d r e t ) #Sims a l o n g 0 − a x i s , f i v e s t o c k s a l o n g − 1 − a x i s and f i v e y e a r s a l o n g 1 − a x i s c a s h f l o w = 0 . 2 ∗ 2 0 ∗ ( s t o c k r e t − K) The drift is changed to the risk-free rate for the calculation of the CVA and the DVA. mean ret = r f − ( s i g ∗ s i g /2 ) s d r e t = s i g December 20, 2018 3 QF 622: Assignment 1 Sukanya Mukherjee (SMU) s t o c k r e t = np . random . normal ( s i z e = ( sims , 5 , 5 ) , l o c=mean ret , s c a l e=s d r e t ) #Sims a l o n g 0 − a x i s , f i v e s t o c k s a l o n g − 1 − a x i s and f i v e y e a r s a l o n g 1 − a x i s c a s h f l o w = 0 . 2 ∗ 2 0 ∗ ( s t o c k r e t − K) Each simulation produces a value for the expected exposures, the CVA and the DVA. This can be summarised as distributions of these features of the portfolio in terms of their moments and histograms. The constant default intensity, per unit time, is 0.02. Thus, the annual probability of default is 1 − e − 0 02 t , for t years. Thus, the factor of discounting and default is summarised, q = 0 . 0 2 ; r f = 0 . 0 2 ; T = range ( 1 , 6 ) t e m p f a c t o r s = np . a s m a t r i x ([(1 − np . exp( − q ∗ t ) ) ∗ np . exp( − r f ∗ t ) f o r t i n T ] ) c a s h f l o w = 0 . 2 ∗ 2 0 ∗ ( s t o c k r e t − K) z e r o s t e m p = np . z e r o s ( ( sims , 5 , 5 ) ) c a s h f l o w p o s = np . maximum( c a s h f l o w , z e r o s t e m p ) c a s h f l o w n e g = np . minimum ( c a s h f l o w , z e r o s t e m p ) temp pos = np . a s m a t r i x ( np . sum ( c a s h f l o w p o s , a x i s = − 1)) temp neg = np . a s m a t r i x ( np . sum ( c a s h f l o w n e g , a x i s = − 1)) #weighted sum o f # c a s h f l o w s o v e r s t o c k s , a t each time stamp cva = (1 − r r ) ∗ ( temp pos ∗ t e m p f a c t o r s .T) dva = (1 − r r ) ∗ ( temp neg ∗ t e m p f a c t o r s .T) Following this, the simulated CVA and DVA are shown,