Consider the period binomial model with . Suppose the derivative payout at maturity is a random variable with known distribution.
Idea: Starting from the leaves (known ), we will recursively go down levels computing discounted expected values.
Algorithm #1
If we wish to price path-dependent options, we must keep track of all possible path evolutions in our lattice up the time we are interested in :
Initialization
-
Given we will compute the lattice evolution up to time where: for all , . Note that stands for βstock price at time with state ups from t=0.β This is because the number of ups, uniquely characterize a point in our lattice.
-
Compute all possible payouts at maturity. for
-
For do: for all states compute:
- Return
This has a complexity of when implemented in a naive way because it goes through all possible evolution. Depending on the option this can be improved.
Algorithm #2:
To price path-independent option, we can simplify Algorithm 1 and just count the number of ups. This uses the fact that is the same in the binomial lattice no matter independent of the path and only dependent on the number of ups, ie. trajectories and have the same stock value .
To find the price of a path-independent option
- Compute the payouts at maturity (the leaves of the lattice).
for (j in 1:T) {
V[T][j] = max((S[T][j]), 0)## for European call for instance
}
- Compute backwards in time until you get to :
# d, u are down and up steps
algo21 <- function(u,d,r, V, T){
q_u = (e^r-d)/(u-d) # risk-free probability of up
q_d = 1-q_u
for (t in T-1:0){
for (j in 0:t){
V[t][j] = (e^(-r)*(q_u* V[t+1][j+1] + q_d*V[t+1][j])
}
}
return V[0][0]
}
American Option pricing
In American options we can exercise at any time up until maturity. We must keep track of two values at time :
- : The current exercise value, payout at time .
- : The continuation value, the value of the option if not exercised at time t (present value of what it is expected to give us).
Assuming rational agents, at any time in an American option, we exercise if and hold otherwise.
We can adapt **Algorithm #1 to price this:
Algorithm 2.3:
- Compute all possible payouts at maturity corresponsing to all possible states
- Go backwards in time. For do:
- for all states do: a. Compute the continuation value b. Compute the execution value c. Compute the rational value
- Return
Just like with Algorithm 2.2, if we have a path-independent option we can simplify this algorithm by expressing values in terms of number of up states as opposed to expressing them in terms of entire state evolutions