Struct LinearRegression
- Namespace
- ScottPlot.Statistics
- Assembly
- ScottPlot.dll
public readonly struct LinearRegression
- Inherited Members
- Extension Methods
Constructors
LinearRegression(Coordinates[])
Calculate the linear regression from a collection of X/Y coordinates
public LinearRegression(Coordinates[] coordinates)
Parameters
coordinates
Coordinates[]
LinearRegression(IEnumerable<Coordinates>)
Calculate the linear regression from a collection of X/Y coordinates
public LinearRegression(IEnumerable<Coordinates> coordinates)
Parameters
coordinates
IEnumerable<Coordinates>
LinearRegression(double[], double, double)
Calculate the linear regression from a collection of evenly-spaced Y values
public LinearRegression(double[] ys, double firstX = 0, double xSpacing = 1)
Parameters
LinearRegression(double[], double[])
Calculate the linear regression a paired collection of X and Y points
public LinearRegression(double[] xs, double[] ys)
Parameters
Fields
Offset
public readonly double Offset
Field Value
Rsquared
public readonly double Rsquared
Field Value
Slope
public readonly double Slope
Field Value
Properties
Formula
public string Formula { get; }
Property Value
FormulaWithRSquared
public string FormulaWithRSquared { get; }
Property Value
Methods
GetValue(double)
Return the Y point of the regression line for the given X position
public double GetValue(double x)
Parameters
x
double
Returns
GetValues(double[])
Return the Y points of the regression line for the given X positions
public double[] GetValues(double[] xs)
Parameters
xs
double[]
Returns
- double[]