View source: R/delta_finite_difference.R
delta_finite_difference | R Documentation |
The delta_finite_difference function calculate number of asset needed to hedge an option using finite difference.
delta_finite_difference(option_value, ds, is_continuous = TRUE, discontinuity_points = NA)
option_value |
numeric matrix, option prices, return from finite_difference_explicit function. |
ds |
numeric value, asset step size. |
is_continuous |
logical value, TRUE means that the payoff function is continuous due to the asset price. |
discontinuity_points |
numeric vector, denoting at which points of asset price the payoff function is discontinuous. Elements of this vector have to be positive. |
A numeric matrix, estimated number of asset needed to hedge an option.
ds <- finding_parameters(100, 0.3, 600, 5)[1] dt <- finding_parameters(100, 0.3, 600, 5)[2] option <- finite_difference_explicit(ds, dt, 600, 0, 0.3, 1, call_payoff, 100) delta_finite_difference(option, ds) option <- finite_difference_explicit(ds, dt, 600, 0, 0.3, 1, FUN = option_modificate_payoff, const = 120, drift = 0.1, vol = 0.3, p = 1, call_payoff, 100, is_modificate = TRUE) delta_finite_difference(option, ds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.