cniperCont | R Documentation |
These functions and their methods can be used to determine cniper contamination as well as cniper points. That is, under which (Dirac) contamination is the risk of one procedure larger than the risk of some other procedure.
cniperCont(IC1, IC2, data = NULL, ...,
neighbor, risk, lower=getdistrOption("DistrResolution"),
upper=1-getdistrOption("DistrResolution"), n = 101,
with.automatic.grid = TRUE, scaleX = FALSE, scaleX.fct,
scaleX.inv, scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
scaleN = 9, x.ticks = NULL, y.ticks = NULL, cex.pts = 1,
cex.pts.fun = NULL, col.pts = par("col"), pch.pts = 19,
cex.npts = 0.6, cex.npts.fun = NULL, col.npts = "red", pch.npts = 20,
jit.fac = 1, jit.tol = .Machine$double.eps, with.lab = FALSE,
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)
cniperPoint(L2Fam, neighbor, risk, lower, upper)
cniperPointPlot(L2Fam, data=NULL, ..., neighbor, risk= asMSE(),
lower=getdistrOption("DistrResolution"),
upper=1-getdistrOption("DistrResolution"), n = 101,
withMaxRisk = TRUE, with.automatic.grid = TRUE,
scaleX = FALSE, scaleX.fct, scaleX.inv,
scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
scaleN = 9, x.ticks = NULL, y.ticks = 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 = 19,
jit.fac = 1, jit.tol = .Machine$double.eps,
with.lab = FALSE,
lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
which.lbs = NULL, which.nonlbs = NULL,
which.Order = NULL, attr.pre = FALSE, return.Order = FALSE,
withSubst = TRUE, withMakeIC = FALSE)
IC1 |
object of class |
IC2 |
object of class |
L2Fam |
object of class |
neighbor |
object of class |
risk |
object of class |
... |
additional parameters (in particular to be passed on to |
data |
data to be plotted in |
lower , upper |
the lower and upper end points of the contamination interval (in prob-scale). |
n |
number of points between |
withMaxRisk |
logical; if |
with.automatic.grid |
logical; should a grid be plotted alongside
with the ticks of the axes, automatically? If |
scaleX |
logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)? |
scaleY |
logical; shall Y-axis be rescaled (by default according to a probit scale)? |
scaleX.fct |
an isotone, vectorized function mapping the domain of the IC(s)
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(s)
to [0,1]; defaulting to the cdf of |
scaleY.inv |
an isotone, vectorized function mapping for each coordinate
the range [0,1] into the range of the respective coordinate of the IC(s);
defaulting to the quantile function of |
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 non-NULL, user-given x-ticks (on original scale); |
y.ticks |
numeric; defaults to NULL; (then ticks are chosen automatically); if non-NULL, user-given y-ticks (on original scale); |
cex.pts |
size of the points of the second argument plotted (vectorized); |
cex.pts.fun |
rescaling function for the size of the points to be plotted;
either |
col.pts |
color of the points of the second argument plotted (vectorized); |
pch.pts |
symbol of the points of the second argument plotted (vectorized); |
col.npts |
color of the non-labelled points of the |
pch.npts |
symbol of the non-labelled points of the |
cex.npts |
size of the non-labelled points of the |
cex.npts.fun |
rescaling function for the size of the non-labelled points
to be plotted; either |
with.lab |
logical; shall labels be plotted to the observations? |
lab.pts |
character or NULL; labels to be plotted to the observations; if |
lab.font |
font to be used for labels |
alpha.trsp |
alpha transparency to be added ex post to colors
|
jit.fac |
jittering factor used in case of a |
jit.tol |
jittering tolerance used in case of a |
which.lbs |
either an integer vector with the indices of the observations
to be plotted into graph or |
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 |
which.Order |
we order the observations (descending) according to the norm given by
|
attr.pre |
logical; do graphical attributes for plotted data refer
to indices prior ( |
return.Order |
logical; if |
withSubst |
logical; if |
withMakeIC |
logical; if |
In case of cniperCont
the difference between the risks of two ICs
is plotted.
The function cniperPoint
can be used to determine cniper
points. That is, points such that the optimally robust estimator
has smaller minimax risk than the classical optimal estimator under
contamination with Dirac measures at the cniper points.
As such points might be difficult to find, we provide the
function cniperPointPlot
which can be used to obtain a plot
of the risk difference; in this function the usual arguments for
plot
can be used. For arguments col
, lwd
,
vectors can be used; then the first coordinate is taken for the
curve, the second one for the balancing line. For argument lty
,
a list can be used; its first component is then taken for the
curve, the second one for the balancing line.
If argument withSubst
is TRUE
, in all title
and axis lable arguments of cniperCont
and cniperPointPlot
,
the following patterns are substituted:
"%C"
class of argument L2Fam
(for cniperPointPlot
)
"%A"
deparsed argument L2Fam
(for cniperPointPlot
)
"%C1"
class of argument IC1
(for cniperCont
)
"%A1"
deparsed argument IC1
(for cniperCont
)
"%C2"
class of argument IC2
(for cniperCont
)
"%A2"
deparsed argument IC2
(for cniperCont
)
"%D"
time/date-string when the plot was generated
For more details about cniper contamination and cniper points we refer to Section~3.5 of Kohl et al. (2008) as well as Ruckdeschel (2004) and the Introduction of Kohl (2005).
The cniper point is returned by cniperPoint
.
In case of cniperPointPlot
, we return
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.
Matthias Kohl Matthias.Kohl@stamats.de
M. Kohl (2005). Numerical Contributions to the Asymptotic Theory of Robustness. Dissertation. University of Bayreuth. https://epub.uni-bayreuth.de/id/eprint/839/2/DissMKohl.pdf.
M. Kohl, P. Ruckdeschel, and H. Rieder (2010). Infinitesimally Robust Estimation in General Smoothly Parametrized Models. Statistical Methods and Applications 19(3): 333-354. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10260-010-0133-0")}.
P. Ruckdeschel (2004). Higher Order Asymptotics for the MSE of M-Estimators on Shrinking Neighborhoods. Unpublished Manuscript.
## cniper contamination
P <- PoisFamily(lambda = 4)
RobP1 <- InfRobModel(center = P, neighbor = ContNeighborhood(radius = 0.1))
IC1 <- optIC(model=RobP1, risk=asMSE())
RobP2 <- InfRobModel(center = P, neighbor = ContNeighborhood(radius = 1))
IC2 <- optIC(model=RobP2, risk=asMSE())
cniperCont(IC1 = IC1, IC2 = IC2,
neighbor = ContNeighborhood(radius = 0.5),
risk = asMSE(),
lower = 0, upper = 8, n = 101)
## cniper point plot
cniperPointPlot(P, neighbor = ContNeighborhood(radius = 0.5),
risk = asMSE(), lower = 0, upper = 10)
## Don't run to reduce check time on CRAN
## cniper point
cniperPoint(P, neighbor = ContNeighborhood(radius = 0.5),
risk = asMSE(), lower = 0, upper = 4)
cniperPoint(P, neighbor = ContNeighborhood(radius = 0.5),
risk = asMSE(), lower = 4, upper = 8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.