PHP Class MCordingley\Regression\StatisticsGatherer\Linear

Show file Open project: mcordingley/regression Class Usage Examples

Public Methods

Method Description
__construct ( Observations $observations, array $coefficients, MCordingley\Regression\Predictor\Predictor $predictor )
getDegreesOfFreedomError ( ) : integer
getDegreesOfFreedomModel ( ) : integer
getDegreesOfFreedomTotal ( ) : integer
getFStatistic ( ) : float Returns the F statistic, which is compared against the F distribution CDF to determine if the regression is "significant" or not.
getRSquared ( ) : float Calculates the coefficient of determination. i.e. how well the line of best fit describes the data.
getStandardError ( ) : float Calculates the standard error of the regression. This is the average distance of observed values from the regression line. It's conceptually similar to the standard deviation.
getStandardErrorCoefficients ( ) : array Calculates the standard error of each of the regression coefficients.
getTStatistics ( ) : array Calculates the t test values of each of the regression coefficients.

Private Methods

Method Description
getFeatureCount ( ) : integer
getMeanSquaredError ( ) : float Returns the mean-squared error of the regression, which is effectively the "average" of the corresponding sum of squares.
getMeanSquaredModel ( ) : float Returns the mean-squared model of the regression, which is effectively the "average" of the corresponding sum of squares.
getObservationCount ( ) : integer
getPredictedOutcomes ( ) : array
getSumSquaredError ( ) : float Calculates the sum of the squares of the residuals, which are the distances of the observations from their predicted values, a raw measure of the overall error in the regression model.
getSumSquaredModel ( ) : float Calculates the sum-squared error of the regression. This is the sum of the squared distances of predicted values from their average.
getSumSquaredTotal ( ) : float Calculates the sum-squared total of the regression. This is the sum of the squared distances of observations from their average, a useful measure to put the sum-squared error (SSE) and sum-squared model (SSM) into context.
sumSquaredDifference ( array $series, float $baseline ) : float

Method Details

__construct() public method

public __construct ( Observations $observations, array $coefficients, MCordingley\Regression\Predictor\Predictor $predictor )
$observations MCordingley\Regression\Observations
$coefficients array
$predictor MCordingley\Regression\Predictor\Predictor

getDegreesOfFreedomError() public method

getDegreesOfFreedomModel() public method

getDegreesOfFreedomTotal() public method

getFStatistic() public method

Returns the F statistic, which is compared against the F distribution CDF to determine if the regression is "significant" or not.
public getFStatistic ( ) : float
return float

getRSquared() public method

Calculates the coefficient of determination. i.e. how well the line of best fit describes the data.
public getRSquared ( ) : float
return float

getStandardError() public method

Calculates the standard error of the regression. This is the average distance of observed values from the regression line. It's conceptually similar to the standard deviation.
public getStandardError ( ) : float
return float

getStandardErrorCoefficients() public method

Calculates the standard error of each of the regression coefficients.

getTStatistics() public method

Calculates the t test values of each of the regression coefficients.
public getTStatistics ( ) : array
return array