tulpa_rpg: Draw Polya-Gamma random variates

View source: R/fit_gibbs.R

tulpa_rpgR Documentation

Draw Polya-Gamma random variates

Description

Vectorized PG(b, z) draws via the Polson, Scott & Windle (2013) sampler (tulpa::rpg_vec()), the kernel every Polya-Gamma Gibbs fitter in this package draws its auxiliary weights from. Exposed as a door for consumer packages fitting their own Polya-Gamma Gibbs models, which cannot reach an RNG through LinkingTo the way a likelihood kernel would.

Usage

tulpa_rpg(b, z)

Arguments

b

Integer vector of PG shape parameters (trial counts); one draw per element.

z

Numeric vector of tilting parameters, the same length as b.

Value

A numeric vector of PG(b, z) draws, the same length as b.

Examples

tulpa_rpg(rep(1L, 5), rnorm(5))

tulpa documentation built on Oct. 19, 2026, 5:09 p.m.