rmx: Optimally Robust RMX Estimator

View source: R/rmx.R

rmxR Documentation

Optimally Robust RMX Estimator

Description

The function rmx computes optimally robust rmx estimators. The definition of these estimators can be found in Kohl (2005) and Rieder et al. (2008), respectively. The other functions are rarely called directly and are mainly for internal use.

Usage

rmx(x, model = "norm", eps.lower=0, eps.upper=NULL, eps=NULL, k = 3L, 
    initial.est=NULL, fsCor = NULL, na.rm = TRUE, message = TRUE, ...)
    
rmx.norm(x, eps.lower=0, eps.upper=NULL, eps=NULL, k = 3L, 
         initial.est=NULL, fsCor = TRUE, na.rm = TRUE, mad0 = 1e-4)

rmx.binom(x, eps.lower=0, eps.upper=NULL, eps=NULL, k = 3L, 
          initial.est=NULL, fsCor = FALSE, na.rm = TRUE, 
          size, M = 10000, parallel = FALSE, ncores = NULL, 
          aUp = 100*size, cUp = 1e4, delta = 1e-9)
          
## S3 method for class 'rmx'
print(x, digits = getOption("digits"), prefix = " ", ...)

## S3 method for class 'rmx'
summary(object, digits = getOption("digits"), prefix = " ", ...)

## S3 method for class 'rmx'
coef(object, complete = TRUE, ...)

## S3 method for class 'rmx'
vcov(object, ...)

## S3 method for class 'rmx'
plot(x, which = 1, 
              control = list(ifPlot = NULL, qqPlot = NULL,
                             ppPlot = NULL, dPlot = NULL,
                             aiPlot = NULL, riPlot = NULL,
                             iiPlot = NULL, plot = TRUE), ...)

Arguments

x

numeric vector x of data values. Object of class rmx in case of print and plot method.

object

object of class rmx.

model

character: short name of the model/distribution (default = "norm"); see also details.

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 <= 0.5): upper bound for the amount of gross errors; see details below.

eps

positive real (0 < eps <= 0.5): amount of gross errors. See details below.

k

positive integer: k-step is used to compute the optimally robust estimator.

initial.est

initial estimate for mean and sd. If missing median and MAD are used.

fsCor

NULL or logical: perform finite-sample correction; see function fsRadius.

na.rm

logical: if TRUE, NA values are removed before the estimator is evaluated.

message

logical: if FALSE, messages are suppressed.

mad0

if mad(x) equal to 0, it is replaced by mad0.

size

size parameter (known!); see dbinom.

M

number of Monte-Carlo simulations; see fsRadius.

parallel

logical: use package parallel for computations.

ncores

if parallel = TRUE: number of cores used for computations. If missing, the maximum number of cores - 1 is used.

aUp

numeric: upper limit for centering constant a.

cUp

postive real: upper limit for clipping constant c.

delta

positive real: desired accuracy (convergence tolerance).

digits

minimal number of significant digits.

prefix

string, passed to strwrap.

complete

logical indicating if the full coefficient vector should be returned; see coef.

which

numeric number from 1 to 7 indicating the plot that shall be generated; see details below.

control

list of parameters passed through to the respective plot.

...

further arguments passed through; e.g., known parameters such as size in case of the binomial model.

Details

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.

If neither eps nor eps.upper is provided, eps.upper will be estimated by applying function outlier to the RMX estimator with eps.lower = 0 and eps.upper = 0.5.

As models we have implemented so far:

  1. "norm": normal location (mean) and scale (sd).

  2. "binom": binomial probability (prob) with known size.

  3. "pois": Poisson mean (lambda).

As plots we have implemented:

  1. ifPlot: plot of IF.

  2. qqPlot: qq-plot for fitted model, only implemented for continuous models.

  3. ppPlot: pp-plot for fitted model, only implemented for continuous models.

  4. dPlot: density plot for fitted model.

  5. aiPlot: plot of absolute information.

  6. riPlot: plot of relative information, only implemented for models where at least two parameters have to be estimated.

  7. iiPlot: compare absolute information of RMX estimator with absolute information of ML estimator.

Value

An object of class "rmx" is returned. It contails at least the following arguments:

rmxEst

estimates

rmxIF

object of class optIF; see optIF.

initial.est

initial estimates.

Infos

matrix with information about the estimator

x

data used for the estimation.

n

sample size

eps.lower

lower bound for the amount of gross errors, if provided otherwise NA.

eps.upper

upper bound for the amount of gross errors, if provided otherwise NA.

eps

amount of gross errors, if provided otherwise NA.

fsCor

finite-sample correction

k

k-step construction

call

matched call

Author(s)

Matthias Kohl Matthias.Kohl@stamats.de

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://r-kurs.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

optIF, rowRmx, fsRadius

Examples

###########################################################
## For more details see vignettes!
###########################################################

## normal location (mean) and scale (sd)
ind <- rbinom(100, size=1, prob=0.05) 
x <- rnorm(100, mean=ind*3, sd=(1-ind) + ind*9)
res1 <- rmx(x, eps.lower = 0.01, eps.upper = 0.1)
res1
summary(res1)
confint(res1) # method = "as"
confint(res1, method = "as.bias")
plot(res1, which = 1)
plot(res1, which = 2)

stamats/rmx documentation built on Sept. 29, 2023, 7:13 p.m.