getReq | R Documentation |
(tries to) compute a radius interval where IC1 is better than IC2, respectively the number of (worst-case) outliers interval where IC1 is better than IC2.
getReq(Risk,neighbor,IC1,IC2,n=1,upper=15, radOrOutl=c("radius","Outlier"), ...)
Risk |
an object of class |
neighbor |
object of class |
IC1 |
some IC of class |
IC2 |
some IC of class |
n |
the sample size; by default set to 1; then the radius interval refers to starting radii in the shrinking neighborhood setting of Rieder[94]. Otherwise the radius interval is scaled down accordingly. |
upper |
the upper bound of the radius interval in which to search |
radOrOutl |
a character string specifying whether an interval of radii or a number of outliers is returned; must be one of "radius" (default) and "Outlier". |
... |
further arguments to be passed on |
The radius interval (given by its endpoints) where IC1
is better than IC2
according to the risk. In case IC2
is better than IC1
as to both variance and bias,
the return value is NA
.
Peter Ruckdeschel peter.ruckdeschel@fraunhofer.itwm.de
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
N0 <- NormLocationFamily(mean=2, sd=3)
## L_2 family + infinitesimal neighborhood
neighbor <- ContNeighborhood(radius = 0.5)
N0.Rob1 <- InfRobModel(center = N0, neighbor = neighbor)
## OBRE solution (ARE 95%)
N0.ICA <- optIC(model = N0.Rob1, risk = asAnscombe(.95))
## MSE solution
N0.ICM <- optIC(model=N0.Rob1, risk=asMSE())
getReq(asMSE(),neighbor,N0.ICA,N0.ICM,n=1)
getReq(asMSE(),neighbor,N0.ICA,N0.ICM,n=30)
## Don't test to reduce check time on CRAN
## RMX solution
N0.ICR <- radiusMinimaxIC(L2Fam=N0, neighbor=neighbor,risk=asMSE())
getReq(asL1(),neighbor,N0.ICA,N0.ICM,n=30)
getReq(asL4(),neighbor,N0.ICA,N0.ICM,n=30)
getReq(asMSE(),neighbor,N0.ICA,N0.ICR,n=30)
getReq(asL1(),neighbor,N0.ICA,N0.ICR,n=30)
getReq(asL4(),neighbor,N0.ICA,N0.ICR,n=30)
getReq(asMSE(),neighbor,N0.ICM,N0.ICR,n=30)
### when to use MAD and when Qn
## for Qn, see C. Croux, P. Rousseeuw (1993). Alternatives to the Median
## Absolute Deviation, JASA 88(424):1273-1283
L2M <- NormScaleFamily()
IC.mad <- makeIC(function(x)sign(abs(x)-qnorm(.75)),L2M)
d.qn <- (2^.5*qnorm(5/8))^-1
IC.qn <- makeIC(function(x) d.qn*(1/4 - pnorm(x+1/d.qn) + pnorm(x-1/d.qn)), L2M)
getReq(asMSE(), neighbor, IC.mad, IC.qn)
getReq(asMSE(), neighbor, IC.mad, IC.qn, radOrOutl = "Outlier", n = 30)
# => MAD is better once r > 0.5144 (i.e. for more than 2 outliers for n = 30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.