confint.segmentation       package:tilingArray       R Documentation

_C_o_m_p_u_t_e _B_a_i'_s _c_o_n_f_i_d_e_n_c_e _i_n_t_e_r_v_a_l_s _f_o_r _s_p_e_c_i_f_i_e_d _s_e_g_m_e_n_t_a_t_i_o_n_s

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

     Compute Bai's confidence intervals for specified segmentations

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

     ## S3 method for class 'segmentation':
     confint(object,parm="breakpoints", level = 0.95,
                                      nSegments=NULL, 
                                      het.reg = FALSE,het.err = FALSE, ...)

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

  object: Object of class '"segmentation"'; Result of 'findSegments'

    parm: character; which parameters to compute confidence intervals
          for; only "breakpoints" is implemented

   level: Confidence level of the confidence intervals

nSegments: Number of segments in segmentations to compute confidence
          intervals for. Defaults to computing them for all
          segmentations considered in 'findSegments'

 het.reg: logical. Should heterogenous regressors be assumed? If set to
          'FALSE' the distribution of the regressors is assumed to be
          homogenous over the segments.

 het.err: logical. Should heterogenous errors be assumed? If set to
          'FALSE' the distribution of the errors is assumed to be
          homogenous over the segments.

     ...: currently not used

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

     Basically, this function just prepares an object for calling the
     function 'computeConfInt'.

     The distribution function used for the computation of confidence
     intervals of breakpoints is given in Bai (1997). The procedure, in
     particular the usage of heterogenous regressors and/or errors, is
     described in more detail in Bai & Perron (2003).

     The breakpoints should be computed from a formula with
     'breakpoints', then the confidence intervals for the breakpoints
     can be derived by 'confint' and these can be visualized with the
     segmentation. For an example see 'plot.segmentation'.

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

     An object of class '"segmentation"'. Actually the same as the
     argument 'object' with the following list items replaced 

chosenSegNo: Numeric; Segment numbers of segmentations, for which
          confidence intervals were computed

 confInt: List of confidence intervals as tables for those
          segmentations

residuals: List of numeric vectors containing the residuals for those
          segmentations

    call: with call of this function appended

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

     Joern Toedling toedling@ebi.ac.uk

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

     Bai J. (1997), Estimation of a Change Point in Multiple Regression
     Models, _Review of Economics and Statistics_, *79*, 551-563.

     Bai J., Perron P. (2003), Computation and Analysis of Multiple
     Structural Change Models, _Journal of Applied Econometrics_, *18*,
     1-22.

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

     'computeConfInt','findSegments', 'plot.segmentation','confint'

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

        # generate random data with 5 segments:
        x <- c(rnorm(10,0,1),rnorm(10,3,1),rnorm(10,0.5,0.5),
               rnorm(10,1.5,1),rnorm(10,5,1))

        segres <-  findSegments(x, maxcp=10, maxk=15)
        segres <- confint.segmentation(segres,nSegments=c(3,4,5,6))

        # see that the step between segments 3 and 4 is less certain than
        #  the other ones:
        segres$confInt
        plot(segres,5, pch=20)

