QuickQuadraticRegression Type

Class for doing a quick and dirty regression of order 2 only returning the parameters A0, A1 and A2 as regression parameters. Can not handle too big or too small input values.

Constructors

Constructor Description

QuickQuadraticRegression()

Full Usage: QuickQuadraticRegression()

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 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 regression. Returns NaN if not enough data points entered.

Returns: float

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

this.GetA2

Full Usage: this.GetA2

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

Gets the quadratic parameter of the 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.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 polynomial coefficients a0, a2, and a1 are calculated again. For repeated calls, better use QuickQuadraticRegression.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.