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