schapt                  package:sac                  R Documentation

_S_e_m_i_p_a_r_a_m_e_t_r_i_c _A_n_a_l_y_s_i_s _o_f _C_h_a_n_g_e_p_o_i_n_t

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

     Semiparametric empirical likelihood ratio based test of
     changepoint with one-change or epidemic alternatives with
     data-based model diagnostic

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

     schapt(x, n.boots = 0, replace = FALSE, alternative = c("one.change", 
         "epidemic"), conf.level = 0.95, adj.Wn = FALSE, model.test = FALSE, 
         n.model.boots = 0, 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;

 n.boots: number of bootstrap samples for bootstrap test of the
          change-point, if 'n.boots =0 ', do not perform bootstrap
          test;

 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. Epidemic alternative is
          also called square wave alternative in the literature.

conf.level: confidence level.

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

model.test: a logical indicating whether the test of model validity is
          performed.

n.model.boots: number of bootstrap samples for model test, if either 
          'n.model.boots' = 0 or 'model.test'=FALSE, then model test
          will not be performed.

     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 future arguments 

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

     Model: log{g(x)/f(x)}=exp{alpha+beta'T(x)},  where f(x) and g(x)
     are the density (frequency) functions of the two hypothesized
     populations, and T(x) can be chosen as T(x)=x or T(x)=(x,x^2). 
     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.
     Currently, this function does not check whether the data is
     separated.

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

data.name : dataset name

parameter : sample size 'n' and degree(s) of freedom of the 'df' of
          'Sn' for '"one-change"' alternative

alternative : the alternative hypothesis

statistic : a list contains 'Sn' for '"one-change"' alternative, 'Vn'
          and 'Wn'  for '"epidemic"' alternative; also contains 'Delta'
          if model test is performed 

estimate : a list contains change-point(s) and 'alpha' and 'beta'

 p.value: a list contains 'p'-value(s), 'p(Sn)', of 'Sn' for
          '"one-change"' alternative, 'p(Vn)' and 'p(Wn)', of 'Vn' and
          'Wn', repectively, for '"epidemic"' alternative; also
          'p.boots(model)' of 'Delta' if model test is performed, if
          bootstrap test(s) of the change-point(s)  are performed, the
          it also containts the corresponding 'p'-values,
          'p.boots(Sn)', 'p.boots(Vn)' and 'p.boots(Wn)' accordingly.

_N_o_t_e:

     Statistic 'Wn' need be adjusted only for one dimensional
     observations and if no bootstrap test is conducted. If returned
     'p'-value is 0, this means that the 'p'-value is less than 1.0e-7.
     There is an R package, called '"strucchange"', for testing
     structural change in linear regression models (see 'sctest').

_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 change-point model, _Biometrika_,
     91, 4, 849-862.

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

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

     'Graf.Diagnostic', 'Plot.ll'

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

     require(sac) #load the package
     # one-change alternative
     ## Nile data with one change-point: the annual flows drop in 1898.
     ## It is believed to be caused by the building of the first Aswan dam.
     if(! "package:sac" %in% search()) library(sac) 
         #if package sac has not been loaded, load it.
     if(! "package:stats" %in% search()) library(stats)
     data(Nile)
     plot(Nile, type="p")
     schapt(Nile, alternative = "one.change")

