getReq: getReq - computation of the radius interval where IC1 is...

Description Usage Arguments Value Author(s) References Examples

View source: R/getReq.R

Description

(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.

Usage

1
getReq(Risk,neighbor,IC1,IC2,n=1,upper=15, radOrOutl=c("radius","Outlier"), ...)

Arguments

Risk

an object of class "asGRisk" – the risk at which IC1 is better than IC2.

neighbor

object of class "Neighborhood"; the neighborhood at which to compute the bias.

IC1

some IC of class "IC"

IC2

some IC of class "IC"

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 E().

Value

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.

Author(s)

Peter Ruckdeschel [email protected]

References

Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.

Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.

Examples

 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
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)

ROptEst documentation built on May 2, 2019, 5:45 p.m.