README.md

DriftBurstHypothesis

An R-package for the calculation of the Drift Burst Hypothesis test-statistic from the working paper Christensen, Oomen and Reno (2018) .

The t-statistic at period n is calculated as follows:

equation,

where the local mean estimator is:

equation,

and the local variance estimator is:

equation

with:

equation

denoting the overlapping pre-averaged returns with the weighting function:

equation,

and

equation

is a smooth kernel defined on the positive real numbers, equation is the lag length over which the estimator is applied. By default, the lag-length will be determined by way of the Newey-West algorithm.

Examples using simulated high frequency data:

library(highfrequency) # to get sample data
library(xts)
library(DriftBurstHypothesis)
data("sample_tdata")
price = xts(as.numeric(sample_tdata$PRICE), index(sample_tdata))
plot(price)
testtimes = seq(34260, 57600, 60)



DBHxts = drift_bursts(timestamps = NULL,  logpricexts,
                      testTimes, preAverage = 5, ACLag = -1L,
                      meanBandwidth = 300L, varianceBandwidth = 900L,
                      bParallelize = TRUE, iCores = 8)

plot(DBHxts, price = price)

Example plot

library(DriftBurstHypothesis)
set.seed(1234)
returns = rnorm(23399, sd = 1)/sqrt(23400)
price = c(0,cumsum(returns))
timestamps = seq(34200, 57600, length.out = 23400)
testTimes = seq(34200 + 5*300, 57600, 60)
DBH = driftBursts(timestamps, price, testTimes, preAverage = 5, meanBandwidth = 300, varianceBandwidth = 5*300)
plot(DBH, price = price, timestamps = timestamps)

Example plot adding a line



emilsjoerup/DriftBurstHypothesis documentation built on July 20, 2020, 3:08 p.m.