Learn R Programming

VLMC (version 1.3-13)

RCplot: Residuals vs Context plot

Description

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.

Usage

RCplot(x, r2 = residuals(x, "deviance")^2,
       alphabet = x$alpha, lab.horiz = k 

Arguments

x
an Robject 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 horizontally 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().

Value

  • Invisibly, a list with components
  • kthe number of contexts (and hence box plots) used.
  • fIDa factor (as used in the interncal call to plot.factor).
  • rpa list as resulting from the above call to plot.factor().

encoding

latin1

References

M�chler M. and B�hlmann P. (2004) Variable Length Markov Chains: Methodology, Computing, and Software. J. Computational and Graphical Statistics 2, 435--455.

See Also

summary.vlmc for other properties of a VLMC model.

Examples

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

Run the code above in your browser using DataLab