Gin
Public Member Functions | Protected Attributes | List of all members
LinearRegression Class Reference

Calculates linear regression from a set of points. More...

Public Member Functions

 LinearRegression ()
 
 LinearRegression (juce::Array< Point< double >> points)
 
void addPoint (Point< double > pnt)
 
void calculate ()
 
void clear ()
 
bool haveData () const
 
int items () const
 
double getA () const
 
double getB () const
 
double getCoefDeterm () const
 
double getCoefCorrel () const
 
double getStdErrorEst () const
 
double estimateY (double x) const
 

Protected Attributes

int n = 0
 
double sumX = 0
 
double sumY = 0
 
double sumXsquared = 0
 
double sumYsquared = 0
 
double sumXY = 0
 
double a = 0
 
double b = 0
 
double coefD = 0
 
double coefC = 0
 
double stdError = 0
 

Detailed Description

Calculates linear regression from a set of points.

Constructor & Destructor Documentation

◆ LinearRegression() [1/2]

LinearRegression::LinearRegression ( )

◆ LinearRegression() [2/2]

LinearRegression::LinearRegression ( juce::Array< Point< double >>  points)

Member Function Documentation

◆ addPoint()

void LinearRegression::addPoint ( Point< double >  pnt)

◆ calculate()

void LinearRegression::calculate ( )

◆ clear()

void LinearRegression::clear ( )

◆ haveData()

bool LinearRegression::haveData ( ) const

References n.

◆ items()

int LinearRegression::items ( ) const

References n.

◆ getA()

double LinearRegression::getA ( ) const

References a.

◆ getB()

double LinearRegression::getB ( ) const

References b.

◆ getCoefDeterm()

double LinearRegression::getCoefDeterm ( ) const

References coefD.

◆ getCoefCorrel()

double LinearRegression::getCoefCorrel ( ) const

References coefC.

◆ getStdErrorEst()

double LinearRegression::getStdErrorEst ( ) const

References stdError.

◆ estimateY()

double LinearRegression::estimateY ( double  x) const

References a, and b.

Member Data Documentation

◆ n

int LinearRegression::n = 0
protected

Referenced by haveData(), and items().

◆ sumX

double LinearRegression::sumX = 0
protected

◆ sumY

double LinearRegression::sumY = 0
protected

◆ sumXsquared

double LinearRegression::sumXsquared = 0
protected

◆ sumYsquared

double LinearRegression::sumYsquared = 0
protected

◆ sumXY

double LinearRegression::sumXY = 0
protected

◆ a

double LinearRegression::a = 0
protected

Referenced by estimateY(), and getA().

◆ b

double LinearRegression::b = 0
protected

Referenced by estimateY(), and getB().

◆ coefD

double LinearRegression::coefD = 0
protected

Referenced by getCoefDeterm().

◆ coefC

double LinearRegression::coefC = 0
protected

Referenced by getCoefCorrel().

◆ stdError

double LinearRegression::stdError = 0
protected

Referenced by getStdErrorEst().


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