Description Usage Arguments Details Value Author(s) References See Also Examples
Plots 24 influence curves to the same model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25  comparePlot(obj1, obj2, ... )
## S4 method for signature 'IC,IC'
comparePlot(obj1, obj2, obj3 = NULL, obj4 = NULL, data = NULL,
..., withSweave = getdistrOption("withSweave"),
forceSameModel = FALSE, main = FALSE, inner = TRUE,
sub = FALSE, col = par("col"), lwd = par("lwd"), lty,
col.inner = par("col.main"), cex.inner = 0.8,
bmar = par("mar")[1], tmar = par("mar")[3],
with.automatic.grid = TRUE, with.legend = FALSE,
legend = NULL, legend.bg = "white",
legend.location = "bottomright", legend.cex = 0.8,
withMBR = FALSE, MBRB = NA, MBR.fac = 2, col.MBR = par("col"),
lty.MBR = "dashed", lwd.MBR = 0.8, x.vec = NULL,
scaleX = FALSE, scaleX.fct, scaleX.inv, scaleY = FALSE,
scaleY.fct = pnorm, scaleY.inv = qnorm, scaleN = 9,
x.ticks = NULL, y.ticks = NULL, mfColRow = TRUE,
to.draw.arg = NULL,
cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"),
pch.pts = 19, cex.npts = 1, cex.npts.fun = NULL,
col.npts = par("col"), pch.npts = 20, jitter.fac = 1,
with.lab = FALSE, cex.lbs = 1, adj.lbs = c(0, 0),
col.lbs = col.pts, lab.pts = NULL, lab.font = NULL,
alpha.trsp = NA, which.lbs = NULL, which.Order = NULL,
which.nonlbs = NULL, attr.pre = FALSE, return.Order = FALSE,
withSubst = TRUE)

