stellathecat / github

0 stars 0 forks source link

vix-replication.R #3

Open stellathecat opened 7 years ago

stellathecat commented 7 years ago

Hi Vladi!

spx_data[complete.cases(spx_data), ] gives me 0 observations. I skipped this line and created a plot in the folder. Do you have the same result on your computer?

kurnosovv commented 7 years ago

Yes, this is error. With this line I tried to remove rows with impl_volatility=NA. The correct code is spx_data = spx_data[!is.na(spx_data$impl_volatility), ] Or you may not do it. Cause I see that impl_volatility=NA only for the very first date. So if you do not remove NAs, the code will return VIX=NA for this date, and it will not affect calculations for other dates.

stellathecat commented 7 years ago

Ok! If you have the same plot, there is probably a detail in the conversion. At least the level should be approximately the same. I remember it was sometimes not clear how to annualize volatilities. I will check!

kurnosovv commented 7 years ago

Yep, I just did not notice that you uploaded the script and the picture, so did not verify it till the end. The levels are very different, that's why I suppose I missed something, or my implementation is not incorrect.