Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

jsoares/rusty-skellam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

6 Commits

Repository files navigation

rusty-skellam

Trivial Rust implementation of the PMF for the Skellam Distribution.

Its precision is limited by the underlying scilib Bessel function.

Usage

/// Calculate the probability mass function (PMF) of a Skellam distribution.
///
/// The Skellam distribution is the probability distribution of the difference
/// of two independent Poisson random variables.
///
/// # Arguments
///
/// * `k` - The difference of two Poisson random variables.
/// * `mu1` - The expected value of the first Poisson distribution.
/// * `mu2` - The expected value of the second Poisson distribution.
///
/// # Returns
///
/// * A `f64` representing the PMF of the Skellam distribution at `k`.
///
pub fn skellam_pmf(k: i32, mu1: f64, mu2: f64) -> f64 

Example

let k: i32 = 2;
let mu1: f64 = 1.0;
let mu2: f64 = 1.0;
skellam_pmf(k, mu1, mu2)
// 0.09324018489817358

About

Trivial Rust implementation of the Skellam PMF

Resources

License

Stars

Watchers

Forks

Languages

AltStyle によって変換されたページ (->オリジナル) /