Last updated: 2023-03-16.
tf_quant_finance.experimental.american_option_pricing.andersen_lake.calculate_exercise_boundary#
Calculates the exercise boundary function of an American option.
tf_quant_finance.experimental.american_option_pricing.andersen_lake.calculate_exercise_boundary(
tau_grid, k, r, q, sigma, max_iterations=20, tolerance=1e-08,
integration_num_points=32, dtype=None
)
Iteratively calculates the exercise boundary function of an American option.
This corresponds to B in formula (3.9) in the paper [1].
References#
[1] Leif Andersen, Mark Lake and Dimitri Offengenden. High-performance American option pricing. 2015 https://engineering.nyu.edu/sites/default/files/2019-03/Carr-adjusting-exponential-levy-models.pdf#page=55
Example#
tau = tf.constant([0.01, 0.02, 1], dtype=tf.float64)
k = tf.constant([1, 2, 3], dtype=tf.float64)
r = tf.constant([0.01, 0.02, 0.035], dtype=tf.float64)
q = tf.constant([0.01, 0.02, 0.07], dtype=tf.float64)
sigma = tf.constant([0.1, 0.15, 0.32], dtype=tf.float64)
grid_num_points = 40
max_iterations = 600
tolerance = 1e-8
integration_num_points = 32
tau_grid = tf.linspace(tf.constant(0.0001, dtype=tf.float64), tau,
grid_num_points, axis=-1)
exercise_boundary(tau_grid, k, r, q, sigma, max_iterations, tolerance,
integration_num_points)
# Returns a tensor of shape [3, 40].
Args:#
tau_grid: Grid of values of shape[num_options, grid_num_points]indicating the time left until option maturity.k: Same dtype astau_gridwith shapenum_optionsrepresenting the strike price of the option.r: Same shape and dtype askrepresenting the annualized risk-free interest rate, continuously compounded.q: Same shape and dtype askrepresenting the dividend rate.sigma: Same shape and dtype askrepresenting the volatility of the option’s returns.max_iterations: Maximum number of iterations for calculating the exercise boundary if it doesn’t converge earlier. Default value: 20.tolerance: Represents the tolerance for the relative difference between the old and new exercise boundary function values, at which to stop further calculating a new exercise boundary function.integration_num_points: The number of points used in the integration approximation method. Default value: 32.dtype: If supplied, the dtype for all input tensors. Result will have the same dtype. Default value: None which maps to dtype oftau.
Returns:#
Callable expecting Tensor of shape [num_options, n] as input (where
n is an arbitrary integer) and returning Tensor of the same shape.
Represents the exercise boundary function of an American option pricing
algorithm.