bootcomp               package:mixreg               R Documentation

_P_e_r_f_o_r_m _a _b_o_o_t_s_t_r_a_p _t_e_s_t _f_o_r _t_h_e _n_u_m_b_e_r _o_f _c_o_m_p_o_n_e_n_t_s _i_n _a _m_i_x_t_u_r_e
_o_f _r_e_g_r_e_s_s_i_o_n_s.

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

     Produces nboot bootstrap realizations of the likelihood ratio
     statistic, either parametrically or semi-parametrically, and
     calculates the corresponding p-value of the test.

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

     bootcomp(x, y, ncomp=2, ncincr=1, intercept=TRUE, nboot=1000,
              ts1=NULL, ts2=NULL, sem.par=FALSE, verb=FALSE,
              print.prog=TRUE, ...)

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

       x: A matrix of predictors for each of the regression models in
          the mixture.  It should NOT include an initial column of 1s. 
          If there is only one predictor, x may be a vector. 

       y: The vector of responses for the regression models. 

   ncomp: The null-hypothesized number of components in the mixture. 

  ncincr: The increment from the null-hypothesized number of components
          in the mixture to the number under the alternative
          hypothesis; i.e. the number of components under the
          alternative hypothesis is ncomp + ncincr. 

intercept: Logical argument indicating whether the regression models in
          the mixture should have intercept terms. 

   nboot: The number of bootstrap replicates of the log likelihood
          ratio statistic to be produced. 

     ts1: Starting values for fitting the ncomp component model.  If
          ts1 is null, random starting values are used.  (This is not
          recommended.) 

     ts2: Starting values for fitting the ncomp+nincr component model. 
          If ts2 is null, random starting values are used.  (This is
          not recommended.) 

 sem.par: Logical argument indicating whether semi-parametric
          bootstrapping should be used. 

    verb: Logical argument indicating whether the fitting processes
          should be verbose (i.e. whether details should be printed out
          at each step of the EM algorithm).  If TRUE a huge amount of
          screen output is produced. 

print.prog: Logical argument indicating whether the index of the
          bootstrap replicate just completed should be printed out, to
          give an idea of how the process is progressing. 

     ...: Further arguments to be passed to mixreg to control the
          fitting procedure. 

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

     In parametic bootstrapping the bootstrap data sets are generated
     by simulating from the fitted ncomp model parameters, using
     Gaussian errors.  In semi-parametric bootstrapping the errors are
     generated by resampling from the residuals.  Since at each
     predictor vector there are ncomp residuals, one for each component
     of the model, the errors are selected from these ncomp
     possibilities.  The selection probabilities at this step are the
     conditional probabilities, of the observation being generated by
     each component of the model, given that observation.  These
     probabilities depend on the parameters of the model whence the
     procedure is semi-parametric.

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

     A list (of class "mixreg") with components

     lrs: The log likelihood ratio statistic for testing that the
          number of components is ncomp versus that it is ncomp +
          nincr. 

aic.ncomp: The vector (with dimension nboot) of Akaike Information
          Criterion values for each of the fitted ncomp component
          models fitted to bootstrap data sets.  The value of ncomp is
          substituted in the name; e.g. if ncomp = 2 then the name of
          this component of the returned list is "aic.2". 

aic.ncomp+ncincr: The vector (with dimension nboot) of Akaike
          Information Criterion values for each of the fitted
          ncomp+ncincr component models fitted to bootstrap data sets. 
          The value of ncomp+ncincr is substituted in the name; e.g. if
          ncomp = 2 and ncrinc=1, then the name of this component of
          the returned list is "aic.3". 

pval.boot: The p-value of the hypothesis test from the bootstrapping
          procedure.  It is calculated as sum(lrs <= lrs.boot)/nboot. 

lrs.boot: The vector of bootstrap replicates of the log likelihood
          ratio statistic 

screw.ups: A list giving information about the screw-ups that have
          occured in the bootstrapping procedure; it includes the
          values of .Random.seed that lead to the data causing the
          screw-up so that the difficulty may be re-produced and
          examined if so desired.  See the comments in the code for the
          meaning of the various ``types'' of screw-up. The "times"
          component of the screw.ups list gives the index of the
          bootstrap replicate that was being worked on when the
          screw-up occured.  Note that if a screw-up does occur, the
          replicate is redone completely. 

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

     Turner, T. R.  Estimating the rate of spread of a viral infection
     of potato plants via mixtures of regressions.  Submitted for
     publication, 1998.

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

     cband, covmix, mixreg, plot.cband, plot.mresid, qq.mix, resid.mix

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

     TS1 <- list(list(beta=c(3.0,0.1),sigsq=16,lambda=0.5),
                 list(beta=c(0.0,0.0),sigsq=16,lambda=0.5))
     TS2 <- list(list(beta=c(3.0,0.1),sigsq=9,lambda=1/3),
                 list(beta=c(1.5,0.05),sigsq=9,lambda=1/3),
                 list(beta=c(0.0,0.0),sigsq=9,lambda=1/3))
     data(aphids)
     x <- aphids$n.aphids
     y <- aphids$n.inf
     ## Not run: 
       nboot <- 1000
     ## End(Not run)

     boot.23 <- bootcomp(x,y,nboot=nboot,ts1=TS1,ts2=TS2)

