Last chance! 50% off unlimited learning
Sale ends in
Price a European plain-vanilla call with the characteric function.
callCF(cf, S, X, tau, r, q = 0, ...,
implVol = FALSE, uniroot.control = list(), uniroot.info = FALSE)
cfBSM(om, S, tau, r, q, v)
cfMerton(om, S, tau, r, q, v, lambda, muJ, vJ)
cfBates(om, S, tau, r, q, v0, vT, rho, k, sigma, lambda, muJ, vJ)
cfHeston(om, S, tau, r, q, v0, vT, rho, k, sigma)
cfVG(om, S, tau, r, q, nu, theta, sigma)
characteristic function
spot
strike
time to maturity
the interest rate
the dividend rate
arguments passed to the characteristic function
logical: compute implied vol?
A list. If there are elements named
interval
, tol
or maxiter
, these are passed to
uniroot
. Any other elements of the list are ignored.
logical; default is FALSE
. If TRUE
,
the function will return the information returned by
uniroot
. See paragraph Value below.
a (usually complex) argument
a numeric vector of length one
a numeric vector of length one
a numeric vector of length one
a numeric vector of length one
a numeric vector of length one
a numeric vector of length one
a numeric vector of length one
a numeric vector of length one
a numeric vector of length one
a numeric vector of length one
a numeric vector of length one
Returns the value of the call (numeric) under the respective model or,
if implVol
is TRUE
, a list of the value and the implied
volatility. (If, in addition, uniroot.info
is TRUE
, the
information provided by uniroot
is also returned.)
The function computes the value of a plain vanilla European call under
different models, using the representation of Bakshi/Madan. Put values
can be computed through put--call parity (see
putCallParity
).
If implVol
is TRUE
, the function will compute the
implied volatility necessary to obtain the same value under
Black--Scholes--Merton. The implied volatility is computed with
uniroot
from the stats package. The default search
interval is c(0.00001, 2)
; it can be changed through
uniroot.control
.
The function uses variances as inputs (not volatilities).
The function is not vectorised (but see the NMOF Manual for examples of how to efficiently price more than one option at once).
Bates, David S. (1996) Jumps and Stochastic Volatility: Exchange Rate Processes Implicit in Deutsche Mark Options. Review of Financial Studies 9 (1), 69--107.
Gilli, M., Maringer, D. and Schumann, E. (2019) Numerical Methods and Optimization in Finance. 2nd edition. Elsevier. https://www.elsevier.com/books/numerical-methods-and-optimization-in-finance/gilli/978-0-12-815065-8
Heston, S.L. (1993) A Closed-Form Solution for Options with Stochastic Volatility with Applications to Bonds and Currency options. Review of Financial Studies 6 (2), 327--343.
Schumann, E. (2019) Financial Optimisation with R (NMOF Manual). http://enricoschumann.net/NMOF.htm#NMOFmanual
# NOT RUN {
S <- 100; X <- 100; tau <- 1
r <- 0.02; q <- 0.08
v0 <- 0.2^2 ## variance, not volatility
vT <- 0.2^2 ## variance, not volatility
v <- vT
rho <- -0.3; k <- .2
sigma <- 0.3
## jump parameters (Merton and Bates)
lambda <- 0.1
muJ <- -0.2
vJ <- 0.1^2
## get Heston price and BSM implied volatility
callHestoncf(S, X, tau, r, q, v0, vT, rho, k, sigma, implVol = FALSE)
callCF(cf = cfHeston, S=S, X=X, tau=tau, r=r, q = q,
v0 = v0, vT = vT, rho = rho, k = k, sigma = sigma, implVol = FALSE)
## Black-Scholes-Merton
callCF(cf = cfBSM, S=S, X=X, tau = tau, r = r, q = q,
v = v, implVol = TRUE)
## Bates
callCF(cf = cfBates, S = S, X = X, tau = tau, r = r, q = q,
v0 = v0, vT = vT, rho = rho, k = k, sigma = sigma,
lambda = lambda, muJ = muJ, vJ = vJ, implVol = FALSE)
## Merton
callCF(cf = cfMerton, S = S, X = X, tau = tau, r = r, q = q,
v = v, lambda = lambda, muJ = muJ, vJ = vJ, implVol = FALSE)
## variance gamma
nu <- 0.1; theta <- -0.1; sigma <- 0.15
callCF(cf = cfVG, S = S, X = X, tau = tau, r = r, q = q,
nu = nu, theta = theta, sigma = sigma, implVol = FALSE)
# }
Run the code above in your browser using DataLab