Learn R Programming

RobLox (version 0.8.2)

roblox: Optimally robust estimator for location and/or scale

Description

The function roblox computes the optimally robust estimator and corresponding IC for normal location und/or scale and (convex) contamination neighborhoods. The definition of these estimators can be found in Rieder (1994) or Kohl (2005), respectively.

Usage

roblox(x, mean, sd, eps, eps.lower, eps.upper, initial.est, k = 1L, 
       fsCor = TRUE, returnIC = FALSE, mad0 = 1e-4, na.rm = TRUE)

Arguments

x
vector x of data values, may also be a matrix or data.frame with one row, respectively one column/(numeric) variable.
mean
specified mean.
sd
specified standard deviation which has to be positive.
eps
positive real (0 < eps
eps.lower
positive real (0 <= eps.lower <= eps.upper): lower bound for the amount of gross errors. See details below.
eps.upper
positive real (eps.lower <= eps.upper
initial.est
initial estimate for mean and/or sd. If missing median and/or MAD are used.
k
positive integer. k-step is used to compute the optimally robust estimator.
fsCor
logical: perform finite-sample correction. See function finiteSampleCorrection.
returnIC
logical: should IC be returned. See details below.
mad0
scale estimate used if computed MAD is equal to zero
na.rm
logical: if TRUE, the estimator is evaluated at complete.cases(x).

Value

  • Object of class "kStepEstimate".

concept

  • normal location
  • normal scale
  • normal location and scale
  • influence curve

Details

Computes the optimally robust estimator for location with scale specified, scale with location specified, or both if neither is specified. The computation uses a k-step construction with an appropriate initial estimate for location or scale or location and scale, respectively. Valid candidates are e.g. median and/or MAD (default) as well as Kolmogorov(-Smirnov) or von Mises minimum distance estimators; cf. Rieder (1994) and Kohl (2005). If the amount of gross errors (contamination) is known, it can be specified by eps. The radius of the corresponding infinitesimal contamination neighborhood is obtained by multiplying eps by the square root of the sample size. If the amount of gross errors (contamination) is unknown, try to find a rough estimate for the amount of gross errors, such that it lies between eps.lower and eps.upper. In case eps.lower is specified and eps.upper is missing, eps.upper is set to 0.5. In case eps.upper is specified and eps.lower is missing, eps.lower is set to 0. If neither eps nor eps.lower and/or eps.upper is specified, eps.lower and eps.upper are set to 0 and 0.5, respectively. If eps is missing, the radius-minimax estimator in sense of Rieder et al. (2008), respectively Section 2.2 of Kohl (2005) is returned. In case of location, respectively scale one additionally has to specify sd, respectively mean where sd and mean have to be a single number. For sample size <= 2,="" median="" and="" or="" mad="" are="" used="" for="" estimation.="" if="" eps = 0, mean and/or sd are computed. In this situation it's better to use function MLEstimator.

References

Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation. Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer. Rieder, H., Kohl, M. and Ruckdeschel, P. (2008) The Costs of not Knowing the Radius. Statistical Methods and Applications 17(1) 13-40. Extended version: http://www.stamats.de/RRlong.pdf M. Kohl, P. Ruckdeschel, and H. Rieder (2010). Infinitesimally Robust Estimation in General Smoothly Parametrized Models. Statistical Methods and Application, 19(3):333-354.

See Also

ContIC-class, rlOptIC, rsOptIC, rlsOptIC.AL, kStepEstimate-class, roptest

Examples

Run this code
ind <- rbinom(100, size=1, prob=0.05) 
x <- rnorm(100, mean=ind*3, sd=(1-ind) + ind*9)

## amount of gross errors known
res1 <- roblox(x, eps = 0.05, returnIC = TRUE)
estimate(res1)
confint(res1)
confint(res1, method = symmetricBias())
pIC(res1)
checkIC(pIC(res1))
Risks(pIC(res1))
Infos(pIC(res1))
plot(pIC(res1))
infoPlot(pIC(res1))

## amount of gross errors unknown
res2 <- roblox(x, eps.lower = 0.01, eps.upper = 0.1, returnIC = TRUE)
estimate(res2)
confint(res2)
confint(res2, method = symmetricBias())
pIC(res2)
checkIC(pIC(res2))
Risks(pIC(res2))
Infos(pIC(res2))
plot(pIC(res2))
infoPlot(pIC(res2))

## estimator comparison
# classical optimal (non-robust)
c(mean(x), sd(x))

# most robust
c(median(x), mad(x))

# optimally robust (amount of gross errors known)
estimate(res1)

# optimally robust (amount of gross errors unknown)
estimate(res2)

# Kolmogorov(-Smirnov) minimum distance estimator (robust)
(ks.est <- MDEstimator(x, ParamFamily = NormLocationScaleFamily()))

# optimally robust (amount of gross errors known)
roblox(x, eps = 0.05, initial.est = estimate(ks.est))

# Cramer von Mises minimum distance estimator (robust)
(CvM.est <- MDEstimator(x, ParamFamily = NormLocationScaleFamily(), distance = CvMDist))

# optimally robust (amount of gross errors known)
roblox(x, eps = 0.05, initial.est = estimate(CvM.est))

Run the code above in your browser using DataLab