# Variance Swap Replcation in R.

July 6, 2013
By

(This article was first published on Quant-Day, and kindly contributed to R-bloggers)

As I was studying volatility derivatives I made some charts that represent some key features of replication. Say variance swap has a payoff function $$f=(\sigma^2 – K_{VOL})$$, which means that $$K_{VOL}$$ will most likely be the forward volatility close to implied. To replicate this theory goes deep into maths and log-contrats that are not even traded on the market, however the idea is simple, buy a portfolio of options with equally distributed strike prices and weight them by reciprocal of squared strikes, i.e.$$1 \big/ K^2$$. Go for liquid ones, i.e. out of the money puts and out of the money calls. Then volatility or in this case variance is dependent on VEGA sensitivity of portfolio. The following graph gives an idea of how it is done. The code is included below:

X-Y – spot/time to maturity, Z – Vega$$\left(\frac{\partial C}{\partial \sigma}\right)$$.

Code:

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...