Delta Lab | Twitter | LinkedIn
This repository contains code for an R package that contains functions to compute and graph implied volatility for European Options.
- Omar Trejo
- September, 2016
install.packages(c("devtools", "roxygen2", "testthat", "knitr"))
Technically roxygen2
, testthat
, and knitr
are only required if you are
going to further develop this (or any other) package.
devtools::install_github("otrenav/implied_volatility")
NOTE: if you use yourown repository or fork this one, remember to install from your repository by changing
otrenav
to user corresponding user name.
library(ImpliedVolatility)
To see the available datasets included in the package (currently only one), execute:
data(package = "ImpliedVolatility")
If you want to use the included European Options dataset, execute:
data(european_options)
You may compute and graph the implied volatilities with:
results <- compute_and_graph_implied_volatilities(european_options)
You may also use the functions directly yourself:
implied_voltility <- compute_implied_volatilities("call", )
results <- append_implied_volatilities(european_options)
graph_implied_volatility(results)
- You can use
devtools::document()
to build the documentation - You can use
CTRL/CMD + SHIFT + B
in RStudio to build the package
If you want to re-build documentation everytime you build the package adjust your settings inside RStudio as follows:
- Click on menu: "Build" / "Configure Build Tools"
- Activate "Generate documentation with Roxygen"
- Click on "Configure"
- Activate "Build & Reload"
- Save your settings
The previous instructions work fine using:
- RStudio version 0.99.903
- R version 3.2.3
"We are the people we have been waiting for."