mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-13 10:38:40 +00:00
Fix for spacing
This commit is contained in:
parent
ba1b82f559
commit
77e662bd0b
|
|
@ -122,7 +122,7 @@ class ExponentialSmoothing
|
|||
}
|
||||
|
||||
$sum = 0;
|
||||
for($i = 0; $i < $length; $i++) {
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$sum += pow($damping, $i);
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ class ExponentialSmoothing
|
|||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
for ($i = 1; $i < $dataLength; $i++) {
|
||||
$level[$i] = $alpha * ($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) + (1 - $alpha) * $level[$i-1];
|
||||
|
||||
$tempForecast[$i] = $level[$i];
|
||||
|
|
@ -172,7 +172,7 @@ class ExponentialSmoothing
|
|||
$forecast = [];
|
||||
$seasonal = [];
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i-1] - $level[0];
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ class ExponentialSmoothing
|
|||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
for ($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $seasonal[$i]) + (1 - $alpha) * $level[$i-1];
|
||||
|
|
@ -223,7 +223,7 @@ class ExponentialSmoothing
|
|||
$forecast = [];
|
||||
$seasonal = [];
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i] / $level[0];
|
||||
}
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ class ExponentialSmoothing
|
|||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
for ($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $seasonal[$i]) + (1 - $alpha) * $level[$i-1];
|
||||
|
|
@ -282,7 +282,7 @@ class ExponentialSmoothing
|
|||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
for ($i = 1; $i < $dataLength; $i++) {
|
||||
$level[$i] = $alpha * ($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) + (1 - $alpha) * ($level[$i-1] + $damping * $trend[$i-1]);
|
||||
$trend[$i] = $beta * ($level[$i] - $level[$i-1]) + (1 - $beta) * $damping * $trend[$i-1];
|
||||
|
||||
|
|
@ -320,13 +320,13 @@ class ExponentialSmoothing
|
|||
$seasonal = [];
|
||||
|
||||
$sum = 0;
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$sum += ($this->data[$cycle] - $this->data[$i]) / $cycle;
|
||||
}
|
||||
|
||||
$trend[0] *= $sum;
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i-1] - $level[0];
|
||||
}
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ class ExponentialSmoothing
|
|||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
for ($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $seasonal[$i]) + (1 - $alpha) * ($level[$i-1] + $damping * $trend[$i-1]);
|
||||
|
|
@ -387,13 +387,13 @@ class ExponentialSmoothing
|
|||
$gamma_ = $gamma * (1 - $alpha);
|
||||
|
||||
$sum = 0;
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$sum += ($this->data[$cycle] - $this->data[$i]) / $cycle;
|
||||
}
|
||||
|
||||
$trend[0] *= $sum;
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i] / $level[0];
|
||||
}
|
||||
|
||||
|
|
@ -409,7 +409,7 @@ class ExponentialSmoothing
|
|||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
for ($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $seasonal[$i]) + (1 - $alpha) * ($level[$i-1] + $damping * $trend[$i-1]);
|
||||
|
|
@ -459,7 +459,7 @@ class ExponentialSmoothing
|
|||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
for ($i = 1; $i < $dataLength; $i++) {
|
||||
$level[$i] = $alpha * ($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) + (1 - $alpha) * $level[$i-1] * pow($trend[$i-1], $damping);
|
||||
$trend[$i] = $beta * ($level[$i] / $level[$i-1]) + (1 - $beta) * pow($trend[$i-1], $damping);
|
||||
|
||||
|
|
@ -496,13 +496,13 @@ class ExponentialSmoothing
|
|||
$seasonal = [];
|
||||
|
||||
$sum = 0;
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$sum += ($this->data[$cycle] - $this->data[$i]) / $cycle;
|
||||
}
|
||||
|
||||
$trend[0] *= $sum;
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i-1] - $level[0];
|
||||
}
|
||||
|
||||
|
|
@ -518,7 +518,7 @@ class ExponentialSmoothing
|
|||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
for ($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $seasonal[$i]) + (1 - $alpha) * $level[$i-1] * pow($trend[$i-1], $damping);
|
||||
|
|
@ -562,13 +562,13 @@ class ExponentialSmoothing
|
|||
$seasonal = [];
|
||||
|
||||
$sum = 0;
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$sum += ($this->data[$cycle] - $this->data[$i]) / $cycle;
|
||||
}
|
||||
|
||||
$trend[0] *= $sum;
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
for ($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i] / $level[0];
|
||||
}
|
||||
|
||||
|
|
@ -584,7 +584,7 @@ class ExponentialSmoothing
|
|||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
for ($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $seasonal[$i]) + (1 - $alpha) * $level[$i-1] * pow($trend[$i-1], $damping);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class MarketShareEstimation {
|
|||
public static function getRankFromMarketShare(int $participants, float $marketShare, float $modifier = 1.0) : int
|
||||
{
|
||||
$sum = 0.0;
|
||||
for($i = 0; $i < $participants; $i++) {
|
||||
for ($i = 0; $i < $participants; $i++) {
|
||||
$sum += 1 / pow($i+1, $modifier);
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ class MarketShareEstimation {
|
|||
public static function getMarketShareFromRank(int $participants, int $rank, float $modifier = 1.0) : float
|
||||
{
|
||||
$sum = 0.0;
|
||||
for($i = 0; $i < $participants; $i++) {
|
||||
for ($i = 0; $i < $participants; $i++) {
|
||||
$sum += 1 / pow($i+1, $modifier);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ class CholeskyDecomposition
|
|||
$this->L = $M->toArray();
|
||||
$this->m = $M->getM();
|
||||
|
||||
for($i = 0; $i < $this->m; ++$i) {
|
||||
for($j = $i; $j < $this->m; ++$j) {
|
||||
for($sum = $this->L[$i][$j], $k = $i - 1; $k >= 0; --$k) {
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
for ($j = $i; $j < $this->m; ++$j) {
|
||||
for ($sum = $this->L[$i][$j], $k = $i - 1; $k >= 0; --$k) {
|
||||
$sum -= $this->L[$i][$k] * $this->L[$j][$k];
|
||||
}
|
||||
if ($i == $j) {
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
$mDim = count($b);
|
||||
$matrix = $this->matrix;
|
||||
|
||||
for($col = 0; $col < $mDim; $col++) {
|
||||
for ($col = 0; $col < $mDim; $col++) {
|
||||
$j = $col;
|
||||
$max = $matrix[$j][$j];
|
||||
|
||||
|
|
|
|||
|
|
@ -281,20 +281,20 @@ class SmartDateTime extends \DateTime
|
|||
$daysPreviousMonth = $previousMonth->getDaysOfMonth();
|
||||
|
||||
// add difference to $weekStartsWith counting backwards from days of previous month (reorder so that lowest value first)
|
||||
for($i = $daysPreviousMonth - $diffToWeekStart; $i < $daysPreviousMonth; $i++) {
|
||||
for ($i = $daysPreviousMonth - $diffToWeekStart; $i < $daysPreviousMonth; $i++) {
|
||||
$days[] = new \DateTime($previousMonth->format('Y') . '-' . $previousMonth->format('m') . '-' . ($i+1));
|
||||
}
|
||||
|
||||
// add normal count of current days
|
||||
$daysMonth = $this->getDaysOfMonth();
|
||||
for($i = 1; $i <= $daysMonth; $i++) {
|
||||
for ($i = 1; $i <= $daysMonth; $i++) {
|
||||
$days[] = new \DateTime($this->format('Y') . '-' . $this->format('m') . '-' . ($i));
|
||||
}
|
||||
|
||||
// add remaining days to next month (7*6 - difference+count of current month)
|
||||
$remainingDays = 42 - $diffToWeekStart - $daysMonth;
|
||||
$nextMonth = $this->createModify(0, 1);
|
||||
for($i = 1; $i <= $remainingDays; $i++) {
|
||||
for ($i = 1; $i <= $remainingDays; $i++) {
|
||||
$days[] = new \DateTime($nextMonth->format('Y') . '-' . $nextMonth->format('m') . '-' . ($i));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class Tree extends Graph
|
|||
{
|
||||
$depth = $this->getMaxDepth();
|
||||
|
||||
for($i = 1; $i < $depth; $i++) {
|
||||
for ($i = 1; $i < $depth; $i++) {
|
||||
$nodes = $this->getLevel($i);
|
||||
callback($nodes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ class StringUtils
|
|||
$l = mb_strlen($input, 'UTF-8');
|
||||
$unique = [];
|
||||
|
||||
for($i = 0; $i < $l; $i++) {
|
||||
for ($i = 0; $i < $l; $i++) {
|
||||
$char = mb_substr($input, $i, 1, 'UTF-8');
|
||||
|
||||
if (!array_key_exists($char, $unique)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user