question: PoissonNextSend not poisson distribution? #23347

issue Crypt-iQ opened this issue on October 24, 2021
  1. Crypt-iQ commented at 6:36 PM on October 24, 2021: contributor

    If this is a known quirk of Bitcoin's networking code, please feel free to close and I'm sorry for the spam.

    From wikipedia a poisson distribution has mean = λ and variance = λ (so std dev = sqrt(λ)). I ran PoissonNextSend 10000 times in a unit test and calculated the mean and std dev of the returned result. I received a mean of λ and a std dev of λ each time. So when passing in 30s, the mean was 30s and the std dev was 30s (and I did remember to take the square root here!). My calculations of the unscaled variable give a mean & std. dev of 1. I was wondering if this is intentional since the "textbook definition" means this is not a poisson distribution.

  2. sipa commented at 6:38 PM on October 24, 2021: member

    The time between events is indeed not Poisson distributed, but a Negative Exponential Distribution.

    The name comes from the fact that the resulting generated events mimick what is called a Poisson process. The number of events per time unit is however Poisson distributed.

  3. Crypt-iQ closed this on Oct 24, 2021

  4. jnewbery commented at 11:03 AM on December 14, 2021: member

    I have a branch here: https://github.com/jnewbery/bitcoin/tree/2021-12-rename-poisson that renames the Poisson* functions, expands the comments, and moves them to more appropriate translation units. Let me know if you think that's an improvement and I can open a PR.

  5. fanquake referenced this in commit 6d859cbd79 on Jan 23, 2022
  6. DrahtBot locked this on Dec 14, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-15 00:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me