Learn R Programming

highfrequency (version 0.7.0.1)

BNSjumpTest: Barndorff-Nielsen and Shephard (2006) tests for the presence of jumps in the price series.

Description

This test examines the presence of jumps in highfrequency price series. It is based on theory of Barndorff- Nielsen and Shephard (BNS). The null hypothesis is no jumps. Depending on the choice of estimator (integrated variance (IVestimator), integrated quarticity (IQestimator)), mechanism (linear, ratio) and adjustment (logarithm), the function returns the result. Function returns three outcomes: 1.z-test value 2.critical value(with confidence level of 95%) and 3.pvalue of the test. Assume there is \(N\) equispaced returns in period \(t\).

Assume the Realized variance (RV), IVestimator and IQestimator are based on \(N\) equispaced returns.

Let \(r_{t,i}\) be a return (with \(i=1, \ldots,N\)) in period \(t\).

Then the BNSjumpTest is given by: $$ \mbox{BNSjumpTest}= \frac{RV - IVestimator}{\sqrt{(\theta-2)\frac{1}{N} {IQestimator}}} $$ in which, \(IVestimator\) can be: bipower variance (BV), minRV, medRV. \(IQestimator\) can be: tripower quarticity (TP), quadpower quarticity (QP), minRQ, medRQ.

\(\theta\): depends on IVestimator (Huang and Tauchen (2005)).

Usage

BNSjumpTest(
  rData,
  IVestimator = "BV",
  IQestimator = "TP",
  type = "linear",
  logTransform = FALSE,
  max = FALSE,
  alignBy = NULL,
  alignPeriod = NULL,
  makeReturns = FALSE,
  alpha = 0.975
)

Arguments

rData

a zoo/xts object containing all returns in period t for one asset.

IVestimator

can be chosen among jump robust integrated variance estimators: BV, minRV, medRV and corrected threshold bipower variation (CTBV). If CTBV is chosen, an argument of \(startV\), start point of auxiliary estimators in threshold estimation (Corsi et al. (2010) can be included. BV by default.

IQestimator

can be chosen among jump robust integrated quarticity estimators: TP, QP, minRQ and medRQ. TP by default.

type

a method of BNS testing: can be linear or ratio. Linear by default.

logTransform

boolean, should be TRUE when QVestimator and IVestimator are in logarithm form. FALSE by default.

max

boolean, should be TRUE when max adjustment in SE. FALSE by default.

alignBy

a string, align the tick data to "seconds"|"minutes"|"hours".

alignPeriod

an integer, align the tick data to this many [seconds|minutes|hours].

makeReturns

boolean, should be TRUE when rData contains prices instead of returns. FALSE by default.

alpha

numeric of length one with the significance level to use for the jump test(s). Defaults to 0.975.

Value

list or xts in case the input prices span more than one day.

Details

The theoretical framework underlying jump test is that the logarithmic price process \(X_t\) belongs to the class of Brownian semimartingales, which can be written as: $$ \mbox{X}_{t}= \int_{0}^{t} a_udu + \int_{0}^{t}\sigma_{u}dW_{u} + Z_t $$ where \(a\) is the drift term, \(\sigma\) denotes the spot volatility process, \(W\) is a standard Brownian motion and \(Z\) is a jump process defined by: $$ \mbox{Z}_{t}= \sum_{j=1}^{N_t}k_j $$ where \(k_j\) are nonzero random variables. The counting process can be either finite or infinite for finite or infinite activity jumps.

Since the realized volatility converges to the sum of integrated variance and jump variation, while the robust IVestimator converges to the integrated variance, it follows that the difference between #' \(RV_{t,N}\) and the IVestimator captures the jump part only, and this observation underlines the BNS test for jumps. (Theodosiou& Zikes(2009))

References

Barndorff-Nielsen, O. E., & Shephard, N. (2006). Econometrics of testing for jumps in financial economics using bipower variation. Journal of financial Econometrics, 4(1), 1-30.

Corsi, F., Pirino, D., & Reno, R. (2010). Threshold bipower variation and the impact of jumps on volatility forecasting. Journal of Econometrics, 159(2), 276-288.

Huang, X., & Tauchen, G. (2005). The relative contribution of jumps to total price variance. Journal of financial econometrics, 3(4), 456-499.

Theodosiou, M., & Zikes, F. (2009). A comprehensive comparison of alternative tests for jumps in asset prices. Unpublished manuscript, Graduate School of Business, Imperial College London.

Examples

Run this code
# NOT RUN {
BNSjumpTest(sampleTData$PRICE, IVestimator= "minRV", 
            IQestimator = "medRQ", type= "linear", makeReturns = TRUE)

# }

Run the code above in your browser using DataLab