RCplot {VLMC} | R Documentation |
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 <= 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),
...)
Arguments
x |
an R object of class |
r2 |
numeric vector, by default of squared deviance residuals of
|
alphabet |
the alphabet to use for labeling the contexts,
via |
lab.horiz |
logical indicating if the context labels should be written horizontally or vertically. |
do.call |
logical indicating if the |
cex.axis |
the character expansion for axis labeling, see also
|
y.fact |
numeric factor for expanding the space to use for the
context labels (when |
col |
color used for filling the boxes. |
xlab |
x axis label (with default). |
main |
main title to be used, |
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 |
Value
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
|
rp |
a list as resulting from the above call to |
Author(s)
Martin Maechler
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
example(vlmc)
RCplot(vlmc.pres)
RCplot(vlmc.dt1c01)## << almost perfect fit (0 resid.)