Skip to contents

Subtract the sample mean, fit AR(p) by Yule-Walker (Levinson- Durbin), centre the residuals, and regenerate B series by the fitted recursion driven by iid draws from the centred residuals (with burn-in), plus the mean. p defaults to AIC selection.

Usage

morie_btarsv(
  x,
  p = NULL,
  statistic = NULL,
  B = 500,
  burn = 100,
  seed = 0,
  p_max = NULL
)

Arguments

x

Numeric series.

p

Optional AR order (default AIC).

statistic

Function(series) -> scalar (default mean).

B

Bootstrap replicates.

burn

Burn-in length.

seed

SplitMix64 seed (mirrors the Python arm).

p_max

AIC search bound.

Value

A list with elements estimate, se, replicates, phi, p, sigma2, residual_mean, B, seed, method.

References

Buhlmann, P. (1997). Sieve bootstrap for time series. Bernoulli, 3(2), 123-148.

Examples

set.seed(1)
morie_btarsv(rnorm(60), B = 50, burn = 20)
#> $estimate
#> [1] 0.1076164
#> 
#> $se
#> [1] 0.09493303
#> 
#> $replicates
#>  [1]  0.1223929383  0.2199904759 -0.0487360785  0.2150100765  0.0218787084
#>  [6]  0.0391878852  0.1938556094  0.1613048568  0.1587013399 -0.0838629419
#> [11]  0.2414324973  0.1141610755 -0.0713755588 -0.0147317212  0.1186504436
#> [16]  0.1936118655  0.0001944943 -0.0346278908  0.0943240399  0.2298122285
#> [21]  0.1137621398 -0.0832889763  0.2365478294  0.1291276896  0.1281412234
#> [26]  0.1104398030  0.1587985306  0.1137267078 -0.0167651860 -0.0329441944
#> [31]  0.2590690591  0.1426844056  0.0534931094  0.0678495766  0.1224898534
#> [36]  0.0419867856  0.2338212961  0.2674772608  0.1412541192  0.0653068741
#> [41]  0.1708657744  0.1835609489  0.1083969808  0.1714090844  0.2460506962
#> [46]  0.0517210462  0.0941909666  0.1194655705  0.0313859463  0.1158064077
#> 
#> $phi
#> [1]  0.01287414 -0.23463095
#> 
#> $p
#> [1] 2
#> 
#> $sigma2
#> [1] 0.6794622
#> 
#> $residual_mean
#> [1] -9.533502e-19
#> 
#> $B
#> [1] 50
#> 
#> $seed
#> [1] 0
#> 
#> $method
#> [1] "AR-sieve bootstrap (Buhlmann 1997, Sec. 2)"
#>