tukeyPsi1             package:robustbase             R Documentation

_T_u_k_e_y'_s _B_i-_s_q_u_a_r_e _S_c_o_r_e (_P_s_i) _F_u_n_c_t_i_o_n _a_n_d _D_e_r_i_v_a_t_i_v_e

_D_e_s_c_r_i_p_t_i_o_n:

     Compute Tukey's bi-square score (psi) function, its first
     derivative or it's integral/"principal function".  This is scaled
     such that psi'(0) = 1, i.e., psi(x) ~= x around 0.

_U_s_a_g_e:

     tukeyPsi1(x, cc, deriv = 0)

_A_r_g_u_m_e_n_t_s:

       x: numeric vector.

      cc: tuning constant 

   deriv: integer in {-1,0,1} specifying the order of the derivative;
          the default, 'deriv = 0' computes the psi-function.

_V_a_l_u_e:

     a numeric vector of the same length as 'x'.

_N_o_t_e:

     'tukeyPsi1(x, d)' and 'tukeyChi(x, d+1)' and  are just re-scaled
     versions of each other (for 'd in -1:1').

     We use the name 'tukeyPsi*1*', because 'tukeyPsi' is reserved for
     a future "Psi Function" class object, see 'psiFunc'.

_A_u_t_h_o_r(_s):

     Matias Salibian-Barrera, Martin Maechler and Andreas Ruckstuhl

_S_e_e _A_l_s_o:

     'lmrob' and 'tukeyChi'; further 'anova.lmrob' which needs the
     'deriv = -1'.

_E_x_a_m_p_l_e_s:

     op <- par(mfrow = c(3,1), oma = c(0,0, 2, 0),
               mgp = c(1.5, 0.6, 0), mar= .1+c(3,4,1,1))
     x <- seq(-5, 5, length = 201)
     cc <- 4.69 # as set by default in lmrob.control()
     plot. <- function(...) { plot(..., asp = 1); abline(h=0,v=0, col="gray", lty=3)}
     plot.(x, tukeyPsi1(x, cc), type = "l", col = 2)
     abline(0:1, lty = 3, col = "light blue")
     plot.(x, tukeyPsi1(x, cc, deriv = -1), type = "l", col = 2)
     plot.(x, tukeyPsi1(x, cc, deriv =  1), type = "l", col = 2); abline(h=1,lty=3)
     mtext(sprintf("tukeyPsi1(x, c = %g, deriv),  deriv = 0, -1, 1", cc),
           outer = TRUE, font = par("font.main"), cex = par("cex.main"))
     par(op)

