コード例 #1
0
 /**
  * @test
  */
 public function getVariance()
 {
     $values = $this->getValuesFromData($this->listFilteredByOneSubgroup(true));
     $this->assertEquals(10000, $this->statistic->sampleVariance($values));
     $values->rewind();
     $this->assertEquals(6666.67, $this->statistic->populationVariance($values));
 }
コード例 #2
0
 function testVariance(Statistic $statistic){
     $values = new ArrayObject(array(3,5,2,1,3,4,6,9,3));
     assertEquals($statistic->populationVariance($values->getIterator()), 5.11);
     assertEquals($statistic->sampleVariance($values->getIterator()), 5.75);
 }