blackscholes: Vectorized Black-Scholes pricing of european-exercise options

Description Usage Arguments Details Value See Also Examples

View source: R/blackscholes.R

Description

Price options according to the famous Black-Scholes formula, with the optional addition of a jump-to-default intensity and discrete dividends.

Usage

1
2
blackscholes(callput, S0, K, r, time, vola, default_intensity = 0,
  divrate = 0, borrow_cost = 0, dividends = NULL)

Arguments

callput

1 for calls, -1 for puts

S0

initial underlying price

K

strike

r

risk-free interest rate

time

Time from 0 until expiration

vola

Default-free volatility of the underlying

default_intensity

hazard rate of underlying default

divrate

A continuous rate for dividends and other cashflows such as foreign interest rates

borrow_cost

A continuous rate for stock borrow costs

dividends

A data.frame with columns time, fixed, and proportional. Dividend size at the given time is then expected to be equal to fixed + proportional * S / S0. Fixed dividends will be converted to proportional for purposes of this algorithm.

Details

Note that if the default_intensity is set larger than zero then put-call parity still holds. Greeks are reduced according to cumulated default probability.

All inputs must either be scalars or have the same nonscalar shape.

Value

A list with elements

Price

The present value(s)

Delta

Sensitivity to underlying price

Vega

Sensitivity to volatility

See Also

Other Equity Independent Default Intensity: american_implied_volatility, american, black_scholes_on_term_structures, equivalent_bs_vola_to_jump, equivalent_jump_vola_to_bs, implied_volatilities_with_rates_struct, implied_volatilities, implied_volatility_with_term_struct, implied_volatility

Other European Options: black_scholes_on_term_structures, implied_volatilities_with_rates_struct, implied_volatilities, implied_volatility_with_term_struct, implied_volatility

Examples

1
2
blackscholes(callput=-1, S0=100, K=90, r=0.03, time=1, # -1 is a PUT
             vola=0.5, default_intensity=0.07)

Example output

Loading required package: limSolve
Loading required package: futile.logger
Welcome to ragtop.  Logging can be enabled with commands such as
  futile.logger::flog.threshold(futile.logger::INFO, name='ragtop.calibration')
$Price
[1] 15.98374

$Delta
[1] -0.2543956

$Vega
[1] 32.07111

ragtop documentation built on May 29, 2017, 2:53 p.m.