CLsqFit:SetRejSigmaHigh
The SetRejSigmaHigh method sets the high sigma clipping parameter for rejecting outlying data far above the fit. This parameter is a string that specifies a list of k values for iterative k-sigma clipping.
CLsqFit:SetRejSigmaHigh( sSigmaHigh ) CLsqFit:SetRejSigmaHigh( sSigmaHigh, nChannel ) |
sSigmaHigh is a string giving the sequence of sigmas used for high value rejection. The default is "2.8,2.8,2.8". The string can specify from 1 to many values.
nChannel an optional parameter which specifies the channel. If omitted, values are set for all channels.
This method configures the high clipping parameter for use when data rejection is enabled by calling DoRejection. Here, "sigma" corresponds to the standard deviation of the fit (see GetSigmaFit). Points having residuals further than k-sigmas above the fit will be discarded and the fit then recomputed in an iterative process. This method specifies the list of k values as the comma-separated string sSigmaHigh. The currently assigned value of sSigmaHigh may be obtained using GetRejSigmaHigh. See Rejecting Outliers from the Fit for a detailed description of this parameter.
If the nChannel parameter is absent, all channels are assigned the same value of sSigmaHigh.
The example below fits a line to (x,y) pair data which includes 1 point significantly above the trend. Without data rejection, the bad point is included in the fit and the standard deviation is high. Data rejection is then enabled (with default rejection parameters) and the fit rejects the outlying point, giving a significantly lower standard deviation. Finally, the SetRejSigmaHigh method is called with a large value for the high rejection threshold. Although data rejection is still enabled, the outlier is not rejected because it does not exceed the larger rejection threshold.
|
-- create a CLsqFit object |
|
-- set 2 coefficients to fit a line |
|
-- add data points |
|
|
|
|
|
-- significantly above the trend |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Fit the polynomial |
|
-- standard deviation of the fit |
|
-- how many points used in the fit? |
|
-- result: sd(10) = 6.93996 |
|
-- enable data rejection with default parameters |
|
-- re-do the fit using data rejection |
|
-- standard deviation of the fit |
|
-- how many points used in the fit? |
|
-- result: sd(9) = 0.40018 |
|
-- set high clipping to 10 sigmas |
|
-- re-do the fit using data rejection |
|
-- standard deviation of the fit |
|
-- how many points used in the fit? |
|
-- result: sd(10) = 6.93996 |
CLsqFit class, GetRejSigmaHigh, SetRejSigmaLow, SetRejCycles, SetRejDefault, Rejecting Outliers from the Fit
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.