name: title class: center, middle, inverse # Should I stay or should I go? ## Optimal Exercise Decisions using the Longstaff-Schwartz Algorithm --- name: agenda # Agenda
## What is a Call / Exercise Right? - American Put Option ## Valuation by Simulation - Risk-Neutral Valuation with Monte Carlo - Exercise vs. Continuation Value - Perfect Foresight and Nested Simulation ## Longstaff-Schwartz Algorithm - Approximation of Continuation Value - Longstaff-Schwartz Algorithm in Python - Approximation Steps - Exercise or Hold ## Beyond Examples - More Complex Call Rights and Payoffs - A Framework for Optimal Exercise Decisions and Call Right Valuation ??? - No formulas, many graphics --- # What is a Call Right? ## Example: Value of a Gold Coin ![coin](img/coin.png) ![coinvalue](draw/coin-value.svg) - Current value of the gold coin is about 680€ - Gold price may further increase, but could also fall --- # What is a Call Right? ## Future Scenarios of the Coin Value ![drawing](draw/monte-carlo.svg) - Simulation model of the future coin value - Each line is a possible future scenario, called "path" --- # What is a Call Right? ## I don't want the Coin to loose Value | Scenario | What I want | | |------------------|---------------------|---| | Always | Keep the coin |![coinintable](img/coin.png)| | Coin value rises | Participate |![coinintable](draw/smiley_happy.svg)| | Coin value falls | Not loose any value |![coinintable](draw/smiley_neutral.svg)| - I do not want to sell the coin - I want to protect myself against a loss due to falling gold prices - I want to profit from a rising gold price - Is all of that possible? Yes, but I have to pay for it --- # What is a Call Right? ## We enter a Contract on the Coin Value I can pick any date within the next five years where you have to pay me the difference between the 680€ and the current price; e.g. if the value of the coin was 610€, you would pay me 680€ - 610€ = 70€ ![americanoption](draw/american-option-contract.svg) - I can only pick a date once, but I can choose any day within the next five years - I now have a call right or exercise right - This specific contract is called an American Put Option - You can only loose in the future, so you will request a premium ![americanoptionpremium](draw/american-option-premium.svg) --- # What is a Call Right? ## American Put Option Payoff ![drawing](draw/american-option-payoff.svg) - If the gold price rises, I will not exercise the option, i.e. I get a payoff of 0€ - If the gold price falls and the coin is worth x < 680€, I can can exercise the option and get the difference 680€ - x - Expressing this in a common formula, the payoff of the option when exercising is ``` max(680€ - x, 0) ``` --- # What is a Call Right? ## Check of Requirements | Scenario | What I want | Option Payoff | Coin Value + Option Payoff || |------------------|---------------------|---|---|---| | Always | Keep the coin |||![check](draw/check.svg)| | Coin value rises to x | Participate |0€|x + 0€ = x > 680€|![check](draw/check.svg)| | Coin value falls to x | Not loose any value |680€ - x|x + 680€ - x = 680€|![check](draw/check.svg)| - I get to keep the coin - If the gold price rises, my coin becomes more valuable and the option does nothing - If the gold price falls, my coin looses value, but I can exercise the option to make up for the loss --- # What is a Call Right? ## American Put Option Exercise Decisions ![drawing](draw/american-option.svg) - Whenever the coin value drops below 680€, I have to decide whether to exercise the option or hold and wait - As long as the coin value is above 680€, I will hold - How much should I pay / should you charge me for this contract? - When should I exercise the option (which date should I choose)? --- # Risk-Neutral Valuation using Monte Carlo Method ![drawing](draw/monte-carlo.svg) - When using the Monte Carlo method, the coin value is simulated (sampled) independently many times - Valuation happens by averaging payoffs over paths - For example: (725€ + 710€ + 685€ + 670€ + 665€) / 5 = 3455 / 5 ≈ 680€ ??? - With Monte Carlo method, model is simulated (sampled) many times - Independent realizations of a stochastic process are called paths - Each path can be seen as one possible future scenario - All paths are equally likely - Valuation happens by averaging payoffs over paths - We know now how to evaluate payoffs; how can we handle call rights? --- # Exercise vs. Continuation Value ![drawing](draw/exercise-or-continue.svg) - Whenever the cashflow from exercising the put is larger than the continuation value, exercise is favourable - As it can only be exercised once, it would be exercised on the first favourable exercise date ??? - To evaluate call rights, we have to compare two values: - Exercise value and continuation value - Exercise value is the cashflow we receive on exercising the option - Continuation value is the value of the option if we do not exercise - When exercise value is larger than continuation value we exercise, otherwise we don't - How do we get exercise and continuation value? - One is simple, the other one is hard --- # Exercise Value ![small-img](img/monte-carlo.svg) ![small-img](img/exercise-value.svg) Obtaining the exercise value is simple: just plug the underlying value (stock price) into the payoff function. ??? - On the left is the simulated stock price - We simply plug the call price into the payoff formulate of the Put option and get the exercise value - On the right we see the exercise value for all paths and timesteps - We have to an approximation: we cannot simulate continuously in time, but only for discrete time steps - Exercise value is simple, but how do we get continuation value? --- # Perfect Foresight / Hindsight ![drawing](draw/perfect-foresight.svg) - With perfect foresight / hindsight we simply look at the future payoffs we can generate on each path and compute the continuation value from that - Exercising on this basis gives perfect decisions in hindsight - This is approach is wrong as it looks into the future; my call right would we over-valued ??? - Let's first discuss an approach that does not work - Can we simply use the future underlying values on a path to estimate the local continuation value? - No, we would be looking into the future; we would over-estimate the options value - Instead of the future values on the path we would need the **conditional expectation** given where we are --- # Nested Simulation ![drawing](draw/nested-simulation.svg) - With nested simulation, a new set of independent paths has to simulated for each existing path from the call right onwards - The computational effort grows exponentially with the number of call rights ??? - Let's try it with brute force: - For every path we perform a new set of simulations from the call right onwards - This approach is called nested simulation because we nest one simulation into another - This approach gives the correct result... - ...but the computational effort **grows exponentially** with more call rights --- # Approximation of Continuation Value ![drawing](draw/continuation-value-approximation.svg) - We approximate the continuation value by using all future path information and fit a function to it - This "averages out" the individual information on every path that we may not use --- # Approximation of Continuation Value ![](img/continuation-value-cashflows.svg) ??? - Let's try to approximate the continuation value --- # Approximation of Continuation Value ![](img/continuation-value-approximation.svg) ??? - Notice that we neither extrapolate nor interpolate with the fitted polynomial - We only apply the fitted curve at points we used in the regression (in sample) - We want to **smooth out the idioyncratic** information of each path... - ...so that we do not use future information anymore - This is a polynomial curve fitting problem and numpy gives us a nice tool to handle it... --- # Polynomials in NumPy ``` import numpy as np from numpy.polynomial import Polynomial import matplotlib.pyplot as plt x = np.array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]) y = np.array([0., -1., -1.4, -1.6, -1.2, -0.5, 0.9, 1.6, 2.1, 2.2, 2.3]) p = Polynomial.fit(x, y, 4) plt.figure(figsize=[6, 3]); plt.plot(*p.linspace(), '-'); plt.plot(x, y, '+'); ``` ![](img/numpy-polynomials.svg) ??? ``` plt.gca().set_position([0.08, 0.08, 0.9, 0.9]) plt.savefig('img/numpy-polynomials.svg') ``` - We now have all the tools and prerequsites to do the algorithm --- # Longstaff-Schwartz Algorithm in Python ``` # simulated paths as array of shape (60, 50) representing (timesteps, paths) X = np.array([[...], ...]) strike = 1.0 # given no prior exercise we just receive the payoff of a European option cashflow = np.maximum(strike - X[-1, :], 0.0) # iterating backwards in time for i in reversed(range(1, X.shape[0] - 1)): x = X[i, :] # exercise value for time t[i] exercise = np.maximum(strike - x, 0.0) # boolean index of all in-the-money paths itm = exercise > 0.0 # fit polynomial of degree 2 fitted = Polynomial.fit(x[itm], cashflow[itm], 2) # approximate continuation value continuation = fitted(x) # boolean index where exercise is beneficial ex_idx = itm & (exercise > continuation) # update cashflows with early exercises cashflow[ex_idx] = exercise[ex_idx] ``` ??? - We initialize the cashflow array with the payoff at maturity (at the last time step) - Then we work backwards in a loop - Discounting is ignored (i.e. interest rates are assumed to be zero) - In the end we have the cashflow at the first time step with an exercise right; we now only need to discount to today and average - Let's look at the data this algorithm generates... --- # Approximated Continuation and Exercise Value I ![](img/approximated-continuation-and-exercise-value-0.svg) --- # Approximated Continuation and Exercise Value II ![](img/approximated-continuation-and-exercise-value-1.svg) --- # Approximated Continuation and Exercise Value III ![](img/approximated-continuation-and-exercise-value-2.svg) ??? - Closer to now we see no favourable exercises at all - Let's now see when the algorithm recommends us to exercise... --- # Exercise or Hold ![](img/exercise-or-hold.svg) --- # First Favourable Exercise ![](img/first-exercises.svg) --- # Exercise Boundary ![](img/binomial-fitted-exercise-boundary.svg) ??? - I have tried to fit a curve as a simple exercise boundary, but the results do not look promising - We are approaching the end, just a few words about generalization of the code... --- # More Complex Call Rights - Sometimes there is no concept of "in-the-money" paths; if exercise might be favourable on all paths, regression should be performed on all paths - If the payoff depends on more than a single state variable, regression should be performed on basis functions of all state variables (and their interactions to a limited degree) - If the payoff us path-dependent (non-Markovian), we have to evaluate the exercise/payoff function on the entire path up to the current time step --- name:framework # A General Framework for Optimal Exercise Decisions and Call Right Valuation .column-4[ #### Payoff and Call Right Description
Financial product description in serialized form (JSON, XML) and / or as an object model
Our approach: Python payoff code for an American Put, no generalization ] .column-4[ #### Risk-Neutral Valuation Model
Arbitrage-free replication model and pricing technique (analytical, PDE solving, Monte Carlo, ...)
Our approach: Monte Carlo pricing in a Black-Scholes model ] .column-4[ #### Marketdata and Calibration
Fit model parameters to market quotes (forward curves, implied volatilities, ...)
Our approach: Freely choose model parameters ] .column-4[ #### Exercise Algorithm
Computation or approximation of continuation values and optimal exercise decisions
Our approach: Use Longstaff-Schwartz ] --- # Source **Francis A. Longstaff, Eduardo S. Schwartz**, *Valuing American Options by Simulation: A Simple Least-Squares Approach* (The Review of Financial Studies) (2001) Vol 14, No 1, pp. 113-147.
# Slides and Jupyter Notebook https://ogy.de/call-rights ![qrcode](img/qrcode.png) ??? - Before moving to Q&A, a few words on the original paper