peirce_anomalies {weird} | R Documentation |
Peirce's criterion and Chauvenet's criterion were both proposed in the 1800s as a way of determining what observations should be rejected in a univariate sample.
peirce_anomalies(y)
chauvenet_anomalies(y)
y |
numerical vector of observations |
These functions take a univariate sample y
and return a logical
vector indicating which observations should be considered anomalies according
to either Peirce's criterion or Chauvenet's criterion.
A logical vector
Rob J Hyndman
Peirce, B. (1852). Criterion for the rejection of doubtful observations. The Astronomical Journal, 2(21), 161–163.
Chauvenet, W. (1863). 'Method of least squares'. Appendix to Manual of Spherical and Practical Astronomy, Vol.2, Lippincott, Philadelphia, pp.469-566.
y <- rnorm(1000)
tibble(y = y) |> dplyr::filter(peirce_anomalies(y))
tibble(y = y) |> dplyr::filter(chauvenet_anomalies(y))