MathPHP\Statistics\Regression\LinearThroughPoint::calculate PHP Метод

calculate() публичный Метод

Calculates the regression parameters.
public calculate ( )
    public function calculate()
    {
        $v = $this->v;
        $w = $this->w;
        $x’ = Single::subtract($this->xs, $v);
        $y’ = Single::subtract($this->ys, $w);
        $parameters = $this->leastSquares($y’, $x’, 1, 0)->getColumn(0);
        $this->m = $parameters[0];
        $this->b = $this->w - $this->m * $this->v;
        $this->parameters = [$this->b, $this->m];
    }
LinearThroughPoint