Simulates from a probit binary response regression model using data augmentation and Gibbs sampling
Gives a simulated sample from the joint posterior distribution of the regression vector for a binary response regression model with a probit link and a informative normal(beta, P) prior. Also computes the log marginal likelihood when a subjective prior is used.
bayes.probit(y,X,m,prior=list(beta=0,P=0))
y |
vector of binary responses |
X |
covariate matrix |
m |
number of simulations desired |
prior |
list with components beta, the prior mean, and P, the prior precision matrix |
beta |
matrix of simulated draws of regression vector beta where each row corresponds to one draw |
log.marg |
simulation estimate at log marginal likelihood of the model |
Jim Albert
response=c(0,1,0,0,0,1,1,1,1,1) covariate=c(1,2,3,4,5,6,7,8,9,10) X=cbind(1,covariate) prior=list(beta=c(0,0),P=diag(c(.5,10))) m=1000 s=bayes.probit(response,X,m,prior)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.