finding_parameters: Finite difference parameters

View source: R/finding_parameters.R

finding_parametersR Documentation

Finite difference parameters

Description

The finding_parameters function calculate calculate time and price step sizes.

Usage

finding_parameters(initial_price, vol, I, multiplier_price, dt_simulate = 1/250)

Arguments

initial_price

numeric value, initial price of the asset.

vol

numeric value, volatility of the model, vol > 0.

I

numeric value, number of steps in the stock price.

multiplier_price

numeric value, a number multiplied by the initial_price to get an approximation to infinity.

dt_simulate

numeric value, time step size using in simulations.

Details

Explicit finite difference algorithm is not stable, it means we have an limitation on size of asset step size (which is not problematic) and on size of time step size (which is problematic). This function calculate good parameters to the asset and step size for stability of explicit finite difference algorithm.

dt_simulate argument is needed for a sake of interpolation. We want existing a natural k which meets: dt = dt_simulate/k , where dt is step size from finite difference algorithm. If dt is very small is no needed to have this property.

Value

A numeric vector, respectively price step size and time step size.

Examples

finding_parameters(100, 0.3, 600, 5)
finding_parameters(100, 0.5, 1000, 6, 1/500)


mociepa/ShortfallRiskHedging documentation built on Sept. 30, 2022, 6:43 p.m.