pub struct PoissonProcess {
pub lambda: f64,
}Expand description
Poisson process simulator and summary statistics.
A Poisson process N(t) with rate λ: inter-arrival times are Exp(λ).
Fields§
§lambda: f64Arrival rate λ > 0.
Implementations§
Source§impl PoissonProcess
impl PoissonProcess
Sourcepub fn expected_count(&self, t: f64) -> f64
pub fn expected_count(&self, t: f64) -> f64
Expected number of arrivals in [0, t]: E[N(t)] = λ t.
Sourcepub fn variance_count(&self, t: f64) -> f64
pub fn variance_count(&self, t: f64) -> f64
Variance of N(t): Var[N(t)] = λ t.
Sourcepub fn simulate_arrivals(&self, t_max: f64, lcg: &mut Lcg) -> Vec<f64>
pub fn simulate_arrivals(&self, t_max: f64, lcg: &mut Lcg) -> Vec<f64>
Generates inter-arrival times up to total time t_max using an LCG.
Returns the vector of arrival times within [0, t_max].
Sourcepub fn compound_expected(&self, t: f64, jump_mean: f64) -> f64
pub fn compound_expected(&self, t: f64, jump_mean: f64) -> f64
Compound Poisson process: E[Σ Y_i] = λ t E[Y] for i.i.d. jumps Y.
Auto Trait Implementations§
impl Freeze for PoissonProcess
impl RefUnwindSafe for PoissonProcess
impl Send for PoissonProcess
impl Sync for PoissonProcess
impl Unpin for PoissonProcess
impl UnsafeUnpin for PoissonProcess
impl UnwindSafe for PoissonProcess
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more