Description Usage Arguments Details Value See Also Examples
Generate random variates from the Polya-Gamma distribution on a GPU.
1 2 |
num |
the number of random variates to simulate. |
n |
shape parameter, a positive integer. |
z |
parameter associated with tilting. |
batch |
the number of samples created by each GPU thread |
local |
the number of threads in a thread-block on a GPU |
staticseed |
parameter to determine whether to use a static seed or not. |
seed |
the value of the static seed, if used. |
float |
parameter to determine whether to use single-precision floating point or double-precision floating point. |
ptr |
an external pointer to the C structure with the GPU helper variables. |
device |
if no external pointer is provided to function, we can provide the ID of the device to use. |
A random variable X with distribution PG(n,z) is distributed like
X \sim ∑_{k=1}^∞ G(n,1) / ( 2 π^2 (k-1/2)^2 + z^2/2).
The density for X may be derived by exponentially tilting the PG(n,0) density:
p(x|n,z) \propto \exp(-x z^2/2) p(x|n,0).
The GPU implementation is derived from the CPU implementation rpg.devroye from package BayesLogit.
This function returns num
Polya-Gamma samples.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.