financialnoob.me

Blog about quantitative finance

Pricing derivatives with binomial tree model (Part 2)

In the previous article we discussed several simple examples to get a general intuition behind binomial tree pricing model. Now I want to describe that model in a little bit more abstract mathematical terms.


Recall that we got a formula that can be used to price any derivative in 1-period binomial model. We also discussed why we need to use no-arbitrage principle and price derivative contracts by constructing a portfolio that replicates the payout of derivate in each state of the world. The formula is shown below.

Price of replicating portfolio

The formula above does not include actual probabilities of being in up or down states. Recall also that in numerical examples in the previous article we found out that using actual probabilities to calculate expected value of the stock and using it to price derivatives led to arbitrage.

Let’s define a quantity q as follows:

Defining q

If q is less than 0 then we have an arbitrage opportunity: borrow s_0, buy a stock and in any state of the world get a rate of return bigger than r. If q is greater than one, there is again an arbitrage opportunity: short sell a stock for s_0, invest the money it at risk-free rate r, get a positive profit at the end of the period after buying and returning the stock. From this we can conclude that if there is no arbitrage opportunities, q must be between 0 and 1. Now let’s think of q as a probability (we can do this because it belongs to an interval [0,1]). If we thank of q as a probability then we can define expected value of the discounted derivative payout as follows:

Expected value of discounted derivative payout

The subscript Q of the expectation indicates that we are using probabilities q. Now let’s look at this formula a little closer.

So, using a little bit of algebra we were able to express the price of derivative (equal to the price of replicating portfolio) as an expectation of the discounted derivative payout. But expectation not under true probabilities Pof being in up or down states, but under synthetic probabilities Q. Right now it doesn’t seem useful — we just rewrote the same formula in a different terms, but it will be helpful later.

To proceed further we need to introduce some terminology and formally define different parts of the model.

  • Process S is a set of all possible stock values and their connections to each other. It can be represented as a graph shown below. Assume that the subscript of S indicates the ‘name’ of the node.

Example of a process

  • Random variable S_i is a value of the process S at a particular time (for example at time t=1, S_1 is either S_u or S_d).
  • Probability measure is a set of probabilities used (p and (1-p) in the example above).
  • Filtration F_i is a history of the process up to the time t=i (if at time t=2the process is in state uu then F_2 = {0, u, uu}).
  • Claim X with time-horizon T is a function of filtration F_T. For simple put and call option it will just be a function of the current stock price at time t=T. For some other derivatives it may depend on previous states (for example, the maximum price the stock reached up to time t=T).
  • Previsible process is a process on the same graph whose value at time t=iis known at time t=i-1 (it depends only on filtration F_{i-1}).
  • Martingale is a stochastic process for which the conditional expected value (given observations up to time t=i) at time t≥i+1 is equal to the value of the process at time t=i. More formally we can call it a martingale with respect to probability measure P given filtration F_i.

Martingale definition

Now we are ready to state the binomial representation theorem.

Binomial representation theorem:

Let S be a binomial price process and Q be probability measure under which the process S is a martingale. Then for any other Q-martingale N there exists a previsible process phi, such that

Process N

Delta_S indicates the change in the stock price from time t=k-1 to time t=k. The formula above means that we can express the change in N as change in Sscaled by phi.

In the next section I describe how to find that phi and show why binomial representation theorem is true. Feel free to skip it if you are not interested in underlying math. I will provide a formula for phi in the section describing financial application.


Assume that we are at time t=0 and we want to find such phi. Let Z be an indicator random variable that shows whether we are in up or down state at time t=1.

Definition of random variable Z

We have:

Formulas for delta_S and delta_N

Define new quantity Phi:

Definition of Phi

Multiply delta_S_1 by Phi:

Now let’s try to express delta_N_1 in terms of delta_S_1. We just add missing terms and subtract terms that we don’t need:

The calculations above show that we can express change in N as change in Sscaled by Phi and shifted by ksi.

Since S and N are Q-martingales we have:


Express expected value of delta_N as expected value of scaled and shifted delta_S:

In the last line above we can take Phi and ksi out of expectation because they are known beforehand (not random). We also know that the expected values of delta_N and delta_S are zero (as shown above). Then:

For the expression above to be equal to zero, ksi must be zero. From this we can conclude that change in N can be expressed as scaled change in S.

Binomial representation theorem


Now let’s see how it applies to pricing derivatives. Assume we have a bond process B_i, which we use to track the time-value of money. It is positive and previsible (since we assume that return of the bond is the same in any state of the world) and B_0=1. Also define:

For the next step we need Z_i to be a martingale with respect to some probability measure Q. Let’s check if it is true. I will demonstrate why it is true for the first time interval. The calculation is the same for all other cases. We need to show that:

Rewriting:

Solving for q:

If such q exists and lies in the interval between 0 and 1, then there is a probability measure Q under which the discounted stock process Z is a martingale. But this is the same expression we had in the beginning of the article and we’ve already shown that it lies in the interval [0,1].

Now we can safely assume that discounted stock process Z is a Q-martingale. Assume we have a claim X. Then we can define process E_i as follows:

