Using the ROC function in the R package TTR, there is a choice between continuous (the default) and discrete, but with no guidance on which you choose when. In the code the difference is:
roc <- x/lag(x) - 1
versus:
roc <- diff(log(x))
I admit my maths is weak but aren't they the same thing?
cbind(ROC(x,type='continuous'),ROC(x,type='discrete'),log(x))
gives:
2012-08-16 19:00:00 NA NA 8.673855
2012-08-17 07:00:00 0.00008549566 0.00008549932 8.673940
2012-08-17 08:00:00 0.00000000000 0.00000000000 8.673940
2012-08-17 09:00:00 -0.00085528572 -0.00085492006 8.673085
2012-08-17 10:00:00 0.00034220207 0.00034226063 8.673427
2012-08-17 11:00:00 -0.00102695773 -0.00102643059 8.672400
There is a subtle difference, but is it a real difference or an artifact of floating point calculation?
It seems like Quantmod: what's the difference between ROC(Cl(SPY)) and ClCl(SPY) is almost asking the same thing. But the answers there seem to be saying that with one you would sum the returns, and with the other you multiply them. That is clearly not going to be the case for the above numbers.
(BTW, no-one answered his question (in the comments) as to which form is expected by the PerformanceAnalytics package, which might have given a clue as to which you choose when.)
Here is the test data for the above:
structure(c(5848, 5848.5, 5848.5, 5843.5, 5845.5, 5839.5), class = c("xts",
"zoo"), .indexCLASS = c("POSIXct", "POSIXt"), .indexTZ = "", tclass = c("POSIXct",
"POSIXt"), tzone = "", index = structure(c(1345143600, 1345186800,
1345190400, 1345194000, 1345197600, 1345201200), tzone = "", tclass = c("POSIXct",
"POSIXt")), .Dim = c(6L, 1L), .Dimnames = list(NULL, "Close"))