generate_tweedie_cpg#

superglm.generate_tweedie_cpg(
n: int,
mu,
phi,
p: float,
rng=None,
) → NDArray#

Simulate Tweedie(mu, phi, p) as compound Poisson-gamma: N ~ Poisson, Y | N ~ Gamma.

rng is a numpy Generator, or any object whose poisson(lam) and gamma(shape, scale=...) return one draw per element as numpy’s do; the draws are checked, since fractional counts or one draw broadcast over every row would sample a different distribution.