ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Exponential_Best_Fit Class Reference
+ Inheritance diagram for PHPExcel_Exponential_Best_Fit:
+ Collaboration diagram for PHPExcel_Exponential_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...
 
 getSlope ($dp=0)
 Return the Slope of the 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 = 'exponential'
 
- 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

 _exponential_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 exponentialBestFitClass.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Exponential_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 142 of file exponentialBestFitClass.php.

References _exponential_regression().

142  {
143  if (parent::__construct($yValues, $xValues) !== False) {
144  $this->_exponential_regression($yValues, $xValues, $const);
145  }
146  } // function __construct()
_exponential_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

◆ _exponential_regression()

PHPExcel_Exponential_Best_Fit::_exponential_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 121 of file exponentialBestFitClass.php.

References PHPExcel_Best_Fit\_leastSquareFit().

Referenced by __construct().

121  {
122  foreach($yValues as &$value) {
123  if ($value < 0.0) {
124  $value = 0 - log(abs($value));
125  } elseif ($value > 0.0) {
126  $value = log($value);
127  }
128  }
129  unset($value);
130 
131  $this->_leastSquareFit($yValues, $xValues, $const);
132  } // function _exponential_regression()
_leastSquareFit($yValues, $xValues, $const)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEquation()

PHPExcel_Exponential_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 exponentialBestFitClass.php.

References getIntersect(), and getSlope().

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

◆ getIntersect()

PHPExcel_Exponential_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 106 of file exponentialBestFitClass.php.

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

106  {
107  if ($dp != 0) {
108  return round(exp($this->_intersect),$dp);
109  }
110  return exp($this->_intersect);
111  } // function getIntersect()
+ Here is the caller graph for this function:

◆ getSlope()

PHPExcel_Exponential_Best_Fit::getSlope (   $dp = 0)

Return the Slope of the line.

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

Definition at line 92 of file exponentialBestFitClass.php.

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

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

◆ getValueOfXForY()

PHPExcel_Exponential_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 exponentialBestFitClass.php.

References getIntersect(), and getSlope().

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

◆ getValueOfYForX()

PHPExcel_Exponential_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 exponentialBestFitClass.php.

References getIntersect(), and getSlope().

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

Field Documentation

◆ $_bestFitType

PHPExcel_Exponential_Best_Fit::$_bestFitType = 'exponential'
protected

Definition at line 47 of file exponentialBestFitClass.php.


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