outlyingPlotIC {RobAStBase} | R Documentation |
Function outlyingPlotIC in Package ‘RobAStBase’
Description
outlyingPlotIC produces an outlyingness plot based on distances applied to ICs
Usage
outlyingPlotIC(data,IC.x, IC.y = IC.x, dist.x = NormType(), dist.y,
cutoff.x = cutoff.sememp(0.95), cutoff.y = cutoff.chisq(0.95), ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
id.n, cex.pts = 1, lab.pts, jitter.pts = 0, alpha.trsp = NA, adj, cex.idn,
col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE,
text.abline.x = NULL, text.abline.y = NULL, cex.abline = par("cex"),
col.abline = col.cutoff, font.abline = par("font"), adj.abline = c(0,0),
text.abline.x.x = NULL, text.abline.x.y = NULL, text.abline.y.x = NULL,
text.abline.y.y = NULL, text.abline.x.fmt.cx = "%7.2f",
text.abline.x.fmt.qx = "%4.2f%%", text.abline.y.fmt.cy = "%7.2f",
text.abline.y.fmt.qy = "%4.2f%%", robCov.x = TRUE, robCov.y = TRUE,
tf.x = NULL,tf.y = NULL, jitter.fac=10, jitter.tol=.Machine$double.eps,
doplot = TRUE,
main = gettext("Outlyingness \n by means of a distance-distance plot")
)
Arguments
data |
data coercable to |
IC.x |
object of class |
IC.y |
object of class |
... |
further arguments to be passed to |
dist.x |
object of class |
dist.y |
object of class |
cutoff.x |
object of class |
cutoff.y |
object of class |
cutoff.quantile.x |
numeric; the cutoff quantile for the |
cutoff.quantile.y |
numeric; the cutoff quantile for the |
id.n |
a set of indices (or a corresponding logical vector); to select a subset
of the data in argument |
cex.pts |
the corresponding |
lab.pts |
a vector of labels for the (unsubsetted) |
jitter.pts |
the corresponding |
alpha.trsp |
alpha transparency to be added ex post to colors
|
adj |
the corresponding argument for |
cex.idn |
the corresponding |
col.idn |
the corresponding |
lty.cutoff |
the corresponding |
lwd.cutoff |
the corresponding |
col.cutoff |
the corresponding |
text.abline |
vector of logicals (cast to length 2): shall text be added to cutoff lines. |
text.abline.x |
text to be added to cutoff lines in x direction; if |
text.abline.y |
text to be added to cutoff lines in y direction; if |
cex.abline |
vector of numerics (cast to length 2): cex-value for added cutoff text. |
col.abline |
vector of length 2: color for added cutoff text. |
font.abline |
vector of length 2: font for added cutoff text. |
adj.abline |
cast to 2 x 2 matrix (by recycling rules): adjustment values for added cutoff text. |
text.abline.x.y |
y-coordinate of text to be added to cutoff lines in x direction;
if |
text.abline.y.x |
x-coordinate of text to be added to cutoff lines in y direction;
if |
text.abline.x.x |
x-coordinate of text to be added to cutoff lines in x direction;
if |
text.abline.y.y |
y-coordinate of text to be added to cutoff lines in y direction;
if |
text.abline.x.fmt.cx |
format string (see |
text.abline.x.fmt.qx |
format string to format cutoff probability in label in x direction. |
text.abline.y.fmt.cy |
format string to format the cutoff value in label in y direction. |
text.abline.y.fmt.qy |
format string to format cutoff probability in label in y direction. |
robCov.x |
shall x-distances be based on MCD, i.e., robust covariances (TRUE) or on classical covariance be used? |
robCov.y |
shall y-distances be based on MCD, i.e., robust covariances (TRUE) or on classical covariance be used? |
tf.x |
transformation for x axis: a function returning the
transformed x-coordinates when applied to the data;
if |
tf.y |
transformation for y axis: a function returning the
transformed y-coordinates when applied to the data;
if |
jitter.fac |
factor for jittering, see |
jitter.tol |
threshold for jittering: if distance between points is smaller
than |
doplot |
logical; shall a plot be produced? if |
main |
the main title. |
Details
calls a corresponding ddPlot
method to produce the plot.
Value
If argument doplot
is FALSE
:
A list (returned as invisible()
) with items
id.x |
the indices of (possibly transformed) data (within subset |
id.y |
the indices of (possibly transformed) data (within subset |
id.xy |
the indices of (possibly transformed) data (within subset |
qtx |
the quantiles of the distances of the (possibly transformed) data in |
qty |
the quantiles of the distances of the (possibly transformed) data in |
cutoff.x.v |
the cutoff value in |
cutoff.y.v |
the cutoff value in |
If argument doplot
is TRUE
:
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.a list (returned as invisible()
) with items;
one item is retV
which is the return value in case doplot
is FALSE
.
Note
If you want to use the return value of cutoff.quant()
for arguments
cutoff.x
or cutoff.y
, remember to set the arguments tf.x
resp. tf.y
to the identity, i.e., function(x)x
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
Examples
if(require(ROptEst)){
## generates normal location and scale family with mean = -2 and sd = 3
N0 <- NormLocationScaleFamily()
N0.IC0 <- optIC(model = N0, risk = asCov())
N0.Rob1 <- InfRobModel(center = N0, neighbor = ContNeighborhood(radius = 0.5))
N0.IC1 <- optIC(model = N0.Rob1, risk = asMSE())
set.seed(123)
xn <- c(rnorm(100),rcauchy(20)+20)
outlyingPlotIC(xn, IC.x=N0.IC0)
outlyingPlotIC(xn, IC.x=N0.IC1)
## example for usage with cutoff.quant()
classIC <- optIC(NormLocationScaleFamily(mean = 3.3, sd = 0.67),
risk = asCov())
outlyingPlotIC(data = chem[-17], classIC, cex.pts = 3, jitter.fac = 1,
cutoff.x = cutoff.quant(), tf.x =function(x)(x))
}