BootsChapt                package:sac                R Documentation

_B_o_o_t_s_t_r_a_p (_P_e_r_m_u_t_a_t_i_o_n) _T_e_s_t _o_f _C_h_a_n_g_e-_P_o_i_n_t(_s) _w_i_t_h _O_n_e-_C_h_a_n_g_e _o_r _E_p_i_d_e_m_i_c _A_l_t_e_r_n_a_t_i_v_e

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

     By resampling with(out) replacement from the original sample data,
     we can obtain bootstrap(permutation) versions of the test
     statistics. The 'p'-values of the test(s) from the original data
     are approximated by the 'p'-values of the bootstrap(permutation)
     version statistics.

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

     BootsChapt(x, stat1, stat2 = NULL, B, replace = FALSE, 
         alternative = c("one.change", "epidemic"), adj.Wn = FALSE, 
         tol = 1.0e-7, maxit = 50,trace = FALSE,... )

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

       x: a numeric vector or matrix containing the data, one row per
          observation; 

   stat1: test statistic 'Sn' for '"one-change"' alternative or 'Vn'
          for  '"epidemic"' alternative, output of
          'SemiparChangePoint'.

   stat2: test statistic 'Wn' for '"epidemic"' alternative, output of
          'SemiparChangePoint'.

       B: number of resamples 

 replace: a logical indicating whether bootstrap samples for bootstrap
          test of the change-point are selected with or without
          replacement, if 'replace'= FALSE (default), corresponds to
          permutation test, otherwise, bootstrap test; 

alternative: a character string specifying the alternative hypothesis,
          must be one of '"one-change"' (default) or '"epidemic"'.  You
          can specify just the initial letter.

  adj.Wn: logical indicating if 'Wn' should be adjusted or not for
          '"epidemic"' alternative. 

     tol: the desired accuracy (convergence tolerance), an argument of
          'glm.control'. 

   maxit: the maximum number of iterations, an argument of
          'glm.control'. 

   trace: logical indicating if output should be produced for each
          iteration, an argument of 'glm.control'.

     ...: other arguments 

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

     The procedure will fail when there is separation in the data in
     the sense of Albert & Anderson(1984, _Biometrika_) and Santner &
     Duffy (1986, _Biometrika_). In this case, the change-point(s) may
     be detected easily using nonparametric method based on cumsum.
     Now, this program does not check whether the data is separated.

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

 p.boots: bootstrap 'p'-value of 'Sn' for '"one-change"' alternative

p.boots.Vn: bootstrap 'p'-value of 'Vn' for '"epidemic"' alternative

p.boots.Wn: bootstrap 'p'-value of 'Wn' for '"epidemic"' alternative

_N_o_t_e:

     Default alternative is '"one-change"', even when 'stat2' is not
     NULL. If 'alternative = "epidemic"', both 'stat1' and 'stat2'
     should be provided. Statistic 'Wn' need be adjusted only for one
     dimensional observations and if no bootstrap test is conducted.
     However, if 'Wn' is already adjusted, you have to asign 'adj.Wn =
     TRUE' to calculate the 'p'-value of 'Wn'.

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

     Zhong Guan zguan@iusb.edu

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

     Guan, Z.(2001) Some Results About Empirical Likelihood Method,
     _Ph.D. Thesis, The University of Toledo_.

     Guan, Z.(2004) A semiparametric changepoint model, _Biometrika_,
     91, 4, 849-862.

     Guan, Z. Semiparametric Tests for Change-points with Epidemic
     Alternatives.

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

     'SemiparChangePoint', 'schapt', 'p.OneChange', 'p.Epidemic.Vn',
     'p.Epidemic.Wn'

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

     require(sac) #load the package

     # one-change alternative
     k<-10
     n<-20
     x<-rnorm(n,0,1)
     x[(k+1):n]<-x[(k+1):n]+1.5
     T<-SemiparChangePoint(x, alternative = "one.change")$Sn
     BootsChapt(x, T, B = 5)
         #Choose larger B to get better approximate p-value.

