MathPHP\Statistics\Regression\LOESS::__construct PHP Метод

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

public __construct ( array $points, number , integer )
$points array [ [x, y], [x, y], ... ]
number Smoothness parameter (bandwidth) Determines how much of the data is used to fit each local polynomial ((λ + 1) / n, 1]
integer Order of the polynomial to fit
    public function __construct($points, $α, int $λ)
    {
        $this->α = $α;
        $this->λ = $λ;
        parent::__construct($points);
        // α ∈ ((λ + 1) / n, 1]
        if ($α <= ($λ + 1) / $this->n || $α > 1) {
            throw new Exception\OutOfBoundsException('Smoothness parameter α must be between ' . ($λ + 1) / $this->n . " and 1; given {$α}");
        }
        // Number of points considered in the local regression
        $this->number_of_points = min(ceil($this->α * $this->n), $this->n);
    }