DtD (version 0.2.0)

BS_call: 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..

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, \(\sigma\)s.

S

numeric vector with observed stock prices.

tol

numeric scalar with tolerance to get_underlying. The difference is scaled if the absolute of S is large than tol as in the tolerance argument to all.equal.numeric.

Value

Numeric vector or scalar with price of the underlying asset or equity price.

See Also

BS_fit

Examples

Run this code
# NOT RUN {
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)))))

# }

Run the code above in your browser using DataCamp Workspace