QuickLinearRegression Type

Class for doing a quick and dirty regression of order 1 only returning intercept and slope. Can not handle too big or too input values.

Constructors

Constructor Description

QuickLinearRegression()

Full Usage: QuickLinearRegression()

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:
    x : float - The x value of the data point.
    y : float - The y value of the data point.

Adds a data point to the regression.

x : float

The x value of the data point.

y : float

The y value of the data point.

this.AddRange

Full Usage: this.AddRange

Parameters:
    values : IEnumerable<float * float> - The data points to add.

Adds data points to the statistics.

values : IEnumerable<float * float>

The data points to add.

this.GetA0

Full Usage: this.GetA0

Returns: float The intercept value or NaN if not enough data points are entered.

Gets the intercept value of the linear regression. Returns NaN if not enough data points entered.

Returns: float

The intercept value or NaN if not enough data points are entered.

this.GetA1

Full Usage: this.GetA1

Returns: float The slope value or NaN if not enough data points are entered.

Gets the slope value of the linear regression. Returns NaN if not enough data points entered.

Returns: float

The slope value or NaN if not enough data points are entered.

this.GetDeterminant

Full Usage: this.GetDeterminant

Returns: float The determinant of the regression.

Returns the determinant of regression. If zero, not enough data points have been entered.

Returns: float

The determinant of the regression.

this.GetX0

Full Usage: this.GetX0

Returns: float The intercept value with the X-Axis, i.e. the point where the regression value is zero. Returns NaN if not enough data points are entered.

Gets the intercept of the linear regression with the X-axis. Returns NaN if not enough data points entered.

Returns: float

The intercept value with the X-Axis, i.e. the point where the regression value is zero. Returns NaN if not enough data points are entered.

this.GetYOfX

Full Usage: this.GetYOfX

Parameters:
    x : float - The x value.

Returns: float The y value at the value x.

Gets the y value for a given x value. Note that in every call of this function the coefficients a0 and a1 are calculated again. For repeated calls, better use QuickLinearRegression.GetYOfXFunction, but note that this function represents the state of the regression at the time of this call.

x : float

The x value.

Returns: float

The y value at the value x.

this.GetYOfXFunction

Full Usage: this.GetYOfXFunction

Returns: Func<float, float> A function to calculate y in dependence of x.

Returns a function to calculate y in dependence of x. Please note note that the returned function represents the state of the regression at the time of the call, i.e. subsequent additions of data does not change the function.

Returns: Func<float, float>

A function to calculate y in dependence of x.

this.MeanX

Full Usage: this.MeanX

Returns: float

Returns: float

this.MeanY

Full Usage: this.MeanY

Returns: float

Returns: float

this.N

Full Usage: this.N

Returns: float

Returns the number of entries added.

Returns: float

this.PearsonCorrelationCoefficient

Full Usage: this.PearsonCorrelationCoefficient

Returns: float

Returns: float