You are here

private function PHPExcel_Logarithmic_Best_Fit::_logarithmic_regression in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/trend/logarithmicBestFitClass.php \PHPExcel_Logarithmic_Best_Fit::_logarithmic_regression()

* 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: * @param float[] $xValues The set of X-values for this regression * @param boolean $const

1 call to PHPExcel_Logarithmic_Best_Fit::_logarithmic_regression()
PHPExcel_Logarithmic_Best_Fit::__construct in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/trend/logarithmicBestFitClass.php
* Define the regression and calculate the goodness of fit for a set of X and Y data values * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/trend/logarithmicBestFitClass.php, line 93

Class

PHPExcel_Logarithmic_Best_Fit
PHPExcel_Logarithmic_Best_Fit

Code

private function _logarithmic_regression($yValues, $xValues, $const) {
  foreach ($xValues as &$value) {
    if ($value < 0.0) {
      $value = 0 - log(abs($value));
    }
    elseif ($value > 0.0) {
      $value = log($value);
    }
  }
  unset($value);
  $this
    ->_leastSquareFit($yValues, $xValues, $const);
}