BS_call {DtD} | R Documentation |
Computes the European call option and the inverse. All vectors with length greater than one needs to have the same length.
BS_call(V, D, T., r, vol) get_underlying(S, D, T., r, vol, tol = 1e-12)
V |
numeric vector or scalar with price of the underlying asset. |
D |
numeric vector or scalar with debt due in |
T. |
numeric vector or scalar with time to maturity. |
r |
numeric vector or scalar with risk free rates. |
vol |
numeric vector or scalar with volatilities, σs. |
S |
numeric vector with observed stock prices. |
tol |
numeric scalar with tolerance to |
Numeric vector or scalar with price of the underlying asset or equity price.
library(DtD) set.seed(58661382) sims <- BS_sim( vol = .2, mu = .03, dt = .1, V_0 = 100, T. = 1, D = rep(80, 20), r = .01) stopifnot(with( sims, isTRUE(all.equal(V, get_underlying(S, D, T, r, vol))))) stopifnot(with( sims, isTRUE(all.equal(S, BS_call(V, D, T, r, vol)))))