FE5116 project Implementation and testing of the implied volatility surface
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Implementation and testing of the implied volatility surface
FE5116 project
16 Jun 2023
Abstract
This project is a real case study, which goes through the various steps necessary to produce derivatives pricing models. It starts with the deinition of a problem, a mathematical modeling choice, the implementation of a numerical framework and the calibration to market data. I already carried out the mathematical modelling part for you.
1 problem statement
In FX markets the volatility surface is often described via a inite number of observations of vanillas European options (call and puts) at diferent strikes and tenors expressed in delta conventions. our goal is
. translate the observations into pairs of (strikes, volatilities);
. interpolate the marks so that we can then price European vanilla options with any strike and maturity;
. implement a numerical pricing framework to compute the price of any generic European payof (not just vanilla call and put options).
1.1 payof description
All payofs used here are European derivatives of the currency spot price St observed at some time T
pagoff = f(ST )
1.2 Model choice
we assume that interest rates are deterministic. we do not make any particular assumption about the price dynamic of the currency price.
dMt Mt = r(t) dt Mt :domestic money market account
dNt Nt = g(t) dt Nt :foreign money market account (1)
where the deterministic functions r(t), g(t) are the domestic interest rate and the foreign interest rate.
1.3 Forward spot price
For a currency the spot price is deined as the price at which we agree now to exchange money (domestic currency against foreign currency) in 2 business days1 .
This same concept applies also to European derivatives of the spot price, which typically are settled 2 business days after the expiry of the option.
wedeine the cash exchangeratext as the theoretical exchange rate at which we would now (today) buy (or sell) the currency if it was possible to settle the transaction immediately. Note that this is not a market observable.
So efectively the spot price st is efectively the 2-days2 forward price of the cash rate xt. Since the forward price of xt for maturity T given the iltration 大t is
Ft (T) = 石 [xT |大t] = xte1tT [T (u) -g(u)] du (2)
deining the spot settlement lag as T =
For simplicity of notation, to avoid carrying the term T , we deine
Gt (T) = Ft (T + T) = xt e1tT +τ [T (u) -g(u)] du (4)
with this notation the spot price is the same as st = Gt (t).
1.4 Implied volatility
A European call option on the spot price st with maturity T and strike K generate a cash low at time T + T
CashFlo山(T + T) = max[sT - K; O] = max[GT (T) - K; O]
The T-forward price of the option C(K, T), expressed in terms of the current forward price G0 (T) is given by the following formula:
C(K, T) = G0 (T) N (d1 ) - KN (d2 )
d1 = + O.5 σ ^T
d2 = d1 - σ ^T
where σ is the implied volatility of the option. This formula is derived under the assumption that σ is constant, however in the market we observe that it is not the case, as options with diferent strike and maturity have diferent implied volatilities. So efectively σ is a function of K and T: σ(K, T). This is not an inconsistency, because the concept of implied volatility is purely a market convention: it is deined as the volatility which if used in the Black formula gives us the price of the option. The fact that the Black formula happens to be derived under the assumption that σ is constant is irrelevant for the purpose of this deinition.
Note that for K = O the formula is not deined because ln(O) does not exist, but the price can still be obtained as a limit
任l+ C(K, T) = G0 (T)
1.5 probability distribution of ST
Let φST (①) be respectively the risk neutral probability density (pdf) of the spot price process st at time T. The T-forward price of a call option on the spot price st with maturity T and strike K (formula (5)), can be written as:
C(K) = 石 [max[sT - K, O]|大0] = l任必 (① - K) φST (①) d①
Diferentiating twice this expression with respect to the strike K gives the relation between the probability density function and the T-forward call price function
d2 C(K) dK2
= φST (K)
(6)
So the probability density function of sT is the second derivative of the call price function (5) with respect to the strike K.
1.6 Moneyness
we deine as moneyness of an option with maturity T the relative position of the strike K with respect to the forward spot for maturity T, i.e.
M(K, T) = (7)
1.7 No arbitrage constraints
Regardless of the model used, there are some simple no-arbitrage relationships which the forward price of a Euroepan call C(K, T) option must abide to. If they are violated it means there are arbitrages in the market which can be exploited via simple trading strategies to lock in a proit.
. The price of a call option must be positive: i.e. for any K it must be C(K) 持 O
. The price of a call option must be monotonically decreasing in strike, but it must not decrease too fast: for any consecutive pair of strikes (Ki , Ki+1) the price of anundiscounted call option must be decreasing, i.e. it must be
-1 < < O, i = O . . . N - 1
. The price of a call option must be convex in strike: for any consecutive triplet of strikes (Ki-1 , Ki , Ki+1) the gradient of the price of an undiscounted call option must be increas- ing, i.e. it must be
< , i = O . . . N - 2 (8)
. The price of a call option must be increasing along moneyness lines: for any pair of maturities T1 < T2 and strike K, it must be
C(K, T1 ) < C(K G0(G0)T1(T2) , T2 ) (9)
1.8 Data
we observe in the market the spot exchange rate st , the prices of domestic and foreign zero coupon bonds Mt and Nt for diferent maturities and the Black & Scholes implied volatilities of options with standard maturity and diferent deltas. For your convenience, this market data is already hard-coded in the ile getMaTket.m in appendix A.
Figure 1: Market data
volatility marks for are given per maturity and delta value. The concept of delta is dependent on market conventions which are speciic to each currency. For this project we assume some simple conventions and deine delta as the irst derivative of the forward price of a European option with maturity T with respect to the spot So. So deltas are given by these two formulas
lΔcall l = N (d1 )
lΔput l = 1 - N(d1 ) = N (-d1 )
where N(①) is the standard normal cumulative distribution function,
d1 = + σ ^T
For example, for a 25d-put with maturity 1w we see a volatility of 2o.2o%. This means that for a European put option with maturity 1w,strike K25p and volatility 2o.2o% the undiscounted delta in absolute value is o.25 (note a factor 1oo is included by convention), i.e.
o.25 = 1 - N (d1 ) (11)
where σ = 2o.2o%, T = 1w = the strike K25p, which needs to be obtained via root search.
Note that for 50d it is not speciied if it is a call or a put, because they are equivalent.
1.8.2 Assumptions
For simplicity you can assume that interest rate curves and volatilities use the same tenor dates. You cannot make assumptions on the number of tenors or on the number of deltas (i.e. your program must work also with a diferent market, containing a diferent number of tenor or delta points). Extrapolation of interest rate beyond the last tenor is allowed up to 3o days. Extrapolation of volatility beyond the last tenor is not allowed. Querying the vol surface with tenor zero is allowed.
2 Tasks
This section deines a number of guided tasks which you need to carry out.
2.1 Black formula
Implement the Black formula for the forward price of a call option, as described in equation (5), using the signature below:
X Ⅰnputs : X f : forward spot for time T , i .e . E [ s(T )] X T : time to expiry of the option X Ks : vector of strikes X Vs : vector of implied Black volatilities X Output : X u : vector of call options undiscounted prices function u = getBlackcall(f , T , Ks , Vs ) |
2.2 Interest rate interpolation
Assume that interest rates are constant within consecutive pairs of zero coupon maturities. This means that the functions T (t) and g(t) appearing in equations (1) are constant in each of the intervals [Ti , Ti+1]. The local rates related to each interval must be computed from discount factors using a boot-strapping technique. Assume that after the last tenor TN the rate curve continues constant at the same value of the last interval, as speciied in section 1.8.2. Implement the two functions speciied below.
X Ⅰnputs : X ts : array of size N containing times to settlement in years X dfs : array of size N discount factors X Output : X curve : a struct containing data needed by getRateⅠ nte gral function curve = makeDepocurve(ts , dfs ) |
X Ⅰnputs : X curve : pre - computed data about an interest rate curve X t : time X Output : X integ : integral of the local rate function from 0 to t function integ = getRateⅠ nte gral(curve , t) |
The second function must compute'0(t) T (u) du, which is one of the ingredients needed to
compute discount factors. It uses information pre-computed in the irst function and passed to the argument curve. You are free to store in the structure curve whatever you want. If you think it is not useful to do any pre-computation, then you can just store the arguments of the irst function, ts and dfs. In fact these two function could be merged into a single one. The reason for splitting them is that the irst function can be used to pre-compute and cache information useful to speed up calls to the second function. This is useful because we can design our pricing framework so that the irst function is called just once, at the beginning of calculations. Then the second function, which might be invoked multiple times in the context of the numerical framework, can take advantage of some pre-computed information, thus making calculations faster.
2.3 Forward spot G0 (T) (= ST )
X Ⅰnput网 : X domcurve : dome网tic ⅠR curve data X forcurve : dome网tic ⅠR curve data X 网pot : 网pot exchange rate X tau : lag between 网pot and 网ettlement X Output : X curve : a 网truct containing data needed by getFwdspot function curve = makeFwdcurve(domcurve , forcurve , 网pot , tau ) |
Implement a function which computes the forward spot as speciied in equation (4).
X Ⅰnput网 : X curve : pre – computed fwd curve data X T : forward 网pot date X Output : X fwdspot : E [ s(t ) l s(0)] function fwdspot = getFwdspot(curve , T) |
2.4 conversion of deltas to strikes
write a function that, given a volatility mark (as in igure 1) computes the associated strike.
2023-07-24