bootstrap              package:tseries              R Documentation

_G_e_n_e_r_a_t_e _B_o_o_t_s_t_r_a_p _D_a_t_a _a_n_d _S_t_a_t_i_s_t_i_c_s

_D_e_s_c_r_i_p_t_i_o_n:

     Generates `nb' bootstrap samples from the original data `x' and
     computes the bootstrap estimate of standard error and bias for
     `statistic', if `statistic' is given.

_U_s_a_g_e:

     bootstrap (x, nb = 1, statistic = NULL, b = NULL, type =
                c("stationary","block"), ...)
     print (obj, digits = max(3,.Options$digits-3), ...)

_A_r_g_u_m_e_n_t_s:

       x: a numeric vector or time series.

      nb: the number of bootstrap series to compute.

statistic: a function which when applied to a time series returns a
          vector containing the statistic(s) of interest.

       b: if `type' is `"stationary"', then `b' is the mean block
          length. If `type' is `"block"', then `b' is the fixed block
          length.

    type: the type of bootstrap to generate the simulated time series.
          The possible input values are `"stationary"' (stationary
          bootstrap with mean block length `b') and `"block"' (moving
          blocks bootstrap with block length `b').

  object: a list with class `"resample.statistic"'.

  digits: the number of digits to format real numbers.

     ...: either additional arguments for `statistic' which are passed
          unchanged each time `statistic' is called (`bootstrap'), or
          additional arguments for `print'
          (`print.resample.statistic').

_D_e_t_a_i_l_s:

     If `type' is `"stationary"', then the stationary bootstrap scheme
     with mean block length `b' generates the simulated series. If
     `type' is `"block"', then the moving blocks bootstrap with block
     length `b' generates the simulated series. 

     For consistency, the (mean) block length `b' should grow with `n'
     as `const * n^(1/3)', where `n' is the number of observations in
     `x'. Note, that in general `const' depends on intricate properties
     of the process `x'. The default value for `const' has been
     determined by a Monte Carlo simulation using a Gaussian AR(1)
     (AR(1)-parameter of 0.5, 500 observations) process for `x'. It is
     chosen such that the mean square error for the bootstrap estimate
     of the variance of the empirical mean is minimized.

     Missing values are not allowed.

_V_a_l_u_e:

     If `statistic' is `NULL', then it returns a matrix or time series
     with `nb' columns and `length(x)' rows containing the bootstrap
     data. Each column contains one bootstrap sample.

     If `statistic' is given, then a list of class
     `"resample.statistic"' with the following elements is returned: 

statistic: the results of applying `statistic' to each of the simulated
          time series.

orig.statistic: the results of applying `statistic' to the original
          series.

    bias: the bias of the statistics computed as in a bootstrap setup.

      se: the standard error of the statistics computed as in a
          bootstrap setup.

    call: the original call of `bootstrap'.

_A_u_t_h_o_r(_s):

     A. Trapletti

_R_e_f_e_r_e_n_c_e_s:

     H. R. Kuensch (1989): The Jackknife and the Bootstrap for General
     Stationary Observations. The Annals of Statistics 17, 1217-1241.

     D. N. Politis and J. P. Romano (1994): The Stationary Bootstrap.
     J. Amer. Statist. Assoc. 89, 1303-1313.

_S_e_e _A_l_s_o:

     `sample', `surrogate'

_E_x_a_m_p_l_e_s:

     n <- 500  # Generate AR(1) process
     e <- rnorm (n)  
     x <- double (n)
     x[1] <- rnorm (1)
     for (i in 2:n)
     {
       x[i] <- 0.5*x[i-1]+e[i]
     }
     x <- ts(x)

     theta <- function (x)  # Autocorrelations up to lag 10
       return (acf(x, plot=FALSE)$acf[2:11])

     bootstrap (x, nb=50, statistic=theta) 

