Sn                package:robustbase                R Documentation

_R_o_b_u_s_t _L_o_c_a_t_i_o_n-_F_r_e_e _S_c_a_l_e _E_s_t_i_m_a_t_e _M_o_r_e _E_f_f_i_c_i_e_n_t _t_h_a_n _M_A_D

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

     Compute the robust scale estimator Sn, an efficient alternative to
     the MAD.

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

     Sn(x, constant = 1.1926, finite.corr = missing(constant))

     s_Sn(x, mu.too = FALSE, ...)

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

       x: numeric vector of observations.

constant: number by which the result is multiplied; the default
          achieves consisteny for normally distributed data.

finite.corr: logical indicating if the finite sample bias correction
          factor should be applied.  Default to 'TRUE' unless
          'constant' is specified.

  mu.too: logical indicating if the 'median(x)' should also be returned
          for 's_Sn()'.

     ...: potentially further arguments for 's_Sn()' passed to 'Sn()'.

_D_e_t_a_i_l_s:

     ............  FIXME ........

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

     'Sn()' returns a number, the Sn robust scale estimator, scaled to
     be consistent for sigma^2 and i.i.d. Gaussian observatsions,
     optionally bias corrected for finite samples.

     's_Sn(x, mu.too=TRUE)' returns a length-2 vector with location
     (mu) and scale; this is typically only useful for 'covOGK(*,
     sigmamu = s_Sn)'.

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

     Original Fortran code: Christophe Croux and Peter Rousseeuw
     rousse@wins.uia.ac.be. 
      Port to C and R: Martin Maechler, maechler@R-project.org

_R_e_f_e_r_e_n_c_e_s:

     Rousseeuw, P.J. and Croux, C. (1993) Alternatives to the Median
     Absolute Deviation, _Journal of the American Statistical
     Association_ *88*, 1273-1283.

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

     'mad' for the 'most robust' but much less efficient scale
     estimator; 'Qn' for a similar more efficient but slower
     alternative; 'scaleTau2'.

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

     x <- c(1:10, 100+1:9)# 9 outliers out of 19
     Sn(x)
     Sn(x, c=1)# 9
     Sn(x[1:18], c=1)# 9
     set.seed(153)
     x <- sort(c(rnorm(80), rt(20, df = 1)))
     s_Sn(x, mu.too=TRUE)

