# Variance Swap Replcation in R.

**Quant-Day**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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:

**leave a comment**for the author, please follow the link and comment on their blog:

**Quant-Day**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.