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.
RCplot(x, r2 = residuals(x, "deviance")^2,
alphabet = x$alpha, lab.horiz = k
Invisibly, a list with components
the number of contexts (and hence box plots) used.
a factor (as used in the interncal call to
plot.factor
).
a list as resulting from the above call to plot.factor()
.
an R object of class vlmc
.
numeric vector, by default of squared deviance residuals of
x
, but conceptually any (typically non-negative) vector of
the appropriate length.
the alphabet to use for labeling the contexts,
via id2ctxt
.
logical indicating if the context labels should be written horizontally or vertically.
logical indicating if the vlmc
call
should be put as subtitle.
the character expansion for axis labeling, see also
par
. The default is only approximately good.
numeric factor for expanding the space to use for the
context labels (when lab.horiz
is false).
color used for filling the boxes.
x axis label (with default).
main title to be used, NULL
entailing a sensible default.
graphical parameters to be used for coding of medians that are almost 0.
y range limits for plotting.
further arguments to be passed to plot()
.
Martin Maechler
Mächler M. and Bühlmann P. (2004) Variable Length Markov Chains: Methodology, Computing, and Software. J. Computational and Graphical Statistics 2, 435--455.
summary.vlmc
for other properties of a VLMC model.
example(vlmc)
RCplot(vlmc.pres)
RCplot(vlmc.dt1c01)## << almost perfect fit (0 resid.)
Run the code above in your browser using DataLab