g07gb returns a flag indicating whether a single data point is an outlier as defined by Peirce's criterion.
Syntax
C# |
---|
public static bool g07gb( int n, double e, double var1, double var2, out double x, out double lx, out double ux, out int ifail ) |
Visual Basic |
---|
Public Shared Function g07gb ( _ n As Integer, _ e As Double, _ var1 As Double, _ var2 As Double, _ <OutAttribute> ByRef x As Double, _ <OutAttribute> ByRef lx As Double, _ <OutAttribute> ByRef ux As Double, _ <OutAttribute> ByRef ifail As Integer _ ) As Boolean |
Visual C++ |
---|
public: static bool g07gb( int n, double e, double var1, double var2, [OutAttribute] double% x, [OutAttribute] double% lx, [OutAttribute] double% ux, [OutAttribute] int% ifail ) |
F# |
---|
static member g07gb : n : int * e : float * var1 : float * var2 : float * x : float byref * lx : float byref * ux : float byref * ifail : int byref -> bool |
Parameters
- n
- Type: System..::..Int32On entry: , the number of observations.Constraint: .
- e
- Type: System..::..DoubleOn entry: , the value being tested.
- var1
- Type: System..::..DoubleOn entry: , the residual variance on fitting model to .Constraint: .
- var2
- Type: System..::..DoubleOn entry: , the residual variance on fitting model to .Constraints:
- ;
- .
- x
- Type: System..::..Double%On exit: an estimated value of , the cutoff that indicates an outlier.
- lx
- Type: System..::..Double%On exit: , the lower limit for .
- ux
- Type: System..::..Double%On exit: , the upper limit for .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Return Value
g07gb returns a flag indicating whether a single data point is an outlier as defined by Peirce's criterion.
Description
g07gb tests a potential outlying value using Peirce's criterion. Let
- denote 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.
(1) |
(2) |
Unlike g07ga, 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 method uses an algorithm described in e04ab 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
Error Indicators and Warnings
Errors or warnings detected by the method:
- On entry, .
- On entry, .
- On entry, or .
Accuracy
Not applicable.
Parallelism and Performance
None.
Further Comments
None.
Example
This example reads in a series of values and variances and checks whether each is a potential outlier.
The dataset used is from Peirce's original paper and consists of fifteen observations on the vertical semidiameter of Venus. Each subsequent line in the dataset, after the first, is the result of dropping the observation with the highest absolute value from the previous data and recalculating the variance.
Example program (C#): g07gbe.cs