Exemplo n.º 1
0
 /**
  * @test
  */
 public function getStandarDeviation()
 {
     $values = $this->getValuesFromData($this->listFilteredByOneSubgroup(true));
     $this->assertEquals(100, $this->statistic->sampleStandardDeviation($values));
     $values->rewind();
     $this->assertEquals(81.65000000000001, $this->statistic->populationStandardDeviation($values));
 }
Exemplo n.º 2
0
 function testStandardDeviation(Statistic $statistic){
     $values = new ArrayObject(array(3,5,2,1,3,4,6,9,3));
     assertEquals($statistic->populationStandardDeviation($values->getIterator()), 2.26);
     assertEquals($statistic->sampleStandardDeviation($values->getIterator()), 2.398);
 }
 public function calculateSampleStandardDeviation($group)
 {
     $values = $this->datacenterRepository->getValuesFromAGroup($group);
     $standarDeviation = $this->statistic->sampleStandardDeviation($values);
     return $this->jsonResponse->response(true, null)->addValue("value", $standarDeviation)->withoutHeader()->serialize();
 }
 private function standardDeviation($values)
 {
     $this->writeValue($this->statistic->sampleStandardDeviation($values));
 }