public function variance()
    {
        if ($this->n === 0) {
            throw new RuntimeException('Variance is not defined for vectors'
            . ' with less than 1 element.');
        }

        $ssd = $this->subtract($this->mean())
            ->square()
            ->sum();

        return $ssd / $this->n;
    }
public function variance()
    {
        if ($this->n === 0) {
            throw new RuntimeException('Variance is not defined for vectors'
            . ' with less than 1 element.');
        }

        $ssd = $this->subtract($this->mean())
            ->square()
            ->sum();

        return $ssd / $this->n;
    }
public function variance ( ) { if ( $ this -> n === 0 ) { throw new RuntimeException ( 'Variance is not defined for vectors' . ' with less than 1 element.' ) ; } $ ssd = $ this -> subtract ( $ this -> mean ( ) ) -> square ( ) -> sum ( ) ; return $ ssd / $ this -> n ; }
Return the variance of the vector.

@return int|float
Return the variance of the vector .