ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Power_Best_Fit Class Reference
+ Inheritance diagram for PHPExcel_Power_Best_Fit:
+ Collaboration diagram for PHPExcel_Power_Best_Fit:

Public Member Functions

 getValueOfYForX ($xValue)
 Return the Y-Value for a specified value of X. More...
 
 getValueOfXForY ($yValue)
 Return the X-Value for a specified value of Y. More...
 
 getEquation ($dp=0)
 Return the Equation of the best-fit line. More...
 
 getIntersect ($dp=0)
 Return the Value of X where it intersects Y = 0. More...
 
 __construct ($yValues, $xValues=array(), $const=True)
 Define the regression and calculate the goodness of fit for a set of X and Y data values. More...
 
- Public Member Functions inherited from PHPExcel_Best_Fit
 getError ()
 
 getBestFitType ()
 
 getValueOfYForX ($xValue)
 Return the Y-Value for a specified value of X. More...
 
 getValueOfXForY ($yValue)
 Return the X-Value for a specified value of Y. More...
 
 getXValues ()
 Return the original set of X-Values. More...
 
 getEquation ($dp=0)
 Return the Equation of the best-fit line. More...
 
 getSlope ($dp=0)
 Return the Slope of the line. More...
 
 getSlopeSE ($dp=0)
 Return the standard error of the Slope. More...
 
 getIntersect ($dp=0)
 Return the Value of X where it intersects Y = 0. More...
 
 getIntersectSE ($dp=0)
 Return the standard error of the Intersect. More...
 
 getGoodnessOfFit ($dp=0)
 Return the goodness of fit for this regression. More...
 
 getGoodnessOfFitPercent ($dp=0)
 
 getStdevOfResiduals ($dp=0)
 Return the standard deviation of the residuals for this regression. More...
 
 getSSRegression ($dp=0)
 
 getSSResiduals ($dp=0)
 
 getDFResiduals ($dp=0)
 
 getF ($dp=0)
 
 getCovariance ($dp=0)
 
 getCorrelation ($dp=0)
 
 getYBestFitValues ()
 
 __construct ($yValues, $xValues=array(), $const=True)
 Define the regression. More...
 

Protected Attributes

 $_bestFitType = 'power'
 
- Protected Attributes inherited from PHPExcel_Best_Fit
 $_error = False
 
 $_bestFitType = 'undetermined'
 
 $_valueCount = 0
 
 $_xValues = array()
 
 $_yValues = array()
 
 $_adjustToZero = False
 
 $_yBestFitValues = array()
 
 $_goodnessOfFit = 1
 
 $_stdevOfResiduals = 0
 
 $_covariance = 0
 
 $_correlation = 0
 
 $_SSRegression = 0
 
 $_SSResiduals = 0
 
 $_DFResiduals = 0
 
 $_F = 0
 
 $_slope = 0
 
 $_slopeSE = 0
 
 $_intersect = 0
 
 $_intersectSE = 0
 
 $_Xoffset = 0
 
 $_Yoffset = 0
 

Private Member Functions

 _power_regression ($yValues, $xValues, $const)
 Execute the regression and calculate the goodness of fit for a set of X and Y data values. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PHPExcel_Best_Fit
 _calculateGoodnessOfFit ($sumX, $sumY, $sumX2, $sumY2, $sumXY, $meanX, $meanY, $const)
 
 _leastSquareFit ($yValues, $xValues, $const)
 

Detailed Description

Definition at line 39 of file powerBestFitClass.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Power_Best_Fit::__construct (   $yValues,
  $xValues = array(),
  $const = True 
)

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

Parameters
float[]$yValues The set of Y-values for this regression
float[]$xValues The set of X-values for this regression
boolean$const

Definition at line 136 of file powerBestFitClass.php.

References _power_regression().

