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. mzumsande cross-referenced this on Dec 13, 2021 from issue test: Refactor addr_relay.py addr generation, increase mocktime by mzumsande
  5. 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.

  6. mzumsande cross-referenced this on Jan 10, 2022 from issue Rename and move PoissonNextSend functions by mzumsande
  7. fanquake referenced this in commit 6d859cbd79 on Jan 23, 2022
  8. bitcoin 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-05-19 06:53 UTC