PvarBreakTest {pvar} | R Documentation |
Structural break test
Description
This function performs structural break test that is based on p-variation.
Usage
PvarBreakTest(x, TimeLabel = as.vector(time(x)), alpha = 0.05,
FullInfo = TRUE)
## S3 method for class 'PvarBreakTest'
plot(x, main1 = "Data",
main2 = "Bridge transformation", ylab1 = x$dname,
ylab2 = "BridgeT(" %.% x$dname %.% ")", sub2 = NULL,
col.PP = 3, cex.PP = 0.5, col.BP = 2, cex.BP = 1, cex.DP = 0.5,
...)
## S3 method for class 'PvarBreakTest'
summary(object, ...)
Arguments
x |
a numeric vector of data values or an object of class |
TimeLabel |
numeric, a time index of |
alpha |
a small number greater then 0. It indicates the significant level of the test. |
FullInfo |
|
main1 |
the |
main2 |
the |
ylab1 |
the |
ylab2 |
the |
sub2 |
the |
col.PP |
the color of partition points. |
cex.PP |
the cex of partition points. |
col.BP |
the color of break points. |
cex.BP |
the cex of break points. |
cex.DP |
the cex of data points. |
... |
further arguments, passed to |
object |
the object of the class |
Details
Lets x
be a data that should be tested of structural breaks.
Then the p-variation of the BridgeT(x)
with p=4
is the test's statistics.
The quantiles of H0 distribution is based on Monte-Carlo simulation of 140 millions iterations.
The test is reliable then length(x)
is between 100 and 10000.
The test might work with other lengths too, but it is not tested well.
The test will not compute then length(x)<20
.
Value
If FullInfo=TRUE
then function returns an object of the class PvarBreakTest
.
It is the list
that contains:
Stat |
a value of statistics (p-variation of transformed data). |
CriticalValue |
the critical value of the test according to significant level. |
alpha |
the significant level. |
p.value |
approximate p-value. |
reject |
|
dname |
the name of data vector. |
p |
the power in p-variation calculus. The test performs only with the |
x |
a vector of original data. |
y |
a vector of transformed data ( |
Timelabel |
time label of |
BreakPoints |
the indexes of break points suggestion. |
Partition |
a vector of indexes that indicates the partition of |
Author(s)
Vygantas Butkus <Vygantas.Butkus@gmail.com>
References
The test was proposed by A. Rackaskas. The test is based on the results given in the flowing article
[1] R. Norvaisa, A. Rackauskas. Convergence in law of partial sum processes in p-variation norm. Lth. Math. J., 2008., Vol. 48, No. 2, 212-227.
See Also
Tests statistics is pvar
of the data BridgeT(x)
(see BridgeT
) with (p=4).
The critical value and the approximate p-value of the test might by found by functions
PvarQuantile
and PvarPvalue
.
Examples
set.seed(1)
MiuDiff <- 0.3
x <- rnorm(250*4, rep(c(0, MiuDiff, 0, MiuDiff), each=250))
plot(x, pch=19, cex=0.5, main='original data, with several shifts of mean')
k <- 50
moveAvg <- filter(x, rep(1/k, k))
lines(time(x), moveAvg, lwd=2, col=2)
legend('topleft', c('sample', 'moving average (k='%.%k%.%')'),
lty=c(NA,1), lwd=c(NA, 2), col=1:2, pch=c(19,NA), pt.cex=c(0.7,1)
,inset = .03, bg='antiquewhite1')
xtest <- PvarBreakTest(x)
plot(xtest)