psifun: Finds the tuning constant(s) associated to the supplied...

View source: R/psifun.R

psifunR Documentation

Finds the tuning constant(s) associated to the supplied breakdown point or asymptotic efficiency for different psi functions

Description

Finds the tuning constant(s) associated to the supplied breakdown point or asymptotic efficiency or computes breakdown point and efficiency associated with the supplied constant(s) for the following psi functions: TB=Tukey biweight, HA=Hampel, HU=Huber, HYP=Hyperbolic, OPT=Optimal, PD=mdpd.

Usage

psifun(
  u = vector(mode = "double", length = 0),
  p = 1,
  fun = c("TB", "bisquare", "biweight", "HA", "hampel", "HU", "huber", "HYP",
    "hyperbolic", "OPT", "optimal", "PD", "mdpd"),
  bdp,
  eff,
  const,
  param,
  trace = FALSE
)

Arguments

u

optional vector containing scaled residuals or Mahalanobis distances for the n units of the sample. If not provided, rho, psi, psider, psix and weights are not computed

p

number of variables (p=1 for regression)

fun

psi function class. One of TB, HA, HU, HP, OPT or PD.

bdp

requested breakdown point

eff

requested asymptotic efficiency

const

tuning constant c

param

additional parameters

trace

whether to print intermediate results. Default is trace=FALSE.

Value

A list will be returned containing the following elements:

  1. class: link function which has be used. Possible values are 'bisquare', 'optimal', 'hyperbolic', 'hampel', 'huber' or 'mdpd'

  2. bdp: breakdown point

  3. eff: asymptotic efficiency

  4. c1: consistency factor (and other parameters) associated to required breakdown point or nominal efficiency.

  5. kc1: Expectation of rho associated with c1 to get a consistent estimator at the model distribution kc1 = E(rho) = sup(rho)*bdp

  6. rho: vector of length n which contains the rho function associated to the residuals or Mahalanobis distances for the n units of the sample. Empty if u is not provided.

  7. psi: vector of length n which contains the psi function associated with the residuals or Mahalanobis distances for the n units of the sample. Empty if u is not provided.

  8. psider: vector of length n which contains the derivative of the psi function associated with the residuals or Mahalanobis distances for the n units of the sample. Empty if u is not provided.

  9. psix: vector of length n which contains the psi function mutiplied by u associated with the residuals or Mahalanobis distances for the n units of the sample. Empty if u is not provided.

  10. wei: vector of length n which contains the weights associated with the residuals or Mahalanobis distances for the n units of the sample. Empty if u is not provided.

Author(s)

FSDA team, valentin.todorov@chello.at

References

Hoaglin, D.C. and Mosteller, F. and Tukey, J.W. (1982), Understanding Robust and Exploratory Data Analysis, Wiley, New York.

Huber, P.J. (1981), Robust Statistics, Wiley.

Huber, P.J. and Ronchetti, E.M. (2009), Robust Statistics, 2nd Edition, Wiley.

Hampel, F.R. and Rousseeuw, P.J. and Ronchetti E. (1981), The Change-of-Variance Curve and Optimal Redescending M-Estimators, Journal of the American Statistical Association, 76, pp. 643–648.

Maronna, R.A. and Martin D. and Yohai V.J. (2006), Robust Statistics, Theory and Methods, Wiley, New York.

Riani, M. and Atkinson, A. C. and Corbellini, A. and Perrotta, D. (2020) Robust regression with density power divergence: Theory, comparisons, and data analysis, Entropy 22. doi:10.3390/e22040399.

Examples


 ## Not run: 
 ##  Find c for given bdp for the Tukey biweight function
 ##  The constant c associated to a breakdown point of
 ##  50 percent in regression is
 ##      c=1.547644980928226
     psifun(bdp=0.5)
     psifun(c=1.547644980928226)

 ##  Find c for given bdp for the Hampel function
 psifun(bdp=0.5, fun="hampel")

 ## Plot Huber rho function.
 x <- seq(-3, 3, 0.001)
 c <- 1.345;

 HUc1 <- psifun(u=x, p=1, fun="HU", const=c)
 rhoHU <- HUc1$rho

 plot(x, rhoHU, type="l", lty="solid", lwd=2, col="blue",
     xlab="u", ylab="rho (u,1.345)", ylim=c(0.16, 4.5))
 lines(x, x^2/2, type="l", lty="dotted", lwd=1.5, col="red")
 legend(-1, 4.6, legend=c("Huber rho function", "u^2/2"),
     lty=c("solid", "dotted"), lwd=c(2,1.5), col=c("blue", "red"))

 yc <- 0.13;
 text(-c, yc, paste0("-c=", -c), adj=1)
 text(c,yc, paste0("c=",c), adj=0)

 segments(c, 0, c, c**2/2, col="red")
 segments(-c, 0, -c, c**2/2, col="red")
 points(c, c**2/2, col="red")
 points(-c, c**2/2, col="red")

 
## End(Not run)


fsdaR documentation built on March 31, 2023, 8:18 p.m.