136  {
137  if (parent::__construct($yValues, $xValues) !== False) {
138  $this->_power_regression($yValues, $xValues, $const);
139  }
140  } // function __construct()
_power_regression($yValues, $xValues, $const)
Execute the regression and calculate the goodness of fit for a set of X and Y data values...
+ Here is the call graph for this function:

Member Function Documentation

◆ _power_regression()

PHPExcel_Power_Best_Fit::_power_regression (   $yValues,
  $xValues,
  $const 
)
private

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

Parameters
float[]$yValues The set of Y-values for this regression
float[]$xValues The set of X-values for this regression
boolean$const

Definition at line 107 of file powerBestFitClass.php.

References PHPExcel_Best_Fit\_leastSquareFit().

Referenced by __construct().

107  {
108  foreach($xValues as &$value) {
109  if ($value < 0.0) {
110  $value = 0 - log(abs($value));
111  } elseif ($value > 0.0) {
112  $value = log($value);
113  }
114  }
115  unset($value);
116  foreach($yValues as &$value) {
117  if ($value < 0.0) {
118  $value = 0 - log(abs($value));
119  } elseif ($value > 0.0) {
120  $value = log($value);
121  }
122  }
123  unset($value);
124 
125  $this->_leastSquareFit($yValues, $xValues, $const);
126  } // function _power_regression()
_leastSquareFit($yValues, $xValues, $const)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEquation()

PHPExcel_Power_Best_Fit::getEquation (   $dp = 0)

Return the Equation of the best-fit line.

Parameters
int$dpNumber of places of decimal precision to display
Returns
string

Definition at line 78 of file powerBestFitClass.php.

References getIntersect(), and PHPExcel_Best_Fit\getSlope().

78  {
79  $slope = $this->getSlope($dp);
80  $intersect = $this->getIntersect($dp);
81 
82  return 'Y = '.$intersect.' * X^'.$slope;
83  } // function getEquation()
getIntersect($dp=0)
Return the Value of X where it intersects Y = 0.
getSlope($dp=0)
Return the Slope of the line.
+ Here is the call graph for this function:

◆ getIntersect()

PHPExcel_Power_Best_Fit::getIntersect (   $dp = 0)

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

Parameters
int$dpNumber of places of decimal precision to display
Returns
string

Definition at line 92 of file powerBestFitClass.php.

Referenced by getEquation(), getValueOfXForY(), and getValueOfYForX().

92  {
93  if ($dp != 0) {
94  return round(exp($this->_intersect),$dp);
95  }
96  return exp($this->_intersect);
97  } // function getIntersect()
+ Here is the caller graph for this function:

◆ getValueOfXForY()

PHPExcel_Power_Best_Fit::getValueOfXForY (   $yValue)

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

Parameters
float$yValueY-Value
Returns
float X-Value

Definition at line 67 of file powerBestFitClass.php.

References getIntersect(), and PHPExcel_Best_Fit\getSlope().

67  {
68  return pow((($yValue + $this->_Yoffset) / $this->getIntersect()),(1 / $this->getSlope()));
69  } // function getValueOfXForY()
getIntersect($dp=0)
Return the Value of X where it intersects Y = 0.
getSlope($dp=0)
Return the Slope of the line.
+ Here is the call graph for this function:

◆ getValueOfYForX()

PHPExcel_Power_Best_Fit::getValueOfYForX (   $xValue)

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

Parameters
float$xValueX-Value
Returns
float Y-Value

Definition at line 56 of file powerBestFitClass.php.

References getIntersect(), and PHPExcel_Best_Fit\getSlope().

56  {
57  return $this->getIntersect() * pow(($xValue - $this->_Xoffset),$this->getSlope());
58  } // function getValueOfYForX()
getIntersect($dp=0)
Return the Value of X where it intersects Y = 0.
getSlope($dp=0)
Return the Slope of the line.
+ Here is the call graph for this function:

Field Documentation

◆ $_bestFitType

PHPExcel_Power_Best_Fit::$_bestFitType = 'power'
protected

Definition at line 47 of file powerBestFitClass.php.


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