reg = PolynomialRegression::getRegression($x, $y); } /** * @testdox The regression parameters are calculated correctly * @group framework */ public function testRegression() : void { self::assertEqualsWithDelta(['a' => 1, 'b' => 2, 'c' => 3], $this->reg, 0.2); } /** * @testdox Different dimension sizes for x and y coordinates throw a InvalidDimensionException * @group framework */ public function testInvalidDimension() : void { self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); $x = [1,2, 3]; $y = [1,2, 3, 4]; PolynomialRegression::getRegression($x, $y); } }