naginterfaces.library.univar.outlier_peirce_2var¶
- naginterfaces.library.univar.outlier_peirce_2var(n, e, var1, var2)[source]¶
outlier_peirce_2var
returns a flag indicating whether a single data point is an outlier as defined by Peirce’s criterion.For full information please refer to the NAG Library document for g07gb
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g07/g07gbf.html
- Parameters
- nint
, the number of observations.
- efloat
, the value being tested.
- var1float
, the residual variance on fitting model to .
- var2float
, the residual variance on fitting model to .
- Returns
- outlbool
if the value being tested is an outlier.
- xfloat
An estimated value of , the cutoff that indicates an outlier.
- lxfloat
, the lower limit for .
- uxfloat
, the upper limit for .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, , .
Constraint: .
- Notes
outlier_peirce_2var
tests a potential outlying value using Peirce’s criterion. Letdenote a vector of residuals with mean zero and variance obtained from fitting some model to a series of data ,
denote the largest absolute residual in , i.e., for all , and let denote the data series with the observation corresponding to having been omitted,
denote the residual variance on fitting model to ,
denote the ratio of and with .
Peirce’s method flags as a potential outlier if , where and is obtained from the solution of
where
and is the cumulative distribution function for the standard Normal distribution.
Unlike
outlier_peirce_1var()
, both and must be supplied and, therefore, no assumptions are made about the nature of the relationship between these two quantities. Only a single potential outlier is tested for at a time.This function uses an algorithm described in
opt.one_var_func
to refine a lower, , and upper, , limit for . This refinement stops when or .
- References
Gould, B A, 1855, On Peirce’s criterion for the rejection of doubtful observations, with tables for facilitating its application, The Astronomical Journal (45)
Peirce, B, 1852, Criterion for the rejection of doubtful observations, The Astronomical Journal (45)