option_linear_payoff: Calculate payoff from modificate european option

View source: R/option_linear_payoff.R

option_linear_payoffR Documentation

Calculate payoff from modificate european option

Description

The option_linear_payoff function is used to calculate payoff of modified european option.

Usage

option_linear_payoff(const, asset_price, drift, rate, FUN, ...)

Arguments

const

numeric value, parameter of the modified payoff.

asset_price

numeric vector, the price of the asset over the life of the option.

drift

numeric value, drift of the model.

rate

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

FUN

the function to be applied, payoff option: see 'Details' and 'Examples'.

...

arguments to FUN

Details

FUN have to had parameter asset_price which represent price oft the asset over the life of the option, see call_payoff

Arguments in ... cannot have the same name as any of the other arguments, and care may be needed to avoid errors.

Value

A numeric value, payoff of the modified european option using linear loss function.

Examples

option_linear_payoff(110, c(121.1, 120, 125.4), 0.1, 0.05, call_payoff, strike = 105)
option_linear_payoff(110, c(141.1, 150, 135.4), 0.1, 0.05, put_payoff, strike = 150)
## Example with asian call payoff
asian_call <- function(asset_price, strike){
  return(mean(asset_price) - min( mean(asset_price), strike ))
  }
option_linear_payoff(110, c(121.1, 120, 125.4), 0.1, 0.05, asian_call, strike = 105)


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