# Derivatives Modeling with R

This ebook provides a conceptual and practical guide to analyzing derivatives instruments such as Futures Contracts and Options with R programming language. The ebook has a well-balanced structure between theoretical concepts and practical examples and aims to show important properties of Derivatives Instruments using R.

#### Part 1: Futures Contracts with R

The first part of the book describes the fundamental properties of futures contracts. At the beginning of this section, we will perform some data exploration tasks about futures contract prices which show specific properties of these assets using important R packages such as ggplot, dplyr and the apply family functions from R. The different datasets that are used in this section and the whole ebook come from public APIs such as Quandl and CSV files.

We then move on to provide examples of how to convert a dataset into tidy data in order to extract meaningful features about datasets, make elegant plots using the ggplot library, build R functions from scratch and use R built-in functions to clean data. We also demonstrate with examples and visualization tools important properties and concepts of futures contracts such as the term structure of futures contracts and the high volatility of futures contracts.

#### Part 2: Valuation of Options with R

The second section of the book focuses on understanding how options are valued using two popular models, namely, Black Scholes model and the Binomial model. Both models are implemented using R functions to understand from scratch the valuation process and their intermediate steps.

#### Part 3: Options Greeks with R

The next section focuses on Option Greeks and their importance to understand option price movements.

#### Part 4: Options Strategies with R

In the final section, we show how to use the R language to simulate options strategies such as the Bull Call Spread, Long Straddle, Iron Condor, and Butterfly Spread. To have a better understanding of how these strategies work and the different payoff scenarios of each strategy, they are plotted using ggplot package.

**What's Included**

- Detailed concepts and explanations about each topic
- Step-by-step instructions for all analysis and calculations
- All the data files used in the book
- Complete downloadable R code for all examples used in the book