Unlike many humans, markets love change. In fact, they look forward to it with great anticipation. Regular people like stability, for the most part. Unless you’re a career gypsy, you like to stay in one place for some time. Making a home. Settling in, as it were. Unlike markets, where volatility is the raison d’etre.

I’ve plotted the values for VIX, which is the CBOE’s volatility index calculated by some magic formula that considers 30-day expectation of price movement, in the chart below. Next to it is a plot of 30-day returns for the SPX, or a graph that plots all the percentage changes for each 30-day window. Quite frankly, I’m not sure what conclusions to draw from this, except that expectations in markets usually fall short.

The R code:

library(vioplot)

library(quantmod)

VIX <- getSymbols("^VIX", auto.assign=FALSE)[,4]

SPX <- getSymbols("^GSPC", auto.assign=FALSE)[,4]

VIX <- VIX/100

SPX <- Delt(SPX, k=30)

SPX <- na.locf(SPX, na.rm=TRUE)

SPX <- abs(SPX)

vioplot(VIX, SPX, names=c("VIX", "SPX"), col="red3")

title("Violins of Volatility")

*Related*

To

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

** Milk Trader**.

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...

If you got this far, why not

__subscribe for updates__ from the site? Choose your flavor:

e-mail,

twitter,

RSS, or

facebook...

**Tags:** R, volatility