reg = LevelLevelRegression::getRegression($x, $y); } public function testRegression() : void { self::assertEqualsWithDelta(['b0' => 3, 'b1' => 4], $this->reg, 0.2); } public function testSlope() : void { self::assertEquals(4, LevelLevelRegression::getSlope($this->reg['b1'], 0, 0)); } public function testElasticity() : void { self::assertEqualsWithDelta(0.7273, LevelLevelRegression::getElasticity($this->reg['b1'], 11, 2), 0.01); } public function testInvalidDimension() : void { self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); $x = [1,2, 3]; $y = [1,2, 3, 4]; LevelLevelRegression::getRegression($x, $y); } }