Definition of E_i

So E_i is defined as expected value (under Q) of the discounted claim at time t=i given filtration F_i. We can show that process E is Q-martingale.

Proof that E is Q-martingale

Above we show that the expected value of (under Q) at time t=j given filtration F_i is equal to the current value of E (at time t=i). That means that process E is Q-martingale.

Now we have two processes — discounted stock process Z and discounted claim process X, which are both Q-martingales. Then from binomial representation theorem we can infer that there exists previsible process phisuch that:

That means that expected value of discounted claim is previsible. Therefore we can construct a portfolio (one time step before) which will be worth the expected value of discounted claim at the next time step (regardless of whether the stock moves up or down).

At time t=0 we construct a portfolio which is equal to the expected value (under Q) of discounted claim:

Portfolio at t=0

Phi_1 is the number of stocks to buy and psi_1 is the amount of cash to invest at risk-free rate (in bonds). We know that process phi is previsible, so phi_1 is known at time t=0. Formula for calculating it is shown below (see the previous section for detailed explanation).

Number of shares to buy

Expected value of the discounted claim E_0 is also known. Then psi_1 can be calculated as follows:

Calculating the amount of cash to invest

What happens in the end of the period? The value of portfolio changes, it is now worth:

Value of portfolio at t=1

At time t=1 we need to construct another portfolio — phi_2 stocks and psi_2bonds. Let’s calculate how much it costs.

Value of new portfolio at t=1

This new portfolio has exactly the same value as our previous portfolio. So we can sell the previous portfolio and buy the new portfolio without any additional investments. All the next steps are calculated in the same way. Each time after selling the portfolio from the previous time step we will get precisely the amount required to buy another portfolio and proceed to the next time step. At time T (maturity of the claim X) we have the following portfolio:

Value of portfolio at time T

So we have shown that starting with a certain portfolio (of stock and bond) at time t=0 we can create a self-financing (not requiring additional investments) strategy that replicates the payout of a given claim X at time t=T. Price of such portfolio is equal to the expected value of discounted claim under martingale measure Q. By no-arbitrage principle this is the only price which doesn’t allow arbitrage. If the price was different, someone could buy\sell derivative and then run the strategy to replicate it’s payout and make riskless profit.


Now let’s implement binomial pricing model in Python. The only thing we didn’t discuss yet is how to determine the price of the stock in up and down states. It can be determined from the volatility of log prices of the stock as follows:

up and down moves

The stock price is calculated by multiplying the stock price at the previous state by either u or d depending on the state.

Stock price in up and down states

We also need to calculate probabilities of up and down moves under which the discounted stock process is a martingale. These probabilities are also called risk-neutral probabilities. We can use the same formulas as before:

Calculating risk-neutral probabilities

Assume we want to calculate the price of European call and put options with maturity at time t=T. European options can be executed only at time T, so their payout depend only on the stock price at time T. What we need to do then is to calculate stock prices and corresponding probabilities for all possible states at time T. It is done using binomial tree with a given number of periods. Using this information we can calculate the price of an option which is equal to the expected value of discounted option payout under risk-neutral probabilities.

We are going to use the following parameters:

We want to price an option with strike price K=60 maturing in T=1 year. Current stock price S_0=50, annual stock volatility sigma=0.4 and annual risk-free rate r=0.05. At first we will use N=2 steps, so that we can easily check the results by hand.

First we calculate value of up and down moves — u and d, and risk-neutral probability p. Then we find the price of the stock in all possible terminal states and probability of each state (it’s basically a binomial distribution). Using the stock price we also calculate the value (at maturity) of call and put options. Results are saved to a dataframe.

Look at the resulting dataframe below.

Result

We can check that the calculated probabilities and prices are correct. On the screenshot below we check that the price of the stock after two up moves is 88.03 and probability of two up moves is 0.2246. This matches the results we have in a dataframe.

Checking results

To calculate the price of an option we need to find the expected value of its discounted payout under risk-neutral (martingale) probabilities.

We get the following prices:

Prices of call and put options

Below you can find the same code packed in a function.

Let’s see how the number of intervals affect the resulting price. On the screenshot below you can see the results of my experiment with different number of intervals N.

Using different number of intervals N

After N=100 we get only tiny changes in option prices. We can compare our results to the results of Black-Scholes pricing model. I used Black-Scholes model calculator available here.

Black-Scholes model results

Starting with a very simple binomial model we were able to get very good results. With high enough number of time periods N our results match those of the Black-Scholes model.


Jupyter notebook with source code is available here.

If you have any questions, suggestions or corrections please post them in the comments. Thanks for reading.


References

[1] Financial calculus: an introduction to derivative pricing (Baxter and Rennie)

[2] https://www.math.snu.ac.kr/~hichoi/finmath/finance_lecture_2012_ch3.pdf

[3] https://quant.stackexchange.com/questions/35075/previsibility-in-binomial-representation-theorem

[4] https://en.wikipedia.org/wiki/Binomial_options_pricing_model

Leave a Reply

Your email address will not be published. Required fields are marked *