BS_call {DtD} | R Documentation |
European Call Option Price and the Inverse
Description
Computes the European call option and the inverse. All vectors with length greater than one needs to have the same length.
Usage
BS_call(V, D, T., r, vol)
get_underlying(S, D, T., r, vol, tol = 1e-12)
Arguments
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 |
numeric vector with observed stock prices. |
tol |
numeric scalar with tolerance to |
Value
Numeric vector or scalar with price of the underlying asset or equity price.
See Also
Examples
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)))))
[Package DtD version 0.2.2 Index]