Starting time series bootstrapping in R: How can I access each simulated path using tsbootstrap?

I want to perform a bootstrap analysis of a specific time series. I am using the tsbootstrappackage function tseries. My problem: for values ​​m> 1, I cannot access each loaded path individually (m: the length of the base blocks in the block bootstrap block, see ?tsbootstrap)

library(tseries)
set.seed(1)
TS <- sample(1:20)
tsbootstrap(TS,m=2, nb=1)

gives:

Error in tsbootstrap(TS, m = 2, nb = 1) : 
  can only return bootstrap data for m = 1

As far as I know, the function can only calculate some statistical data (for example, the average value) for all simulation transcriptions, but I need every simulation. How can I solve this problem? (I am aware of the function of the tsbootpackage boot, but I have not yet been able to implement the function)

+4
1

b - . m - "block of blocks", , , .

library(tseries)

# Simulate a time series
set.seed(1)
TS<-arima.sim(model=list(ar=c(.8,-.2)), n=20) 
plot(TS)

enter image description here

# 3 bootstrap samples with block size b=5
TSboot = tsbootstrap(TS, m=1, b=5, type="block", nb=3)

# Here are the individual bootstrapped series
TSboot

Time Series:
Start = 1 
End = 20 
Frequency = 1 
          [,1]        [,2]        [,3]
 1 -0.72571390  1.94273559  1.62729703
 2 -0.36463539  2.00048877  0.34495502
 3 -0.30236104  1.28640888 -2.26419528
...
18  0.96532247 -0.72571390 -0.36463539
19  1.59792898 -0.36463539 -0.30236104
20  1.67918002 -0.30236104 -1.63971414

plot(TSboot)

enter image description here

+4

Source: https://habr.com/ru/post/1542778/


All Articles