suggestion: add reference table of nb shares probabilities to the share calculator #11
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: P2Pool/consensus#11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I added a section on the distribution of the number of blocks/shares for a given cumulative effort to the pastebin I shared previously (https://pastebin.com/EXXKm50D, copy-pasted below for future reference). In it I derive the table of probabilities of the number of shares for a given cumulative effort. This is nothing but the Poisson distribution. This could be of interest to add to the observer's share calculator. The cumulative effort can of course be written back in terms of elapsed mining time
which is probably more meaningful to someone using the calculator since the observer doesn't report the cumulative effort, only the effort for individual shares/blocks.
Here's the reference table together with the html code (nbshares_distribution.html). This table is fixed, the only thing that varies is the time as a function of the hash rate and difficulty.
This looks pretty good. I will probably implement this, maybe the colors as well, although it won't match p2pool.io behavior
@orzo Within this
Is Gamma regularized or not? What is the second parameter to the denominator, 0?
Got a partial implementation without the Bulk working at least.
It's the un-regularized incomplete gamma function
Gamma(s, x)
. The ratios on the other hand give you the regularized incomplete gamma function.A more straightforward way to get the same answer is to do the sum explicitly, i.e.
You just have to mind the factorial because 13! > 2^32 so you want to sum over
exp(log(k * log(f) - f - lngamma(k+1))
A different way to look at the bulk is to look at the quantiles by lining up the cumulative probabilities
and check which entries are between, say, 0.25 and 0.75, or 0.1 and 0.9. Those constitute the rough ~50% or ~80% bulk of the distribution. You can then color them, and do the exact sum of the entries (pre cumsum()) to find the exact probability represented by this version of the bulk. It's never going to be exactly 50% or 80% because the Poisson distribution isn't continuous.
So you can decide that the bulk is everything within
d
standard deviations of the mean (first way), or the middle X% percent bounded by cumulative probabilities(1 - X/100)/2
and1 - (1 - X/100)/2
(second way). Both are valid and more or less equivalent, and in the screenshot you can see that the first way (withd=1
) also bounds roughly ~80% of the distribution.