black_scholes | R Documentation |
This example illustrate how to use automatic differentiation to calculate the delte of a Black-Scholes call and put. It is based on the same example in the FastAD sources.
black_scholes(spot = 105, strike = 100, vol = 5, r = 1.25/100,
tau = 30/365)
spot |
A double with the spot price, default is 105 as in Boost example |
strike |
A double with the strike price, default is 100 as in Boost example |
vol |
A double with the (annualized) volatility (in percent), default is 5 (for 500 per cent) as in Boost example |
r |
A double with the short-term risk-free rate, default is 0.0125 as in Boost example |
tau |
A double with the time to expiration (in fractional years), default is 30/365 as in Boost example |
A matrix with rows for the call and put variant, and columns for option value, delta and vega
black_scholes()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.