Description Usage Arguments Value Examples
Gibbs two-step sampling procedure for parameter vector beta and the latent Polya-Gamma variables
1 2 3 |
y |
binary vector of observations |
X |
design matrix of covariates |
lambda |
The diagonal element of the precision matrix of the prior distribution (see also parameter B) |
b |
The prior mean of the prior distribution. Defaults to a vector of zeros. |
B |
The prior precision of the prior distribution. Defaults to lambda * identity. |
naive |
Should the naive approximation be used to generate the Polya-Gamma distribution |
naive_n_terms |
If the naive approximation is used, then this specifies number of terms in the finite sum. |
t |
The parameter in the accept-reject algorithm for sampling from Polya-Gamma distribution (see paper for details). |
n_iter |
The total number of iterations in the MCMC chain |
list containing the MCMC samples from the posterior distribution of beta
1 2 3 | data = generate_from_simple_logistic_model(n=100)
obj = gibbs_sampler(data$y, data$X, lambda=0.001, n_iter_total=100, burn_in=50)
plot(obj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.