RCplot                 package:VLMC                 R Documentation

_R_e_s_i_d_u_a_l_s _v_s _C_o_n_t_e_x_t _p_l_o_t

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

     Plots the residuals of a fitted VLMC model against the contexts,
     i.e., produces a boxplot of residuals for all contexts used in the
     model fit.

     This has proven to be useful function, and the many optional
     arguments allow quite a bit of customization.  However, the
     current implementation is somewhat experimental and the defaults
     have been chosen from only a few examples.

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

     RCplot(x, r2 = residuals(x, "deviance")^2,
            alphabet = x$alpha, lab.horiz = k <= 20,
            do.call = TRUE,
            cex.axis = if (k <= 20) 1 else if (k <= 40) 0.8 else 0.6,
            y.fact = if (.Device == "postscript") 1.2 else 0.75,
            col = "gray70", xlab = "Context", main = NULL,
            med.pars = list(col = "red", pch = 12, cex = 1.25 * cex.axis),
            ylim = range(0, r2, finite = TRUE),
            ...)

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

       x: an R object of class 'vlmc'.

      r2: numeric vector, by default of squared deviance residuals of
          'x', but conceptually any (typically non-negative) vector of
          the appropriate length.

alphabet: the alphabet to use for labeling the contexts, via 'id2ctxt'.

lab.horiz: logical indicating if the context labels should be written
          *horiz*ontally or vertically.

 do.call: logical indicating if the 'vlmc' call should be put as
          subtitle.

cex.axis: the character expansion for axis labeling, see also 'par'. 
          The default is only approximately good.

  y.fact: numeric factor for expanding the space to use for the context
          labels (when 'lab.horiz' is false).

     col: color used for filling the boxes.

    xlab: x axis label (with default).

    main: main title to be used, 'NULL' entailing a sensible default.

med.pars: graphical parameters to be used for coding of medians that
          are almost 0.

    ylim: y range limits for plotting.

     ...: further arguments to be passed to 'plot()'.

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

     _Invisibly_, a list with components 

       k: the number of contexts (and hence box plots) used.

     fID: a factor (as used in the interncal call to 'plot.factor').

      rp: a list as resulting from the above call to 'plot.factor()'.

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

     Martin Maechler

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

     Mchler M. and Bhlmann P. (2003) Variable Length Markov Chains:
     Methodology, Computing and Software. accepted for publication in
     _J\. Computational and Graphical Statistics_.

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

     'summary.vlmc' for other properties of a VLMC model.

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

     example(vlmc)
     RCplot(vlmc.pres)
     RCplot(vlmc.dt1c01)## << almost perfect fit (0 resid.)

