Struct probability::prelude::Gamma
[−]
[src]
pub struct Gamma { // some fields omitted }
A gamma distribution.
Methods
impl Gamma
[src]
fn new(k: f64, theta: f64) -> Gamma
Create a gamma distribution with shape parameter k
and scale parameter
theta
.
It should hold that k > 0
and theta > 0
.
fn k(&self) -> f64
Return the shape parameter.
fn theta(&self) -> f64
Return the scale parameter.
Trait Implementations
impl Copy for Gamma
[src]
impl Clone for Gamma
[src]
fn clone(&self) -> Gamma
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Distribution for Gamma
[src]
type Value = f64
The type of outcomes.
fn cdf(&self, x: f64) -> f64
Compute the distribution function. Read more
impl Sample for Gamma
[src]
fn sample<S>(&self, source: &mut S) -> f64 where S: Source
Draw a sample.
References
- G. Marsaglia and W. W. Tsang, “A simple method for generating gamma variables,” ACM Transactions on Mathematical Software, vol. 26, no. 3, pp. 363–372, September 2000.