| robScale | R Documentation |
Compute the robust estimate of scale for very small samples.
robScale(x, loc = NULL, implbound = 1e-4, na.rm = FALSE, maxit = 80L,
tol = NULL, madfctrs = c("AA", "CR"), usefctrs = FALSE)
x |
numeric; A vector of values. |
loc |
numeric; The location, if known, can be used to enhance the estimate for the scale. Defaults to unknown. |
implbound |
numeric; The smallest value that |
na.rm |
logical; If |
maxit |
numeric; The maximum number of iterations. Defaults to 80. |
tol |
numeric; The desired numeric tolerance. Defaults to the
square root of |
madfctrs |
character; when passing data to |
usefctrs |
logical; If |
Computes the M-estimator for scale using a smooth \rho-function defined as
the square of the logistic \psi function used in location estimation
(Rousseeuw & Verboven, 2002, 4.2). When the sequence of observations is too
short for a robust estimate, the scale estimate will default to mad so
long as mad has not “imploded”, i.e. it is greater than
implbound which defaults to 0.0001. When mad has imploded,
adm is used instead.
If the location is known and passed through loc, the algorithm uses the
suggestion in Rousseeuw & Verboven section 5 (2002) converting the observations
to distances from 0 and iterating on the adjusted sequence. In this case, the
large-scale simulation indicated that there was no bias, so usefctrs is
ignored.
If na.rm is TRUE then NA values are stripped from x
before computation takes place. If this is not done then an NA value in
x will return an error.
The tolerance and number of iterations are similar to those in existing base R functions.
Rousseeuw & Verboven suggest using this function when there are 3–8 samples. It is implied that having more than 8 samples allows the use of more standard estimators.
Solves for the robust estimate of scale, S_n, which is the solution
to
\frac{1}{n}\sum_{i = 1}^n\rho\left(\frac{x_i - T_n}{S_n}\right) = \beta
where T_n is fixed at median(x) and \beta is fixed at
0.5. The \rho-function selected by Rousseeuw & Verboven is based on the
square of the \psi-function used in robLoc. Specifically
\rho_{log}(x) = \psi_{log}^2\left(\frac{x}{0.37394112142347236}\right)
The constant 0.37394112142347236 is necessary so that
\beta = \int\rho(u)\;d\Phi(u)=0.5
Avraham Adler Avraham.Adler@gmail.com
Croux, Christophe and Rousseeuw, Peter J. (1992) "Time-Efficient Algorithms for Two Highly Robust Estimators of Scale", Computational Statistics, Vol. 1, 411–428. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-662-26811-7_58")}
Rousseeuw, Peter J. and Verboven, Sabine (2002) Robust estimation in very small samples. Computational Statistics & Data Analysis, 40, (4), 741–758. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/S0167-9473(02)00078-6")}
See adm, mad, and madn for more
basic robust estimators of scale.
See Qn and Sn in the
robustbase package
for more specialized robust scale estimators for larger samples. These last two
are based on code written by Peter Rousseeuw.
robScale(c(1:9))
x <- c(1,2,3,5,7,8)
c(robScale(x), robScale(x, loc = 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.