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)
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.
object of class IC
object of class IC
object of class L2ParamFamily
object of class Neighborhood
object of class RiskType
additional parameters (in particular to be passed on to plot
).
data to be plotted in
the lower and upper end points of the contamination interval (in prob-scale).
number of points between lower
and upper
logical; if TRUE
, for risk comparison
uses the maximal risk of the classically optimal IC \(\psi\) in all
situations with contamination in Dirac points 'no larger' than
the respective evaluation point and the optimally-robust
IC \(\eta\) at its least favorable contamination situation
('over all real Dirac contamination points'). This is the default and
was the behavior prior to package version 0.9).
If FALSE
it uses exactly the situation
with Dirac contamination in the evaluation point for both ICs
\(\psi\) and \(\eta\) which amounts to calling cniperCont
with IC1=psi
, IC2=eta
.
logical; should a grid be plotted alongside
with the ticks of the axes, automatically? If TRUE
a respective
call to grid
in argument panel.first
is ignored.
logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)?
logical; shall Y-axis be rescaled (by default according to a probit scale)?
an isotone, vectorized function mapping the domain of the IC(s)
to [0,1]; if scaleX
is TRUE
and scaleX.fct
is
missing, the cdf of the underlying observation distribution.
the inverse function to scale.fct
, i.e., an isotone,
vectorized function mapping [0,1] to the domain of the IC(s)
such that for any x
in the domain,
scaleX.inv(scaleX.fct(x))==x
; if scaleX
is TRUE
and scaleX.inv
is
missing, the quantile function of the underlying observation distribution.
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 \({\cal N}(0,1)\).
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 \({\cal N}(0,1)\).
integer; defaults to 9; on rescaled axes, number of x and y ticks if drawn automatically;
numeric; defaults to NULL; (then ticks are chosen automatically); if non-NULL, user-given x-ticks (on original scale);
numeric; defaults to NULL; (then ticks are chosen automatically); if non-NULL, user-given y-ticks (on original scale);
size of the points of the second argument plotted (vectorized);
rescaling function for the size of the points to be plotted;
either NULL
(default), then log(1+abs(x))
is used for
the rescaling, or a function which is then used for the
rescaling.
color of the points of the second argument plotted (vectorized);
symbol of the points of the second argument plotted (vectorized);
color of the non-labelled points of the data
argument
plotted (vectorized);
symbol of the non-labelled points of the data
argument
plotted (vectorized);
size of the non-labelled points of the data
argument
plotted (vectorized);
rescaling function for the size of the non-labelled points
to be plotted; either NULL
(default), then log(1+abs(x))
is used for each of the rescalings, or a function which is then used
for each of the rescalings.
logical; shall labels be plotted to the observations?
character or NULL; labels to be plotted to the observations; if NULL
observation indices;
font to be used for labels
alpha transparency to be added ex post to colors
col.pch
and col.lbl
; if one-dim and NA all colors are
left unchanged. Otherwise, with usual recycling rules alpha.trsp
gets shorted/prolongated to length the data-symbols to be plotted.
Coordinates of this vector alpha.trsp
with NA are left unchanged,
while for the remaining ones, the alpha channel in rgb space is set
to the respective coordinate value of alpha.trsp
. The non-NA
entries must be integers in [0,255] (0 invisible, 255 opaque).
jittering factor used in case of a DiscreteDistribution
for plotting points of the second argument in a jittered fashion.
jittering tolerance used in case of a DiscreteDistribution
for plotting points of the second argument in a jittered fashion.
either an integer vector with the indices of the observations
to be plotted into graph or NULL
--- then no observation is excluded
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 NULL
--- then all non-labelled
observations are plotted.
we order the observations (descending) according to the norm given by
normtype(object)
; then which.Order
either is an integer vector with the indices of the ordered
observations (remaining after a possible reduction by argument which.lbs
)
to be plotted into graph or NULL
--- then no (further) observation
is excluded.
logical; do graphical attributes for plotted data refer
to indices prior (TRUE
) or posterior to selection
via arguments which.lbs
, which.Order
, which.nonlbs
(FALSE
)?
logical; if TRUE
, an order vector
is returned; more specifically, the order of the (remaining) observations
given by their original index is returned (remaining means: after a possible
reduction by argument which.lbs
, and ordering is according to the norm given by
normtype(object)
);
otherwise we return invisible()
as usual.
logical; if TRUE
(default) pattern substitution for
titles and lables is used; otherwise no substitution is used.
logical; if TRUE
the [p]IC is passed through
makeIC
before return.
Matthias Kohl Matthias.Kohl@stamats.de
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).
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. 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
# \donttest{
## 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)
# }
Run the code above in your browser using DataLab