set.seed(1)
# x contains 4 blocks with diferent mean.
x = c(rnorm(250,0),rnorm(250,0.3), rnorm(250,0), rnorm(250,0.3))
# run test
PVBT = PvarBreakTest(x); PVBT
PVBTSummary = summary(PVBT); PVBTSummary
# the plot of the test
plot(PVBT)
# the sugestion of break points. True points are 250, 500 and 750
BreakPoints(PVBT)
# if we only interesting in main numbers.
PvarBreakTest(x, FullInfo = FALSE)
##################################
# the statistic maigth by find with pvar
Y = BridgeT(x)
pv = pvar(Y, p = 4)
pv
# critical value
PvarQuantile(n=length(x), prob = c(0.95))
# apricimal p-value
PvarPvalue(n=length(x), stat=pv$value)
Run the code above in your browser using DataLab