Properties

$error

$error : bool

Indicator flag for a calculation error.

Type

bool

$bestFitType

$bestFitType : string

Algorithm type to use for best-fit.

Type

string

$valueCount

$valueCount : int

Number of entries in the sets of x- and y-value arrays.

Type

int

$xValues

$xValues : float[]

X-value dataseries of values.

Type

float[]

$yValues

$yValues : float[]

Y-value dataseries of values.

Type

float[]

$adjustToZero

$adjustToZero : bool

Flag indicating whether values should be adjusted to Y=0.

Type

bool

$yBestFitValues

$yBestFitValues : float[]

Y-value series of best-fit values.

Type

float[]

$goodnessOfFit

$goodnessOfFit

$stdevOfResiduals

$stdevOfResiduals

$covariance

$covariance

$correlation

$correlation

$SSRegression

$SSRegression

$SSResiduals

$SSResiduals

$DFResiduals

$DFResiduals

$f

$f

$slope

$slope

$slopeSE

$slopeSE

$intersect

$intersect

$intersectSE

$intersectSE

$xOffset

$xOffset

$yOffset

$yOffset

Methods

getError()

getError() : mixed

Returns

mixed —

getBestFitType()

getBestFitType() : mixed

Returns

mixed —

getValueOfYForX()

getValueOfYForX(float  $xValue) : bool

Return the Y-Value for a specified value of X.

Parameters

float $xValue

X-Value

Returns

bool —

Y-Value

getValueOfXForY()

getValueOfXForY(float  $yValue) : bool

Return the X-Value for a specified value of Y.

Parameters

float $yValue

Y-Value

Returns

bool —

X-Value

getXValues()

getXValues() : float[]

Return the original set of X-Values.

Returns

float[] —

X-Values

getEquation()

getEquation(int  $dp) : bool

Return the Equation of the best-fit line.

Parameters

int $dp

Number of places of decimal precision to display

Returns

bool —

getSlope()

getSlope(int  $dp) : float

Return the Slope of the line.

Parameters

int $dp

Number of places of decimal precision to display

Returns

float —

getSlopeSE()

getSlopeSE(int  $dp) : float

Return the standard error of the Slope.

Parameters

int $dp

Number of places of decimal precision to display

Returns

float —

getIntersect()

getIntersect(int  $dp) : float

Return the Value of X where it intersects Y = 0.

Parameters

int $dp

Number of places of decimal precision to display

Returns

float —

getIntersectSE()

getIntersectSE(int  $dp) : float

Return the standard error of the Intersect.

Parameters

int $dp

Number of places of decimal precision to display

Returns

float —

getGoodnessOfFit()

getGoodnessOfFit(int  $dp) : float

Return the goodness of fit for this regression.

Parameters

int $dp

Number of places of decimal precision to return

Returns

float —

getGoodnessOfFitPercent()

getGoodnessOfFitPercent(int  $dp) : float

Return the goodness of fit for this regression.

Parameters

int $dp

Number of places of decimal precision to return

Returns

float —

getStdevOfResiduals()

getStdevOfResiduals(int  $dp) : float

Return the standard deviation of the residuals for this regression.

Parameters

int $dp

Number of places of decimal precision to return

Returns

float —

getSSRegression()

getSSRegression(int  $dp) : float

Parameters

int $dp

Number of places of decimal precision to return

Returns

float —

getSSResiduals()

getSSResiduals(int  $dp) : float

Parameters

int $dp

Number of places of decimal precision to return

Returns

float —

getDFResiduals()

getDFResiduals(int  $dp) : float

Parameters

int $dp

Number of places of decimal precision to return

Returns

float —

getF()

getF(int  $dp) : float

Parameters

int $dp

Number of places of decimal precision to return

Returns

float —

getCovariance()

getCovariance(int  $dp) : float

Parameters

int $dp

Number of places of decimal precision to return

Returns

float —

getCorrelation()

getCorrelation(int  $dp) : float

Parameters

int $dp

Number of places of decimal precision to return

Returns

float —

getYBestFitValues()

getYBestFitValues() : float[]

Returns

float[] —

__construct()

__construct(float[]  $yValues, float[]  $xValues = [], bool  $const = true) : mixed

Define the regression.

Parameters

float[] $yValues

The set of Y-values for this regression

float[] $xValues

The set of X-values for this regression

bool $const

Returns

mixed —

calculateGoodnessOfFit()

calculateGoodnessOfFit(mixed  $sumX, mixed  $sumY, mixed  $sumX2, mixed  $sumY2, mixed  $sumXY, mixed  $meanX, mixed  $meanY, mixed  $const) : void

Parameters

mixed $sumX
mixed $sumY
mixed $sumX2
mixed $sumY2
mixed $sumXY
mixed $meanX
mixed $meanY
mixed $const

leastSquareFit()

leastSquareFit(float[]  $yValues, float[]  $xValues, bool  $const) : void

Parameters

float[] $yValues
float[] $xValues
bool $const