segmentation           package:tilingArray           R Documentation

_T_h_e _c_l_a_s_s _s_e_g_m_e_n_t_a_t_i_o_n _r_e_p_r_e_s_e_n_t_s _a _s_e_g_m_e_n_t_a_t_i_o_n _r_e_s_u_l_t.

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

     This class represents the result of a segmentation, usually a call
     to the function 'segment'.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the function 'segment' or by
     calls of the form 'new("segmentation", ...)'.

_S_l_o_t_s:

     '_y': A matrix with the data (the dependent variable(s)), see
          'segment'. 

     '_x': A numeric vector with the regressor variable. The length of
          this vector must be either the same as 'nrow(y)', or 0. The
          latter case is equivalent to 'x=1:nrow(y)'.

     '_f_l_a_g': An integer vector, whose length must be either the same as
          'nrow(y)', or 0. This can be used to _flag_ certain probes
          for special treatment, for example by 'plotAlongChrom'.

     '_b_r_e_a_k_p_o_i_n_t_s': List of segmentations. The element
          'breakpoints[[j]]' corresponds to a segmentation fit of 'j'
          segments, i.e. with 'j-1' breakpoints. It is a matrix with
          '(j-1)' rows and 1 or 3 columns. It always contains a column
          named 'estimate' with the point estimates. Optionally, it may
          contain columns 'lower' and 'upper' with the confidence
          intervals. The point estimates are the row indices in 'y'
          where new segments start, for example: let
          'z=breakpoints[[j]]', then the first segment is from row '1'
          to 'z[1, "estimate"]-1', the second from row 'z[1,
          "estimate"]' to 'z[2, "estimate"]-1', and so on.

     '_n_e_g_l_o_g_l_i_k': Numeric vector of the same length as 'breakpoints'.
          The negative log-likelihood of the piecewise constant models
          under the data 'y'.

     '_h_a_s_C_o_n_f_i_n_t': Logical vector of the same length as 'breakpoints'.
          TRUE if the confidence interval estimates are present, i.e.
          if the matrix 'breakpoints[[j]]' has columns 'lower' and
          'upper'.

     '_n_r_S_e_g_m_e_n_t_s': A scalar integer, value must be either 'NA' or
          between '1' and 'length(breakpoints)'. Can be used to select
          one of the fits in 'breakpoints' for special treatment, for
          example by 'plotAlongChrom'.

_M_e_t_h_o_d_s:

     _c_o_n_f_i_n_t The method 'confint(object, parm, level=0.95,
          het.reg=FALSE, het.err=FALSE, ...)' computes confidence
          intervals for the change point estimates of the segmentation.
          Typically, these were obtained from a previous call to the
          function 'segment' that created the object. This is just a
          wrapper for the function 'confint.breakpointsfull' from the
          'strucchange' package, which does all the hard computations.
          Parameters: 'object' an object of class 'segmentation',
          'parm' an integer vector, it determines for which of the
          segmentation fits confidence intervals are computed. See also
          'segment'. The other parameters are directly passed on to
          'confint.breakpointsfull'.

     _l_o_g_L_i_k The method 'logLik(object, penalty="none", ...)' returns
          the log-likelihoods of fitted models. Valid values for the
          argument 'penalty' are 'none', 'AIC' and 'BIC'.

     _p_l_o_t The method 'plot(x, y, xlim, xlab="x", ylab="y",
          bpcol="black", bplty=1, pch=16, ...)' provides a simple
          visualization of the result of a segmentation. Parameters:
          'x' an object of class 'segmentation', 'y' an integer between
          '1' and 'length(x@breakpoints)', selecting which of the fits
          contained in 'x' to plot, 'bpcol' and 'bplty' color and line
          type of breakpoints. The plot shows the numeric data along
          with breakpoints and if available their confidence intervals.

     _s_h_o_w summary.

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

     Wolfgang Huber huber@ebi.ac.uk

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

     'segment'

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

     ## generate random data with 5 segments:
     y = unlist(lapply(c(0,3,0.5,1.5,5), function(m) rnorm(10, mean=m)))

     seg = segment(y, maxseg=10, maxk=15)
     seg = confint(seg, parm=c(3,4,5))

     if(interactive())
       plot(seg, 5)

     show(seg)

