This package contains a function to generates random samples from the Polya-Gamma distribution using an implementation of the algorithm described in J. Windle's PhD thesis. A frequent application of this distribution is in Bayesian analysis of logistic regression models.
The underlying implementation is in C.
For usage, see the examples in pgdraw and pgdraw.moments.
Jesse Bennett Windle Forecasting High-Dimensional, Time-Varying Variance-Covariance Matrices with High-Frequency Data and Sampling Polya-Gamma Random Variates for Posterior Distributions Derived from Logistic Likelihoods PhD Thesis, 2013
Bayesian Inference for Logistic Models Using Polya-Gamma Latent Variables Nicholas G. Polson, James G. Scott and Jesse Windle Journal of the American Statistical Association Vol. 108, No. 504, pp. 1339--1349, 2013
Chung, Y.: Simulation of truncated gamma variables Korean Journal of Computational & Applied Mathematics, 1998, 5, 601-610