MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / poissonQuantile

Function poissonQuantile

src/compute-engine/numerics/distributions.ts:75–85  ·  view source on GitHub ↗
(
  lambda: number,
  prob: number,
  deadline?: number
)

Source from the content-addressed store, hash-verified

73
74/** Quantile of Poisson(λ) at probability `prob` (a non-negative integer). */
75export function poissonQuantile(
76 lambda: number,
77 prob: number,
78 deadline?: number
79): number {
80 const mean = lambda;
81 const stddev = Math.sqrt(lambda);
82 // CDF(k) = P(X ≤ k) = Q(k+1, λ).
83 const cdf = (k: number): number => (k < 0 ? 0 : gammaQ(k + 1, lambda));
84 return discreteQuantile(cdf, prob, mean, stddev, 0, Infinity, deadline);
85}

Callers 1

distributionQuantileFunction · 0.90

Calls 2

discreteQuantileFunction · 0.85
sqrtMethod · 0.65

Tested by

no test coverage detected