# putCallParity: Put-Call Parity In enricoschumann/NMOF: Numerical Methods and Optimization in Finance

Put–call parity

## Usage

 `1` ``` putCallParity(what, call, put, S, X, tau, r, q = 0, tauD = 0, D = 0) ```

## Arguments

 `what` character: what to compute. Currently only `call` or `put` are supported. `call` call price `put` put price `S` underlier `X` strike `tau` time to expiry `r` interest rate `q` dividend rate `tauD` numeric vector: time to dividend `D` numeric vector: dividends

## Details

Put–call parity only works for European options. The function is vectorised (like `vanillaOptionEuropean`), except for dividends.

Numeric vector.

Enrico Schumann

## References

Gilli, M., Maringer, D. and Schumann, E. (2011) Numerical Methods and Optimization in Finance. Elsevier. http://www.elsevierdirect.com/product.jsp?isbn=9780123756626

Schumann, E. (2016) Financial Optimisation with R (NMOF Manual). http://enricoschumann.net/NMOF.htm#NMOFmanual

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25``` ```S <- 100; X <- 100; tau <- 1; r <- 0.02; q <- 0.0; vol <- 0.3; D <- 20; tauD <- 0.5 call <- vanillaOptionEuropean(S, X, tau, r, q, vol^2, tauD = tauD, D = D, type = "call")\$value put <- vanillaOptionEuropean(S, X, tau, r, q, vol^2, tauD = tauD, D = D, type = "put")\$value ## recover the call from the put (et vice versa) all.equal(call, putCallParity("call", put = put, S=S, X=X, tau=tau, r=r, q=q, tauD=tauD, D=D)) all.equal(put, putCallParity("put", call = call, S=S, X=X, tau=tau, r=r, q=q, tauD=tauD, D=D)) ## Black--Scholes--Merton with with 'callCF' S <- 100; X <- 90; tau <- 1; r <- 0.02; q <- 0.08 v <- 0.2^2 ## variance, not volatility (ccf <- callCF(cf = cfBSM, S = S, X = X, tau = tau, r = r, q = q, v = v, implVol = TRUE)) all.equal(ccf\$value, vanillaOptionEuropean(S, X, tau, r, q, v, type = "call")\$value) all.equal( putCallParity("put", call=ccf\$value, S=S, X=X, tau=tau, r=r, q=q), vanillaOptionEuropean(S, X, tau, r, q, v, type = "put")\$value) ```

enricoschumann/NMOF documentation built on June 5, 2019, 8:56 a.m.