pgdraw.moments: Compute exact first and second moments for the Polya-Gamma...

Description Usage Arguments Value Details References See Also Examples

Description

Compute exact first and second moments for the Polya-Gamma distribution

Usage

1

Arguments

b

The 'b' parameter of the Polya-Gamma distribution.

c

The 'c' parameter of the Polya-Gamma distribution.

Value

A list containing the mean and variance.

Details

This code computes the exact mean and variance of the Polya-Gamma distribution for the specified parameters.

References

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

See Also

pgdraw

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# -----------------------------------------------------------------
# Example: Simulated vs exact moments

u = matrix(1,1e6,1)
x = pgdraw(1,0.5*u)
mean(x)
var(x)
pgdraw.moments(1,0.5)

x = pgdraw(2,2*u)
mean(x)
var(x)
pgdraw.moments(2,2)

pgdraw documentation built on May 1, 2019, 9:22 p.m.