Functions and R Code to Accompany Derivatives Markets

A set of pricing and expository functions that should be useful in teaching a course on financial derivatives.


derivmkts 0.2.2

  • Functions for compound options (call on call, call on put, etc.)

  • Binomplot: Option for log y axis

  • New vignette discussing alternative ways to write vectorized functions

derivmkts 0.2.1

  • Binomopt

    • Fixed: default dn=1.5 in binomopt and binomplot
    • Added "returnprice" parameter to binomplot
  • greeks

    • Simplification of Greeks discussion in README.Rmd
    • Greeks function ignores theta when appropriate (perpetual options)
  • callperpetual and putperpetual functions added to barriers.R

  • Asian options

    • Added individual geomavgpricecall, geomavgpriceput, geomavgstrikecall, and geomavgstrikeput functions.
    • Fixed greeks functionality for asian options

derivmkts 0.2.0

  • First CRAN release

  • Completed vignette


  • added simple bond functions (yield, pv, duration, convexity)

  • fixed problem with vectorization in barrier options


  • Added Asian pricing files


  • Greeks (delta, gamma, theta, added to binomial output)

  • With returntrees=TRUE, returns replicating portfolio components ($bond and $delta)


  • Added binomial pricing via binomopt and plotting of the binomial tree with binomplot


First version. Includes:

  • basic Black-Scholes functions and Greeks

  • barrier pricing

  • implied volatility

  • quincunx (Galton board) function to illustrate the central limit theorem

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.2.2 by Robert McDonald, 2 years ago

Browse source code at

Authors: Robert McDonald [aut, cre, cph]

Documentation:   PDF Manual  

Task views: Empirical Finance

MIT + file LICENSE license

Imports graphics, stats, grDevices, mnormt

Suggests highlight, markdown, knitr, rmarkdown

See at CRAN