Draw (or approximate) Poisson variable using other distributions

22 Views Asked by At

I'm experimenting with bootstrap resampling a large dataset, accessible via Trino SQL. One approach for resampling efficiently is drawing a variable from the Poisson distribution that gives how many times that row would be selected in a sampling with replacement.

Unfortunately, Trino doesn't provide a Poisson pdf function, only uniform (random()), normal and beta. The methods presented in Wikipedia for variate generation depend on while-loops, which are awkward to compute in SQL. Writing a custom function is possible, but is there a way to draw a Poisson variate using uniform, normal and/or beta distributions?

1

There are 1 best solutions below

2
On

If $U_1,U_2,\ldots$ form a sequence of independent uniform random variables in $[0,1]$, then the process $(N_t)_{t \ge 0}$ defined by $N_t = \max\{n \ge 0 : U_1 \ldots U_n > e^{-t}\} = \min\{n \ge 1 : U_1 \ldots U_n \le e^{-t}\}-1$ is a Poisson process. In particular, $N_t$ has distribution Poisson($t$).