Gin
Public Member Functions | List of all members
LeastSquaresRegression Class Reference

See https://www.codeproject.com/Articles/63170/Least-Squares-Regression-for-Quadratic-Curve-Fitti for original code. More...

Public Member Functions

 LeastSquaresRegression ()=default
 
void addPoint (double x, double y)
 
void addPoint (Point< double > point)
 
void addPoints (juce::Array< Point< double >> points)
 
void clear ()
 
bool enoughPoints ()
 
juce::Array< double > getTerms ()
 
double aTerm ()
 
double bTerm ()
 
double cTerm ()
 
double rSquare ()
 

Detailed Description

See https://www.codeproject.com/Articles/63170/Least-Squares-Regression-for-Quadratic-Curve-Fitti for original code.

Derive the equation of a quadratic curve from a series of data points. That is to say, to determine a, b, and c, where y = ax2 + bx + c. Having determined a, b, and c, I would also need a value for R-squared (the coefficient of determination).

Constructor & Destructor Documentation

◆ LeastSquaresRegression()

LeastSquaresRegression::LeastSquaresRegression ( )
default

Member Function Documentation

◆ addPoint() [1/2]

void LeastSquaresRegression::addPoint ( double  x,
double  y 
)

◆ addPoint() [2/2]

void LeastSquaresRegression::addPoint ( Point< double >  point)

◆ addPoints()

void LeastSquaresRegression::addPoints ( juce::Array< Point< double >>  points)

◆ clear()

void LeastSquaresRegression::clear ( )

◆ enoughPoints()

bool LeastSquaresRegression::enoughPoints ( )

◆ getTerms()

juce::Array<double> LeastSquaresRegression::getTerms ( )

◆ aTerm()

double LeastSquaresRegression::aTerm ( )

◆ bTerm()

double LeastSquaresRegression::bTerm ( )

◆ cTerm()

double LeastSquaresRegression::cTerm ( )

◆ rSquare()

double LeastSquaresRegression::rSquare ( )

The documentation for this class was generated from the following file: