Properties

$error

$error : boolean

Indicator flag for a calculation error.

Type

boolean

$bestFitType

$bestFitType : string

Algorithm type to use for best-fit (Name of this Trend class).

Type

string

$valueCount

$valueCount : integer

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

Type

integer

$xValues

$xValues : array<mixed,float>

X-value dataseries of values.

Type

array<mixed,float>

$yValues

$yValues : array<mixed,float>

Y-value dataseries of values.

Type

array<mixed,float>

$adjustToZero

$adjustToZero : boolean

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

Type

boolean

$yBestFitValues

$yBestFitValues : array<mixed,float>

Y-value series of best-fit values.

Type

array<mixed,float>

$goodnessOfFit

$goodnessOfFit : 

Type

$stdevOfResiduals

$stdevOfResiduals : 

Type

$covariance

$covariance : 

Type

$correlation

$correlation : 

Type

$SSRegression

$SSRegression : 

Type

$SSResiduals

$SSResiduals : 

Type

$DFResiduals

$DFResiduals : 

Type

$f

$f : 

Type

$slope

$slope : 

Type

$slopeSE

$slopeSE : 

Type

$intersect

$intersect : 

Type

$intersectSE

$intersectSE : 

Type

$xOffset

$xOffset : 

Type

$yOffset

$yOffset : 

Type

Methods

getError()

getError() 

getBestFitType()

getBestFitType() 

getValueOfYForX()

getValueOfYForX(float  $xValue) : float

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

Parameters

float $xValue

X-Value

Returns

float —

Y-Value

getValueOfXForY()

getValueOfXForY(float  $yValue) : float

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

Parameters

float $yValue

Y-Value

Returns

float —

X-Value

getXValues()

getXValues() : array<mixed,float>

Return the original set of X-Values.

Returns

array<mixed,float> —

X-Values

getEquation()

getEquation(integer  $dp) : string

Return the Equation of the best-fit line.

Parameters

integer $dp

Number of places of decimal precision to display

Returns

string

getSlope()

getSlope(integer  $dp) : float

Return the Slope of the line.

Parameters

integer $dp

Number of places of decimal precision to display

Returns

float

getSlopeSE()

getSlopeSE(integer  $dp) : float

Return the standard error of the Slope.

Parameters

integer $dp

Number of places of decimal precision to display

Returns

float

getIntersect()

getIntersect(integer  $dp) : float

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

Parameters

integer $dp

Number of places of decimal precision to display

Returns

float

getIntersectSE()

getIntersectSE(integer  $dp) : float

Return the standard error of the Intersect.

Parameters

integer $dp

Number of places of decimal precision to display

Returns

float

getGoodnessOfFit()

getGoodnessOfFit(integer  $dp) : float

Return the goodness of fit for this regression.

Parameters

integer $dp

Number of places of decimal precision to return

Returns

float

getGoodnessOfFitPercent()

getGoodnessOfFitPercent(integer  $dp) : float

Return the goodness of fit for this regression.

Parameters

integer $dp

Number of places of decimal precision to return

Returns

float

getStdevOfResiduals()

getStdevOfResiduals(integer  $dp) : float

Return the standard deviation of the residuals for this regression.

Parameters

integer $dp

Number of places of decimal precision to return

Returns

float

getSSRegression()

getSSRegression(integer  $dp) : float

Parameters

integer $dp

Number of places of decimal precision to return

Returns

float

getSSResiduals()

getSSResiduals(integer  $dp) : float

Parameters

integer $dp

Number of places of decimal precision to return

Returns

float

getDFResiduals()

getDFResiduals(integer  $dp) : float

Parameters

integer $dp

Number of places of decimal precision to return

Returns

float

getF()

getF(integer  $dp) : float

Parameters

integer $dp

Number of places of decimal precision to return

Returns

float

getCovariance()

getCovariance(integer  $dp) : float

Parameters

integer $dp

Number of places of decimal precision to return

Returns

float

getCorrelation()

getCorrelation(integer  $dp) : float

Parameters

integer $dp

Number of places of decimal precision to return

Returns

float

getYBestFitValues()

getYBestFitValues() : array<mixed,float>

Returns

array<mixed,float>

__construct()

__construct(array<mixed,float>  $yValues, array<mixed,float>  $xValues = array(), boolean  $const = true) 

Define the regression and calculate the goodness of fit for a set of X and Y data values.

Parameters

array<mixed,float> $yValues

The set of Y-values for this regression

array<mixed,float> $xValues

The set of X-values for this regression

boolean $const

calculateGoodnessOfFit()

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

Parameters

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

leastSquareFit()

leastSquareFit(array<mixed,float>  $yValues, array<mixed,float>  $xValues, boolean  $const) 

Parameters

array<mixed,float> $yValues
array<mixed,float> $xValues
boolean $const

powerRegression()

powerRegression(array<mixed,float>  $yValues, array<mixed,float>  $xValues, boolean  $const) 

Execute the regression and calculate the goodness of fit for a set of X and Y data values.

Parameters

array<mixed,float> $yValues

The set of Y-values for this regression

array<mixed,float> $xValues

The set of X-values for this regression

boolean $const