import PoissonDistribution from '../dist/poisson'; import Process from './_process'; /** * Poisson process: a counting process of independent arrivals at rate $\lambda$, using an exact * discrete-time sampler. * * By the independent-increments property, the number of arrivals in any interval of length * $\mathrm{d}t$ is exactly $\mathrm{Poisson}(\lambda \mathrm{d}t)$, independent of all other * intervals. The sampler draws that count directly * * $X_{t+\mathrm{d}t} = X_t + K, \quad K \sim \mathrm{Poisson}(\lambda\,\mathrm{d}t),$ * * with no step-size discretization error. * * @class Poisson * @memberof ran.process * @constructor */ export default class Poisson extends Process { p: { lambda: number; dt: number; }; x: number; x0: number; /** * @param {number} lambda Event rate (must be > 0). * @param {number} [dt=1] Time step (must be > 0). */ constructor(lambda: number, dt?: number); _next(): number; /** @inheritdoc */ mean(t: any): number; /** @inheritdoc */ variance(t: any): number; /** @inheritdoc */ pdf(x: any, t: any): number; /** @inheritdoc */ covariogram(s: any, t: any): number; /** @inheritdoc */ marginal(t: any): PoissonDistribution; /** * Estimates lambda from an observed path via the exact MLE: the total arrival count * (the path's net increase) divided by the total observed time, since increments are * i.i.d. Poisson(lambda*dt) by the independent-increments property _next() already * relies on. * * @method fit * @memberof ran.process.Poisson * @param {Array} path Array of observed states (as returned by path()). * @param {number} [dt=1] Time step between consecutive path observations (must be > 0). * @returns {Poisson} A new instance with estimated lambda. * @throws {Error} If path has fewer than 2 states, if dt is not > 0, if the path * decreases anywhere, or if the estimated lambda is not positive (no arrivals observed). */ static fit(path: any[], dt?: number): Poisson; }