/** * 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->lambda); }
/** * Returns a random float between $lambda and $lambda plus $k * * @param float $lambda The scale parameter. Default 1.0 * @param float $k The shape parameter. Default 1.0 * @return float The random variate. */ public function getRvs($lambda = 1, $k = 1) { $e = $this->exp->getRvs(1); return $e == 0 ? 0 : $lambda * pow($e, 1 / $k); }