obj1 
object of class 
obj2 
object of class 
obj3 
optional: object of class 
obj4 
optional: object of class 
data 
optional data argument — for plotting observations into the plot; 
withSweave 
logical: if 
forceSameModel 
logical; shall we check / enforce that the model
of the ICs 
main 
logical: is a main title to be used? or 
col 
color[s] of ICs in arguments 
lwd 
linewidth[s] of ICs in arguments 
lty 
linetype[s] of ICs in arguments 
inner 
logical: do panels have their own titles? or 
sub 
logical: is a subtitle to be used? or 
tmar 
top margin – useful for nonstandard main title sizes 
bmar 
bottom margin – useful for nonstandard sub title sizes 
cex.inner 
magnification to be used for inner titles relative
to the current setting of 
col.inner 
character or integer code; color for the inner title 
with.automatic.grid 
logical; should a grid be plotted alongside
with the ticks of the axes, automatically? If 
with.legend 
logical; shall a legend be plotted? 
legend 
either 
legend.location 
a valid argument 
legend.bg 
background color for the legend 
legend.cex 
magnification factor for the legend 
withMBR 
logical; shall horizontal lines with min and max of MBRE be plotted for comparison? 
MBRB 
matrix (or 
MBR.fac 
positive factor; scales the bounds given by argument 
col.MBR 
color for the MBR lines; as usual 
lty.MBR 
line type for the MBR lines; as usual 
lwd.MBR 
line width for the MBR lines; as usual 
x.vec 
a numeric vector of grid points to evaluate the influence curve;
by default, 
scaleX 
logical; shall Xaxis be rescaled (by default according to the cdf of the underlying distribution)? 
scaleY 
logical; shall Yaxis be rescaled (by default according to a probit scale)? 
scaleX.fct 
an isotone, vectorized function mapping the domain of the IC
to [0,1]; if 
scaleX.inv 
the inverse function to 
scaleY.fct 
an isotone, vectorized function mapping for each coordinate the range of the respective coordinate of the IC to [0,1]; defaulting to the cdf of N(0,1); can also be a list of functions with one list element for each of the panels to be plot. 
scaleY.inv 
an isotone, vectorized function mapping for each coordinate the range [0,1] into the range of the respective coordinate of the IC; defaulting to the quantile function of N(0,1); can also be a list of functions with one list element for each of the panels to be plot. 
scaleN 
integer; defaults to 9; on rescaled axes, number of x and y ticks if drawn automatically; 
x.ticks 
numeric; defaults to NULL; (then ticks are chosen automatically); if nonNULL, usergiven xticks (on original scale); 
y.ticks 
numeric; defaults to NULL; (then ticks are chosen automatically); if nonNULL, usergiven yticks (on original scale); can be a list with one (numeric or NULL) item per panel 
mfColRow 
shall default partition in panels be used — defaults to 
to.draw.arg 
Either 
withSubst 
logical; if 
col.pts 
color of the points of the 
pch.pts 
symbol of the points of the 
cex.pts 
size of the points of the 
cex.pts.fun 
rescaling function for the size of the points to be plotted;
either 
col.npts 
color of the nonlabelled points of the 
pch.npts 
symbol of the nonlabelled points of the 
cex.npts 
size of the nonlabelled points of the 
cex.npts.fun 
rescaling function for the size of the nonlabelled points
to be plotted; either 
lab.pts 
character or NULL; labels to be plotted to the observations;
can be a vector of length 
with.lab 
logical; shall labels be plotted to the observations?
(May be a vector of length 
cex.lbs 
size of the labels; can be vectorized to an array
of dim nlbs x 
col.lbs 
color of the labels; can be vectorized to a matrix
of dim nlbs x 
adj.lbs 
adjustment of the labels; can be vectorized to an array of
dim 2 x 
lab.font 
font to be used for labels (may be a vector of length

alpha.trsp 
alpha transparency to be added ex post to colors

jitter.fac 
jittering factor used in case of a 
attr.pre 
logical; do graphical attributes for plotted data refer
to indices prior ( 
which.lbs 
either an integer vector with the indices of the observations
to be plotted into graph or 
which.Order 
for each of the given ICs, we order the observations (descending)
according to the norm given by the corresponding 
which.nonlbs 
indices of the observations which should be plotted but
not labelled; either an integer vector with the indices of the observations
to be plotted into graph or 
return.Order 
logical; if 
... 
further arguments to be passed to 
Any parameters of plot.default
may be passed on to this particular
plot
method.
For main, inner, and subtitles given as arguments main
,
inner
, and sub
, top and bottom margins are enlarged to 5 resp.
6 by default but may also be specified by tmar
/ bmar
arguments.
If main
/ inner
/ sub
are
logical then if the respective argument is FALSE
nothing is done/plotted,
but if it is TRUE
, we use a default main title taking up the calling
arguments in case of main
, default inner titles taking up the
class and (named) parameter slots of arguments in case of inner
,
and a "generated on <data>"tag in case of sub
.
Of course, if main
/ inner
/ sub
are character
, this
is used for the title; in case of inner
it is then checked whether it
has correct length. If argument withSubst
is TRUE
, in all title
and axis lable arguments, the following patterns are substituted:
"%C1"
,"%C2"
,["%C3"
,]["%C4"
]class of argument
obj<i>
, i=1,..4
"%A1"
,"%A2"
,["%A3"
,]["%A4"
]deparsed argument
obj<i>
, i=1,..4
"%D"
time/datestring when the plot was generated
If argument ...
contains argument ylim
, this may either be
as in plot.default
(i.e. a vector of length 2) or a vector of
length 2*(number of plotted dimensions); in the case of longer length,
these are the values for ylim
for the plotted dimensions of the IC,
one pair for each dimension.
In addition, argument ...
may contain arguments panel.first
,
panel.last
, i.e., hook expressions to be evaluated at the very beginning
and at the very end of each panel (within the then valid coordinates).
To be able to use these hooks for each panel individually, they may also be
lists of expressions (of the same length as the number of panels and
run through in the same order as the panels).
An S3 object of class c("plotInfo","DiagnInfo")
, i.e., a list
containing the information needed to produce the
respective plot, which at a later stage could be used by different
graphic engines (like, e.g. ggplot
) to produce the plot
in a different framework. A more detailed description will follow in
a subsequent version.
Peter Ruckdeschel [email protected]
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
L2ParamFamilyclass
,
ICclass
, plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67  if(require(ROptEst)){
N0 < NormLocationScaleFamily(mean=0, sd=1)
N0.Rob1 < InfRobModel(center = N0, neighbor = ContNeighborhood(radius = 0.5))
IC1 < optIC(model = N0, risk = asCov())
IC2 < optIC(model = N0.Rob1, risk = asMSE())
comparePlot(IC1,IC2)
set.seed(12); data < r(N0)(20)
comparePlot(IC1, IC2, data=data, with.lab = TRUE,
which.lbs = c(1:4,15:20),
which.Order = 1:6,
return.Order = TRUE)
## don't test to reduce check time on CRAN
## selection of subpanels for plotting
par(mfrow=c(1,1))
comparePlot(IC1, IC2 ,mfColRow = FALSE, to.draw.arg=c("mean"),
panel.first= grid(),ylim=c(4,4),xlim=c(6,6))
## matrixvalued ylim
comparePlot(IC1, IC2, panel.first= grid(),ylim=c(4,4,0,4),xlim=c(6,6))
x < c(data,12,10)
comparePlot(IC1, IC2, data=x, which.Order=10,
panel.first= grid(), ylim=c(4,4,0,4), xlim=c(6,6))
Y < Chisq(df=1)* DiscreteDistribution(c(1,1))
comparePlot(IC1, IC2, data=x, which.Order=10,
scaleX = TRUE, scaleX.fct=pnorm, scaleX.inv=qnorm,
scaleY = TRUE, scaleY.fct=p(Y), scaleY.inv=q.l(Y),
panel.first= grid(), ylim=c(4,4,0,4), xlim=c(6,6))
comparePlot(IC1, IC2, data=x, which.Order=10,
scaleX = TRUE, scaleX.fct=pnorm, scaleX.inv=qnorm,
scaleY = TRUE, scaleY.fct=p(Y), scaleY.inv=q.l(Y),
x.ticks = c(Inf, 10, 1,0,1,10,Inf),
y.ticks = c(Inf, 5, 1,0,1,5,Inf),
panel.first= grid(), ylim=c(4,4,0,4), xlim=c(6,6))
## with use of trafomatrix:
G < GammaFamily(scale = 1, shape = 2)
## explicitely transforming to
## MASS parametrization:
mtrafo < function(x){
nms0 < names(c(main(param(G)),nuisance(param(G))))
nms < c("shape","rate")
fval0 < c(x[2], 1/x[1])
names(fval0) < nms
mat0 < matrix( c(0, 1/x[1]^2, 1, 0), nrow = 2, ncol = 2,
dimnames = list(nms,nms0))
list(fval = fval0, mat = mat0)}
G2 < G
trafo(G2) < mtrafo
G2
G2.Rob1 < InfRobModel(center = G2, neighbor = ContNeighborhood(radius = 0.5))
system.time(IC1 < optIC(model = G2, risk = asCov()))
system.time(IC2 < optIC(model = G2.Rob1, risk = asMSE()))
system.time(IC2.i < optIC(model = G2.Rob1, risk = asMSE(normtype=InfoNorm())))
system.time(IC2.s < optIC(model = G2.Rob1, risk = asMSE(normtype=SelfNorm())))
comparePlot(IC1,IC2, IC2.i, IC2.s)
}

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.