CLsqFit:GetX CLsqFit:SetRejDefault

CLsqFit:DoRejection


The DoRejection method enables or disables bad data rejection. For multi-channel data, data rejection can be applied to one or all channels. The rejection algorithm uses default rejection parameters unless you change them using one of the SetRej... methods

Syntax

CLsqFit:DoRejection( bEnable*, nChannel* )

  • bEnable is an optional argument value that specifies whether to enable or disable data rejection. Set it true to enable bad data rejection or false to disable it.
  • nChannel an optional argument that specifies the channel. If omitted, the data rejection state is set for all channels.
  • If neither bEnable or nChannel is specified, then data rejection is enabled for all channels.

Remarks

Data rejection is performed during the fitting procedure invoked by calling Fit. The data rejection parameters can be set to default values using SetRejDefault or to specific values using SetRejSigmaHigh, SetRejSigmaLow, or SetRejCycles, Unless changed using one of these methods, the rejection algorithm assumes the default parameters.

Example

This example deletes a sample point and enables data rejection. After the fit is run, it lists the number of points used in the fit and the total number of points added to the sample.

L = CLsqFit:new()

-- create a CLsqFit object

L:SetNumCoefs( 2 )

-- set 2 coefficients to fit a line

L:AddPt( 3.5, 5.15 )

-- add a point for x = 3.5, y = 5.15

L:AddPt( -12, 14 )

-- add a point

L:AddPt( -2, -4.25 )

-- add a point

 

-- add more points

L:DeletePt ( 2 )

-- manually delete the 2nd point

L:DoRejection()

-- enable bad data rejection for all channels

L:Fit()

-- Fit the polynomial

nD = L:GetNumPtsDeleted()

-- number of points deleted

nR = L:GetNumPtsRejected()

-- number of points rejected

Printf( "nDel=%d, nRej= %d\n", nD, nR )

-- list number deleted and number rejected

Related Topics

CLsqFit class, Fit, SetRejSigmaHigh, SetRejSigmaLow, SetRejCycles, GetRejSigmaHigh, GetRejSigmaLow, GetRejCycles, SetRejDefault, Rejecting Outliers from the Fit