finite_difference_explicit: Explicit finite difference

View source: R/finite_difference_explicit.R

finite_difference_explicitR Documentation

Explicit finite difference

Description

The finite_difference_explicit function calculate option price using finite difference.

Usage

finite_difference_explicit(ds, dt, I, rate, volatility, End_Time, FUN, ..., is_modificate = FALSE)

Arguments

ds

numeric value, step size of the asset price.

dt

numeric value, step size of the time.

I

numeric value, number of steps in the stock price.

rate

numeric value, risk free rate in the model rate >= 0.

volatility

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

End_Time

numeric value, end time of the option.

FUN

the function to be applied, payoff option.

...

arguments to FUN.

is_modificate

logical value, determines whether FUN payoff is from modified payoff or not, see 'Details'.

Details

When is_modificate is TRUE (so when as FUN is used option_linear_payoff, option_convex_payoff, option_concave_payoff or option_modificate_payoff), there no need to write an risk free rate argument in ..., this argument is taken from rate argument.

Return of this option is a matrix. Rows determines changes of the option prices over time, when we price of the asset is not changing. The price of the asset increases as the rows increase. Time to exercise of the option increases as the columns increase. For example first column shows payoff price.

Value

A numeric matrix, calculated price of the option using finite difference method, see 'Details'.

Examples

ds <- finding_parameters(100, 0.3, 600, 5)[1]
dt <- finding_parameters(100, 0.3, 600, 5)[2]
finite_difference_explicit(ds, dt, 600, 0, 0.3, 1, call_payoff, 100)
finite_difference_explicit(ds, dt, 600, 0, volatility = 0.3, 1, FUN = option_modificate_payoff, const = 120, drift = 0.1, vol = 0.3, p = 1, call_payoff, 100, is_modificate = TRUE)


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