Example #1
0
 /**
  * Returns the moments of the distribution
  * 
  * @param string $moments Which moments to compute. m for mean, v for variance, s for skew, k for kurtosis.  Default 'mv'
  * @return type array A dictionary containing the first four moments of the distribution
  */
 public function stats($moments = 'mv')
 {
     return $this->calculator->getStats($moments, $this->k, $this->theta);
 }
Example #2
0
 /**
  * Returns a random float between $alpha and $alpha plus $beta
  * 
  * @param float $alpha The minimum parameter. Default 0.0
  * @param float $beta The maximum parameter. Default 1.0
  * @return float The random variate.
  */
 public function getRvs($alpha = 1, $beta = 1)
 {
     $x = $this->gamma->getRvs($alpha, 1);
     $y = $this->gamma->getRvs($beta, 1);
     return $x / ($x + $y);
 }