I would like to use the spotvol() function from the highfrequency package on 30 second log returns for 5 hours of trading. I have a 665x1 matrix of 30-second log returns i.e. diff(log(prices)
logRet<- as.matrix(diff(log(r$PRICE)))
logRet<- t(logRet)
dim(logRet)
spotvol(logRet, method = "detper", on= "secs", k = 30, dailyvol = "medrv", periodicvol = "TML")
output:
> dim(logRet)
[1] 1 665
> spotvol(logRet, method = "detper", on= "secs", k = 30, dailyvol = "medrv", periodicvol = "TML")
[1] "Periodicity estimation requires at least 50 observations. \n Periodic component set to unity"
[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[79] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[157] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
any idea what this means? I have 665 observations of 30-second log returns.
From
?spotvol
(emphasis added):So
spotvol
thinks your input data only has one observation per day, so there's nothing to aggregate.