RegressionResult Class

A polynomial fitted by least squares: y = c0 + c1 x + c2 x² + ...

public sealed class RegressionResult

Properties

NameDescription
CoefficientsGets the coefficients, from the constant term to the term of the highest degree.
DegreeGets the degree of the polynomial.
RSquaredGets the coefficient of determination: the share of the variance of y that the fit explains, from 0 to 1.

Gets the coefficients, from the constant term to the term of the highest degree.

public IReadOnlyList<double> Coefficients { get; }

Property value

IReadOnlyList<double>

Gets the degree of the polynomial.

public int Degree { get; }

Property value

int

Gets the coefficient of determination: the share of the variance of y that the fit explains, from 0 to 1.

public double RSquared { get; }

Property value

double

Methods

NameDescription
Evaluate(double)Evaluates the polynomial.
ToString()Returns the equation, such as y = 1.5x + 2 (R² = 0.98).

Evaluate(double)

RegressionResult.cs

Evaluates the polynomial.

public double Evaluate(double x)

Parameters

x double
The x value.

Returns

double The fitted y value.

Returns the equation, such as y = 1.5x + 2 (R² = 0.98).

public override string ToString()

Returns

string The equation.