math-php
Public Member Functions | Protected Attributes | List of all members
MathPHP\Statistics\Regression\Regression Class Reference

Base class for regressions. More...

Inheritance diagram for MathPHP\Statistics\Regression\Regression:
Inheritance graph
[legend]

Public Member Functions

 __construct (array $points)
 Constructor - Prepares the data arrays for regression analysis. More...
 
 evaluate (float $x)
 Evaluate the regression equation at x Uses the instance model's evaluateModel method. More...
 
 getPoints ()
 Get points. More...
 
 getXs ()
 Get Xs (x values of each point) More...
 
 getYs ()
 Get Ys (y values of each point) More...
 
 getSampleSize ()
 Get sample size (number of points) More...
 
 yHat ()
 Ŷ (yhat) A list of the predicted values of Y given the regression. More...
 

Protected Attributes

 $points
 
 $xs
 
 $ys
 
 $n
 

Detailed Description

Base class for regressions.

Constructor & Destructor Documentation

◆ __construct()

MathPHP\Statistics\Regression\Regression::__construct ( array  $points)

Constructor - Prepares the data arrays for regression analysis.

Parameters
array$points[ [x, y], [x, y], ... ]

Member Function Documentation

◆ evaluate()

MathPHP\Statistics\Regression\Regression::evaluate ( float  $x)

Evaluate the regression equation at x Uses the instance model's evaluateModel method.

Parameters
float$x
Returns
float

◆ getPoints()

MathPHP\Statistics\Regression\Regression::getPoints ( )

Get points.

Returns
array

◆ getSampleSize()

MathPHP\Statistics\Regression\Regression::getSampleSize ( )

Get sample size (number of points)

Returns
int

◆ getXs()

MathPHP\Statistics\Regression\Regression::getXs ( )

Get Xs (x values of each point)

Returns
array of x values

◆ getYs()

MathPHP\Statistics\Regression\Regression::getYs ( )

Get Ys (y values of each point)

Returns
array of y values

◆ yHat()

MathPHP\Statistics\Regression\Regression::yHat ( )

Ŷ (yhat) A list of the predicted values of Y given the regression.

Returns
array

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