dirwin.hall {unifed} | R Documentation |
Irwin-Hall density
dirwin.hall(x, n, log = FALSE)
x |
A number between 0 and |
n |
Number of uniform distributions in the unit interval to sum. |
log |
If it evaluates to |
Gives the density of the Irwin-Hall distribution. It is
the density of the sum of n
uniform distributions on the
interval (0,1).
1 __ |_y_| k / n \ n - 1 h(y;n) = --------- \ ( - 1) | | (y - k) (n - 1)! /__ k = 0 \ k /
where x \in [0,1] and n is a positive integer.
This function is not numerically stable. The examples have some cases of this.
dirwin.hall(2,5) # Numerically unstable example # Run the following one after the other # See how it goes from positive to negative (which means overflowing ) dirwin.hall(35,50) dirwin.hall(36,50) dirwin.hall(37,50) dirwin.hall(38,50)