Description Usage Arguments Details Value
Sets up grid and function evaluations over grid to create tridiagonal system coefficients for the solver to take.
1 | pde_setup(f, contract_specs, numeric_specs)
|
f |
the list of coefficient functions (f.mu, f.vo, f.rate) |
contract_specs |
list of variables defining contract specifications, see details |
numeric_specs |
list of variables defining numerical specifications, see details |
A basic discretization scheme is used, functions are evaluated via loops then coefficients are returned in a list. For risk neutral pricing
the drift and rate functions should match.
The list contract_specs
must contain
spot
numeric, the spot price
div
numeric, the dividend yield rate
maturity
numeric, the time until expiration in trading years (DTE/252)
payoff
the payoff name: "put", "call", "strangle", "straddle", "iron_condor", "put_debit", "call_debit", "indicator" and "cdf"
payoff_param
list of parameters for the payoff function
,
while the list numeric_specs
should contain
N
time-resolution (integer)
M
space-resolution (integer)
B
boundary for the log-price space, which can be optional
list containing
grid.x, a discretized interval of the spatial/price variable
grid.t, a discretized interval of the time variable
alpha, the lower diagonal in the tridiagonal matrix in the linear system resulting from the discretized PDE
beta, the diagonal in the tridiagonal matrix in the linear system resulting from the discretized PDE
delta, the upper diagonal in the tridiagonal matrix in the linear system resulting from the discretized PDE
spot, the given spot price, needed to be passed to pde_solve
div, the dividend rate, also needed to be passed to pde_solve
m, the drift rate at the current time and price level
v, the volatility at the current time and price level
r, the risk-free rate, at the current time and price level
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.