Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bayes.probit

Simulates from a probit binary response regression model using data augmentation and Gibbs sampling


Description

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.

Usage

bayes.probit(y,X,m,prior=list(beta=0,P=0))

Arguments

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

Value

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

Author(s)

Jim Albert

Examples

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)

LearnBayes

Functions for Learning Bayesian Inference

v2.15.1
GPL (>= 2)
Authors
Jim Albert
Initial release
2018-03-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.