Example #1
0
 /**
  * Returns a random float
  * 
  * @return float The random variate.
  */
 public function rvs()
 {
     return $this->calculator->getRvs($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);
 }