Please could you help regarding the following error:
Error in [.xts(data, , 2) : subscript out of bounds
This error appears in the package 'highfrequency' after running even the package's example from the documentation:
data("sample_5minprices_jumps");
data = sample_5minprices_jumps[,1];
data = makeReturns(data); #Get the high-frequency return data
x = harModel(data, periods = c(1,5,10), periodsJ=c(1,5,10),
I am not familiar with this package but I notice that the code you posted is not exactly the same as the code in the package documentation for the harModel() function. In particular, sample_5minprices_jumps[,1] may not result in the same thing as sample_5minprices_jumps$stock1. Please run the following. You made need to precede it with data("sample_5minprices_jumps").
dat <- sample_5minprices_jumps$stock1
dat <- makeReturns(dat) #Get the high-frequency return data
x <- harModel(dat, periods = c(1,5,10), periodsJ = c(1,5,10),
RVest = c("rCov","rBPCov"),type = "HARRVCJ",
transform = "sqrt", inputType = "returns")