#### in this case it is OK:
set.seed(20)
XX = BBT(rnorm(1000))
pv = pvar(XX, p = 2)
pv1 = pvar(XX[1:round(length(XX)/2)], p = 2)
pv2 = pvar(XX[round(length(XX)/2):length(XX)], p = 2)
pvJ = AddPvar(pv1, pv2);pvJ
Sum_p(pvJ$x[pvJ$Partition],pvJ$p)
pv
pvJ == pv
op = par(mfrow = c(2, 1))
plot(pv)
plot(pvJ, xlim=range(pv$TimeLabel), ylim=range(pv$x))
par(op)
#### in this case it is NOT OK:
set.seed(30)
XX = BBT(rnorm(1000))
pv = pvar(XX, p = 2)
pv1 = pvar(XX[1:round(length(XX)/2)], p = 2)
pv2 = pvar(XX[round(length(XX)/2):length(XX)], p = 2)
pvJ = AddPvar(pv1, pv2);pvJ
Sum_p(pvJ$x[pvJ$Partition],pvJ$p)
pv
pvJ == pv
op = par(mfrow = c(2, 1))
plot(pv)
plot(pvJ, xlim=range(pv$TimeLabel), ylim=range(pv$x))
par(op)
Run the code above in your browser using DataLab