## Quick lag analysis for put-call ratio on daily S&P 500 returns

June 1, 2014 by zulfahmed

The substantial conclusion is not particularly interesting: 1-day lagged put-call ratio has some explanatory power for S&P 500 returns with an adjusted R-squared of 0.06. Some notes on quick analysis is useful nonetheless for purely technical usage of R. The quantmod function getStocks can be used to obtain “GSPC” from yahoo and will produce not a normal data frame but an xts object indexed by date. One extracts the index by the ‘index’ function. Obtaining the put-call ratio from CBOE we need to merge the data frames. The easiest way to do this is to convert the resulting data frame also to an xts object and then use ‘merge’. The simplest way to perform the lagged regressions is to use ‘dyn’ package which allows syntax such as:

dyn$lm( X$Ret ~ lag( X$V5, 1), as.zoo(X))

where X is the merged data frame.

The significance of the 1-day lagged put-call ratio in return prediction is mildly surprising as this is information that is heavily used in the industry. However, the ‘signal strength’ is fairly weak, far below the R-squared of 0.6 which is the sort of unofficial bound before people start taking statistical models seriously for trading.

A very useful thing to do is to use the package ‘entropy’ to calculate the mutual information between 1-day lagged put-call ratio and S&P 500 daily returns. One has to discretize the continuous variables — the package provides a nice ‘discretize2d’ function where number of bins can be specified; one has to remove the NA first. Then one can use ‘mi.empirical’ to calculate the mutual information. The value for 20×20 bins for our data is 0.097 which is an interesting figure.

### Like this:

Like Loading...

*Related*

## Leave a Reply