AJjumpTest: Ait-Sahalia and Jacod (2009) tests for the presence of jumps...

View source: R/jumpTests.R

AJjumpTestR Documentation

Ait-Sahalia and Jacod (2009) 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 the theory of Ait-Sahalia and Jacod (2009). It consists in comparing the multi-power variation of equi-spaced returns computed at a fast time scale (h), r_{t,i} (i=1, \ldots,N) and those computed at the slower time scale (kh), y_{t,i}(i=1, \ldots ,\mbox{N/k}).

They found that the limit (for N \to \infty ) of the realized power variation is invariant for different sampling scales and that their ratio is 1 in case of jumps and \mbox{k}^{p/2}-1 if no jumps. Therefore the AJ test detects the presence of jump using the ratio of realized power variation sampled from two scales. The null hypothesis is no jumps.

The function returns three outcomes: 1.z-test value 2.critical value under confidence level of 95\% and 3. p-value.

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

And there is N/k equispaced returns in period t. Let y_{t,i} be a return (with i=1, \ldots ,\mbox{N/k}) in period t.

Then the AJjumpTest is given by:

\mbox{AJjumpTest}_{t,N}= \frac{S_t(p,k,h)-k^{p/2-1}}{\sqrt{V_{t,N}}}

in which,

\mbox{S}_t(p,k,h)= \frac{PV_{t,M}(p,kh)}{PV_{t,M}(p,h)}

\mbox{PV}_{t,N}(p,kh)= \sum_{i=1}^{N/k}{|y_{t,i}|^p}

\mbox{PV}_{t,N}(p,h)= \sum_{i=1}^{N}{|r_{t,i}|^p}

\mbox{V}_{t,N}= \frac{N(p,k) A_{t,N(2p)}}{N A_{t,N(p)}}

\mbox{N}(p,k)= \left(\frac{1}{\mu_p^2}\right)(k^{p-2}(1+k))\mu_{2p} + k^{p-2}(k-1) \mu_p^2 - 2k^{p/2-1}\mu_{k,p}

\mbox{A}_{t,n(2p)}= \frac{(1/N)^{(1-p/2)}}{\mu_p} \sum_{i=1}^{N}{|r_{t,i}|^p} \ \ \mbox{for} \ \ |r_j|< \alpha(1/N)^w

\mu_{k,p}= E(|U|^p |U+\sqrt{k-1}V|^p)

U, V: independent standard normal random variables; h=1/N; p, k, \alpha, w: parameters.

Usage

AJjumpTest(
  pData,
  p = 4,
  k = 2,
  alignBy = NULL,
  alignPeriod = NULL,
  alphaMultiplier = 4,
  alpha = 0.975,
  ...
)

Arguments

pData

either an xts or a data.table containing the prices of a single asset, possibly over multiple days.

p

can be chosen among 2 or 3 or 4. The author suggests 4. 4 by default.

k

can be chosen among 2 or 3 or 4. The author suggests 2. 2 by default.

alignBy

character, indicating the time scale in which alignPeriod is expressed. Possible values are: "ticks", "secs", "seconds", "mins", "minutes", "hours" To aggregate based on a 5 minute frequency, set alignPeriod to 5 and alignBy to "minutes".

alignPeriod

positive numeric, indicating the number of periods to aggregate over. For example, to aggregate based on a 5 minute frequency, set alignPeriod = 5 and alignBy = "minutes".

alphaMultiplier

alpha multiplier

alpha

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

...

used internally

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.

Using the convergence properties of power variation and its dependence on the time scale on which it is measured, Ait-Sahalia and Jacod (2009) define a new variable which converges to 1 in the presence of jumps in the underlying return series, or to another deterministic and known number in the absence of jumps (Theodosiou and Zikes, 2009).

Value

a list or xts in depending on whether input prices span more than one day.

Author(s)

Giang Nguyen, Jonathan Cornelissen, Kris Boudt, and Emil Sjoerup.

References

Ait-Sahalia, Y. and Jacod, J. (2009). Testing for jumps in a discretely observed process. The Annals of Statistics, 37(1), 184-222.

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



jt <- AJjumpTest(sampleTData[, list(DT, PRICE)], p = 2, k = 3, 
                 alignBy = "seconds", alignPeriod = 5, makeReturns = TRUE)


highfrequency documentation built on Oct. 4, 2023, 5:08 p.m.