C# Class ImsInformed.Statistics.FitLine

The fit FitLine.
Exibir arquivo Open project: PNNL-Comp-Mass-Spec/IMS-Informed-Library Class Usage Examples

Public Methods

Method Description
AddPoint ( ContinuousXYPoint point ) : void
AddPoints ( IEnumerable points ) : void
DiagnoseRegression ( double>.Func weightFunc = null ) : void
FitLine ( ) : System

Initializes a new instance of the FitLine class.

FitLine ( IEnumerable initialPoints ) : System
ModelPredictX2Y ( double x ) : double

Return the predicted Y at given X

ModelPredictY2X ( double y ) : double

Return the predicted Y at given X

PerformRegression ( ) : void

Using current fits points stored in the fitline to initiate regression

PerformRegression ( IEnumerable xyPoints ) : void

Refit a group of points to the fit line.

RemoveOutlierWithHighestCookDistance ( int minFitPoints ) : int

The remove outlier with highest cook distance.

RemoveOutliersAboveThreshold ( double CooksDThreshold, int minFitPoints ) : int

The remove outliers above threshold.

RemovePoint ( ContinuousXYPoint point ) : void
ResetPoints ( IEnumerable points ) : void

Protected Methods

Method Description
CalculateMSE ( ) : double
CalculateRSquared ( ) : double

Calculate R-square(Coefficient of determination)

ComputeResidual ( ContinuousXYPoint point ) : double

Compute the residual of a fit point.

CooksDistance ( ContinuousXYPoint point, double ssh, double meanX, int pointsCount, double &leverage ) : double

The cooks distance.

DiagnosePoints ( double>.Func weightFunc ) : void

Calculate Cook's distance for all points

LeastSquaresFitLinear ( IEnumerable xyPoints, double &gain, double &offset ) : void

Computes fit FitLine for potential voltage group and writes

LeastSquaresFitdLinear ( IEnumerable xyPoints ) : void

wrapper for updating gain and offset using LeastSquaresFitLinear

Private Methods

Method Description
CalculatedRSquaredVanilla ( ) : double

Method Details

AddPoint() public method

public AddPoint ( ContinuousXYPoint point ) : void
point ContinuousXYPoint
return void

AddPoints() public method

public AddPoints ( IEnumerable points ) : void
points IEnumerable
return void

CalculateMSE() protected method

protected CalculateMSE ( ) : double
return double

CalculateRSquared() protected method

Calculate R-square(Coefficient of determination)
protected CalculateRSquared ( ) : double
return double

ComputeResidual() protected method

Compute the residual of a fit point.
///
protected ComputeResidual ( ContinuousXYPoint point ) : double
point ContinuousXYPoint /// The point. ///
return double

CooksDistance() protected method

The cooks distance.
protected CooksDistance ( ContinuousXYPoint point, double ssh, double meanX, int pointsCount, double &leverage ) : double
point ContinuousXYPoint /// The point. ///
ssh double /// The ssh. ///
meanX double /// The mean X. ///
pointsCount int /// The points count. ///
leverage double
return double

DiagnosePoints() protected method

Calculate Cook's distance for all points
A delegate callback throws an exception.
protected DiagnosePoints ( double>.Func weightFunc ) : void
weightFunc double>.Func
return void

DiagnoseRegression() public method

A delegate callback throws an exception.
public DiagnoseRegression ( double>.Func weightFunc = null ) : void
weightFunc double>.Func
return void

FitLine() public method

Initializes a new instance of the FitLine class.
public FitLine ( ) : System
return System

FitLine() public method

public FitLine ( IEnumerable initialPoints ) : System
initialPoints IEnumerable
return System

LeastSquaresFitLinear() protected abstract method

Computes fit FitLine for potential voltage group and writes
protected abstract LeastSquaresFitLinear ( IEnumerable xyPoints, double &gain, double &offset ) : void
xyPoints IEnumerable /// The xy points. ///
gain double
offset double
return void

LeastSquaresFitdLinear() protected method

wrapper for updating gain and offset using LeastSquaresFitLinear
protected LeastSquaresFitdLinear ( IEnumerable xyPoints ) : void
xyPoints IEnumerable
return void

ModelPredictX2Y() public method

Return the predicted Y at given X
public ModelPredictX2Y ( double x ) : double
x double /// The X. ///
return double

ModelPredictY2X() public method

Return the predicted Y at given X
Cannot predict value with model, please run linear regression first.
public ModelPredictY2X ( double y ) : double
y double
return double

PerformRegression() public method

Using current fits points stored in the fitline to initiate regression
public PerformRegression ( ) : void
return void

PerformRegression() public method

Refit a group of points to the fit line.
public PerformRegression ( IEnumerable xyPoints ) : void
xyPoints IEnumerable /// The xy points. ///
return void

RemoveOutlierWithHighestCookDistance() public method

The remove outlier with highest cook distance.
public RemoveOutlierWithHighestCookDistance ( int minFitPoints ) : int
minFitPoints int
return int

RemoveOutliersAboveThreshold() public method

The remove outliers above threshold.
///
public RemoveOutliersAboveThreshold ( double CooksDThreshold, int minFitPoints ) : int
CooksDThreshold double /// The cooks d threshold. ///
minFitPoints int /// The min fit points. ///
return int

RemovePoint() public method

public RemovePoint ( ContinuousXYPoint point ) : void
point ContinuousXYPoint
return void

ResetPoints() public method

public ResetPoints ( IEnumerable points ) : void
points IEnumerable
return void