程序代写代做 algorithm Implied Binomial Tree

Implied Binomial Tree
Project Objective
Given an implied volatility surface, construct and implement an implied binomial tree (IBT) and its pricer, so that we can price exotic products consistently with the implied volatility surface.
We will follow the Derman and Kani’s algorithm [Derman and Kani, 1994] to construct the implied binomial tree.
Numerical Methods (QF607) Implied Binomial Tree 2 / 11

Implied Binomial Tree Construction
Implied volatility surface iv(t,K) are given
To construct n-step tree, the time interval [0,T] is equally spced:
t = T n
Risk-free interate rate r
Implied binomial tree is constructed by forward induction: from the constructed tree up to the (k 1)-th time step, we need to derive the k-th time step. The parameters to construct are
I The position of the nodes Sk,i, for i 2 0,1,…,k ⇢ k +1 unknowns I The transition probability pk,i: the probability that the stock price goes
from Sk1,i to Sk,i ⇢ k unknowns
I Knowing pk,i, the probability that the stock price goes from Sk1,i to
Sk1,i+1 is just 1 pk,i
I In total we have 2k + 1 unknowns for the k-th step induction
Numerical Methods (QF607) Implied Binomial Tree 3 / 11

Implied Binomial Tree Construction
Now let’s look at how many constraints we have
1 The forward price conditional on each node, should satisfy the risk-neutral condition:
Fk1,i =E[Sk|Sk1,i]=Sk1,iert =pk,iSk,i +(1pk,i)Sk,i+1 (1) In other words
pk,i = Sk1,ie(rq)t Sk,i+1 = Fk1,i Sk,i+1 (2) Sk,i Sk,i+1 Sk,i Sk,i+1
Here we have k constraints.
2 The option price struck at Sk1,i and expiry at k-th step (so time to maturity is kt), should match the option price given by the implied volatility surface. Here we also have k constraints. Let us elaborate on this.
Numerical Methods (QF607) Implied Binomial Tree 4 / 11

Matching Option Prices
Call option price C(K,kt) and put option price P(K,kt) can be obtained from querying the implied volatility surface, and plug into Black-Scholes formulae. These prices are our targets to match.
The way to obtain option price from the implied binomial tree is through the Arrow-Debreu prices, denoted as k,i, at each node.
Arrow-Debreu price k,i is the discounted risk-neutral probabilities of each node. In the binomial tree model, it is also the price of an option that pays 1 unit payo↵ at time k, if and only if the stock reaches Sk,i.
We start with 0,0 = 1, and calculate k,i from k1,i by induction:
8><>:k,0 = ert(pk,0k1,0)
k,i =ert((1pk,i1)k1,i1+pk,ik1,i), 1ik1
k,k = ertk1,k1(1 pk,k1).
Numerical Methods (QF607) Implied Binomial Tree 5 / 11
(3)

Matching Option Prices
Under the binomial tree’s discrete distribution, the option prices C(K,kt) and P(K,kt) are:
Xk i=0
Xk i=0
Note that we have Condition 1 matching the forward prices, due to call-put parity, if call prices match, put prices will match by definition. We match call price on the upper part of the tree, and match put price on the lower part of the tree
Now, option prices give us k constraitns, forward prices give us k constraints, we have 2k + 1 variables — left with 1 degree of freedom. We use that to pick the middle point(s).
C(K,kt)= P (K , k t ) =
k,i max(Sk,i K,0) (4) k ,i max(K Sk ,i , 0) (5)
Numerical Methods (QF607) Implied Binomial Tree 6 / 11

When k is Even
At the even time steps, there are odd number of nodes (k + 1). We set the center point to be equal to S0:
Sk,k/2 = S0 (6) The call prices above the central node, C(Sk1,i,kt), for i < k/2, can be expressed as: j=0 Xi C(Sk1,i , kt) = k,j (Sk,j Sk1,j ) = e r t + ((1 pk,0)k1,0 + pk,1k1,1)(Sk,1 Sk1,i ) + ((1 pk,1)k1,1 + pk,2k1,2)(Sk,2 Sk1,i ) (8) [pk,0k1,0(Sk,0 Sk1,i ) (7) | {z } ertk,1 | {z } | {z } ert k,2 ert k,0 + . . . + ((1 pk,i1)k1,i1 + pk,i k1,i )(Sk,i Sk1,i )] (9) | {z } ertk,i = ert [k1,0(pk,0(Sk,0 Sk1,i ) + pk,1(Sk,1 Sk1,i )) + k1,1(Fk1,1 Sk1,i ) (10) | {z } Fk 1,0 Sk 1,i + . . . + k1,i1(Fk1,i1 Sk1,i ) + pk,i k1,i (Sk,i Sk1,i )] (11) 26iX1 = ert 6 k1,j (Fk1,j Sk1,i ) + pk,i | { z } Fk1,iSk,i+1 Sk,i Sk,i+1 37 k1,i (Sk,i Sk1,i )7 (12) 75 64 j = 0 | {z P } known quantities, denoted as Numerical Methods (QF607) Implied Binomial Tree 7 / 11 Re-arranging the formula, we obtain Sk,i expressed in Sk,i+1: Sk,i+1(ertC(Sk1,i,kt)P)k1,iSk1,i(Fk1,i Sk,i+1) Sk,i = ertC(Sk1,i,kt)Pk1,i(Fk1,i Sk,Si+1) (13) This can be used to calculate the position of nodes above the middle point: Sk,i for i < k/2. Similarly, using the put option prices, we can express Sk,i+1 in Sk,i: Sk,i(ertP(Sk1,i,kt)P)+k1,iSk1,i(Fk1,i Sk,i) Sk,i+1 = ertP(Sk1,i,kt)P+k1,i(Fk1,i Sk,Si) (14) Algorithm for even number of time steps: Start from center point Sk,k/2 = S0 For nodes above center, calculate their positions iteratively using (13) For nodes below center, calculate their positions iteratively using (14) Calcualte the probability using (2) Note that in [Derman and Kani, 1994], the call and put prices C(.) and P(.) are calculted from a standard CRR binomial tree with interpolated smile. This is unecessary. We can just apply Black-Scholes formulae using the implied volatility queried from the implied volatility surface. Numerical Methods (QF607) Implied Binomial Tree 8 / 11 When k is Odd We impose the constraint S02 = Sk,bk/2c ⇥ Sk,bk/2c+1 similar to CRR binomial tree. Substituting Sk,bk/2c = S02/Sk,bk/2c+1 into (13), we can obtain: S0[ertC(S0,kt)+k1,bk/2cS0 P] Sk,bk/2c = k1,bk/2cFk1,bk/2c ertC(S0,kt)+P (15) Once we position Sk,bk/2c and Sk,bk/2c+1, we can use the same iterative method as when k is even, to setup the rest of the tree nodes. Working examples are available in [Derman and Kani, 1994], node index there is di↵erent from our notation: we are indexing from top to bottom — Sk,0 represents the top node at time step k, in the paper the index is from bottom to top. Numerical Methods (QF607) Implied Binomial Tree 9 / 11