showdown: Estimator Showdown by Monte-Carlo Study.

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

The function showdown can be used to perform Monte-Carlo studies comparing a competitor with rmx estimators in case of normal location and scale. In addition, maximum likelihood (ML) estimators (mean and sd) and median and MAD are computed. The comparison is based on the empirical MSE.

Usage

1
2
3
showdown(n, M, eps, contD, seed = 123, estfun, estMean, estSd,
         eps.lower = 0, eps.upper = 0.05, steps = 3L, fsCor = TRUE, 
         plot1 = FALSE, plot2 = FALSE, plot3 = FALSE)

Arguments

n

integer; sample size, should be at least 3.

M

integer; Monte-Carlo replications.

eps

amount of contamination in [0, 0.5].

contD

object of class "UnivariateDistribution"; contaminating distribution.

seed

random seed.

estfun

function to compute location and scale estimator; see details below.

estMean

function to compute location estimator; see details below.

estSd

function to compute scale estimator; see details below.

eps.lower

used by rmx estimator.

eps.upper

used by rmx estimator.

steps

integer; steps used for estimator construction.

fsCor

logical; use finite-sample correction.

plot1

logical; plot cdf of ideal and real distribution.

plot2

logical; plot 20 (or M if M < 20) randomly selected samples.

plot3

logical; generate boxplots of the results.

Details

Normal location and scale with mean = 0 and sd = 1 is used as ideal model (without restriction due to equivariance).

Since there is no estimator which yields reliable results if 50 percent or more of the observations are contaminated, we use a modification where we re-simulate all samples including at least 50 percent contaminated data.

If estfun is specified it has to compute and return a location and scale estimate (vector of length 2). One can also specify the location and scale estimator separately by using estMean and estSd where estMean computes and returns the location estimate and estSd the scale estimate.

We use funtion rowRoblox for the computation of the rmx estimator.

Value

Data.frame including empirical MSE (standardized by sample size n) and relMSE with respect to the rmx estimator.

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

rowRoblox

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(MASS)
## compare with Huber's Proposal 2
showdown(n = 20, M = 100, eps = 0.02, contD = Norm(mean = 3, sd = 3), 
         estfun = function(x){ unlist(hubers(x)) },
         plot1 = TRUE, plot2 = TRUE, plot3 = TRUE)

## compare with Huber M estimator with MAD scale
showdown(n = 20, M = 100, eps = 0.02, contD = Norm(mean = 3, sd = 3), 
         estfun = function(x){ unlist(huber(x)) },
         plot1 = TRUE, plot2 = TRUE, plot3 = TRUE)

Example output

Loading required package: distrMod
Loading required package: distr
Loading required package: startupmsg
:startupmsg>  Utilities for Start-Up Messages (version 0.9.6)
:startupmsg> 
:startupmsg>  For more information see ?"startupmsg",
:startupmsg>  NEWS("startupmsg")

Loading required package: sfsmisc
:distr>  Object Oriented Implementation of Distributions (version
:distr>  2.8.0)
:distr> 
:distr>  Attention: Arithmetics on distribution objects are
:distr>  understood as operations on corresponding random variables
:distr>  (r.v.s); see distrARITH().
:distr> 
:distr>  Some functions from package 'stats' are intentionally masked
:distr>  ---see distrMASK().
:distr> 
:distr>  Note that global options are controlled by distroptions()
:distr>  ---c.f. ?"distroptions".
:distr> 
:distr>  For more information see ?"distr", NEWS("distr"), as well as
:distr>    http://distr.r-forge.r-project.org/
:distr>  Package "distrDoc" provides a vignette to this package as
:distr>  well as to several extension packages; try
:distr>  vignette("distr").


Attaching package: 'distr'

The following objects are masked from 'package:stats':

    df, qqplot, sd

Loading required package: distrEx
:distrEx>  Extensions of Package 'distr' (version 2.8.0)
:distrEx> 
:distrEx>  Note: Packages "e1071", "moments", "fBasics" should be
:distrEx>  attached /before/ package "distrEx". See
:distrEx>  distrExMASK().Note: Extreme value distribution
:distrEx>  functionality has been moved to
:distrEx> 
:distrEx>        package "RobExtremes". See distrExMOVED().
:distrEx> 
:distrEx>  For more information see ?"distrEx", NEWS("distrEx"), as
:distrEx>  well as
:distrEx>    http://distr.r-forge.r-project.org/
:distrEx>  Package "distrDoc" provides a vignette to this package
:distrEx>  as well as to several related packages; try
:distrEx>  vignette("distr").


