ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Logarithmic_Best_Fit Class Reference
+ Inheritance diagram for PHPExcel_Logarithmic_Best_Fit:
+ Collaboration diagram for PHPExcel_Logarithmic_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...
 
 __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 = 'logarithmic'
 
- 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

 _logarithmic_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 logarithmicBestFitClass.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Logarithmic_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 114 of file logarithmicBestFitClass.php.

References _logarithmic_regression().

114  {
115  if (parent::__construct($yValues, $xValues) !== False) {
116  $this->_logarithmic_regression($yValues, $xValues, $const);
117  }
118  } // function __construct()
_logarithmic_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

◆ _logarithmic_regression()

PHPExcel_Logarithmic_Best_Fit::_logarithmic_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 93 of file logarithmicBestFitClass.php.

References PHPExcel_Best_Fit\_leastSquareFit().

Referenced by __construct().

93  {
94  foreach($xValues as &$value) {
95  if ($value < 0.0) {
96  $value = 0 - log(abs($value));
97  } elseif ($value > 0.0) {
98  $value = log($value);
99  }
100  }
101  unset($value);
102 
103  $this->_leastSquareFit($yValues, $xValues, $const);
104  } // function _logarithmic_regression()
_leastSquareFit($yValues, $xValues, $const)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEquation()

PHPExcel_Logarithmic_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 logarithmicBestFitClass.php.

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

78  {
79  $slope = $this->getSlope($dp);
80  $intersect = $this->getIntersect($dp);
81 
82  return 'Y = '.$intersect.' + '.$slope.' * log(X)';
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:

◆ getValueOfXForY()

PHPExcel_Logarithmic_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 logarithmicBestFitClass.php.

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

67  {
68  return exp(($yValue - $this->getIntersect()) / $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_Logarithmic_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 logarithmicBestFitClass.php.

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

56  {
57  return $this->getIntersect() + $this->getSlope() * log($xValue - $this->_Xoffset);
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_Logarithmic_Best_Fit::$_bestFitType = 'logarithmic'
protected

Definition at line 47 of file logarithmicBestFitClass.php.


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