# NOT RUN {
pData <- sampleTData[,c("PRICE", "SIZE")]
storage.mode(pData) <- "numeric"
# Aggregate based on the trade intensity measure. Getting 390 observations.
agged <- businessTimeAggregation(pData, measure = "intensity", obs = 390, bandwidth = 0.075)
# Plot the trade intensity measure
plot.ts(agged$intensityProcess$`2008-01-04`)
rCov(agged$pData[,"PRICE"], makeReturns = TRUE)
rCov(pData[,"PRICE"], makeReturns = TRUE, alignBy = "minutes", alignPeriod = 1)
# Aggregate based on the volume measure. Getting 78 observations.
agged <- businessTimeAggregation(pData, measure = "volume", obs = 78)
rCov(agged$pData[,"PRICE"], makeReturns = TRUE)
rCov(pData[,"PRICE"], makeReturns = TRUE, alignBy = "minutes", alignPeriod = 5)
# }
Run the code above in your browser using DataLab