0
$\begingroup$

I need to calculate the annualized return of the VIX and it's Futures by using daily data from six and a half years. I tried to use the R-function Return.annualized from the PerformanceAnalytics-package:

 Return.annualized(vix,scale=252,geometric=TRUE)

But all R shows is "INF" as a result. Am I wrong by just letting the daily index values run through this?

Thanks for your help!

$\endgroup$
1
$\begingroup$

Your data must be corrupted. Can you run summary or hist on them to see whether there are NAs or prices that are not plausible?

The problem is that you work on prices. You should work on the returns of VIX: What about this:

library(PerformanceAnalytics)
library(xts)
data = read.table("clipboard",header=TRUE)

vix = xts(data$VIX, order.by = as.Date(data$Date,"%d.%M.%Y")  )
vix.ret = Return.calculate(vix, method = "discrete")
Return.annualized(vix.ret,scale=252,geometric=TRUE)
$\endgroup$
  • $\begingroup$ There are no missing values and the index ranges from 10.32 to 52.65. $\endgroup$ – Thessa Aug 7 '15 at 7:11
  • $\begingroup$ Can you post your data? e.g. upload it to gdrive and share the link? $\endgroup$ – Ric Aug 7 '15 at 7:12
  • $\begingroup$ drive.google.com/file/d/0B-j4esZ-O8IbSHNiV3gxSWo0NEU/… $\endgroup$ – Thessa Aug 7 '15 at 7:21
  • $\begingroup$ I got the data. Please post more code. You have to construct an xts object. How do you do that? $\endgroup$ – Ric Aug 7 '15 at 7:27
  • $\begingroup$ I just put the VIX and Date into an xts object: vix <- xts(vixts, order.by=datevix) $\endgroup$ – Thessa Aug 7 '15 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.