Attaching package: 'distrEx'

The following objects are masked from 'package:stats':

    IQR, mad, median, var

Loading required package: RandVar
:RandVar>  Implementation of Random Variables (version 1.2.0)
:RandVar> 
:RandVar>  For more information see ?"RandVar", NEWS("RandVar"), as
:RandVar>  well as
:RandVar>    http://robast.r-forge.r-project.org/
:RandVar>  This package also includes a vignette; try
:RandVar>  vignette("RandVar").

Loading required package: MASS
Loading required package: stats4
:distrMod>  Object Oriented Implementation of Probability Models
:distrMod>  (version 2.8.2)
:distrMod> 
:distrMod>  Some functions from pkg's 'base' and 'stats' are
:distrMod>  intentionally masked ---see distrModMASK().
:distrMod> 
:distrMod>  Note that global options are controlled by
:distrMod>  distrModoptions() ---c.f. ?"distrModoptions".
:distrMod> 
:distrMod>  For more information see ?"distrMod",
:distrMod>  NEWS("distrMod"), as well as
:distrMod>    http://distr.r-forge.r-project.org/
:distrMod>  There is a vignette to this package; try
:distrMod>  vignette("distrMod").
:distrMod>  Package "distrDoc" provides a vignette to the other
:distrMod>  distrXXX packages,
:distrMod>  as well as to several related packages; try
:distrMod>  vignette("distr").


Attaching package: 'distrMod'

The following object is masked from 'package:stats4':

    confint

The following object is masked from 'package:stats':

    confint

The following object is masked from 'package:base':

    norm

Loading required package: RobAStBase
Loading required package: rrcov
Loading required package: robustbase
Scalable Robust Estimators with High Breakdown Point (version 1.4-7)

:RobAStBase>  Robust Asymptotic Statistics (version 1.2.1)
:RobAStBase> 
:RobAStBase>  Some functions from pkg's 'stats' and 'graphics'
:RobAStBase>  are intentionally masked ---see RobAStBaseMASK().
:RobAStBase> 
:RobAStBase>  Note that global options are controlled by
:RobAStBase>  RobAStBaseoptions() ---c.f. ?"RobAStBaseoptions".
:RobAStBase> 
:RobAStBase>  For more information see ?"RobAStBase",
:RobAStBase>  NEWS("RobAStBase"), as well as
:RobAStBase>    http://robast.r-forge.r-project.org/


Attaching package: 'RobAStBase'

The following object is masked from 'package:graphics':

    clip

dev.new(): using pdf(file="Rplots1.pdf")
                               ML      Med Competitor       rmx
n x empMSE (loc)         1.151729 1.571687  1.0217407 1.0412422
relMSE (loc)             1.106111 1.509434  0.9812710 1.0000000
n x empMSE (scale)       1.086260 1.493500  0.7204599 0.6113725
relMSE (scale)           1.776757 2.442864  1.1784303 1.0000000
n x empMSE (loc + scale) 2.237989 3.065187  1.7422006 1.6526147
relMSE (loc + scale)     1.354211 1.854750  1.0542086 1.0000000
dev.new(): using pdf(file="Rplots2.pdf")
dev.new(): using pdf(file="Rplots3.pdf")
                               ML      Med Competitor       rmx
n x empMSE (loc)         1.151729 1.571687   1.091427 1.0412422
relMSE (loc)             1.106111 1.509434   1.048197 1.0000000
n x empMSE (scale)       1.086260 1.493500   1.493499 0.6113725
relMSE (scale)           1.776757 2.442864   2.442862 1.0000000
n x empMSE (loc + scale) 2.237989 3.065187   2.584925 1.6526147
relMSE (loc + scale)     1.354211 1.854750   1.564143 1.0000000

RobLox documentation built on May 2, 2019, 11:03 a.m.

Related to showdown in RobLox...