rbprobitGibbs {bayesm} | R Documentation

## Gibbs Sampler (Albert and Chib) for Binary Probit

### Description

`rbprobitGibbs` implements the Albert and Chib Gibbs Sampler for the binary probit model.

### Usage

    rbprobitGibbs(Data, Prior, Mcmc)

### Arguments

`Data` | list(X,y)
`Prior` | list(betabar,A)
`Mcmc` | list(R,keep)

### Details

Model: z = Xβ + e. e ~ N(0,I). y=1, if z> 0.

Prior: β ~ N(betabar,A^{-1}).

List arguments contain

`X`
  Design Matrix
`y`
  n x 1 vector of observations, (0 or 1)
`betabar`
  k x 1 prior mean (def: 0)
`A`
  k x k prior precision matrix (def: .01I)
`R`
  number of MCMC draws
`keep`
  thinning parameter - keep every keepth draw (def: 1)

### Value

`betadraw` | R/keep x k array of betadraws

### Author(s)

Peter Rossi, Graduate School of Business, University of Chicago, Peter.Rossi@ChicagoGsb.edu.

### References

For further discussion, see Bayesian Statistics and Marketing by Rossi, Allenby and McCulloch, Chapter 3.
http://gsbwww.uchicago.edu/fac/peter.rossi/research/bsm.html

### See Also

`rmnpGibbs`

### Examples

    ##
    ## rbprobitGibbs example
    ##
    if(nchar(Sys.getenv("LONG_TEST")) != 0) {R=2000} else {R=10}

    set.seed(66)
    simbprobit=
    function(X,beta) {
    ##  function to simulate from binary probit including x variable
    y=ifelse((X%*%beta+rnorm(nrow(X)))<0,0,1)
    list(X=X,y=y,beta=beta)
    }

    nobs=200
    X=cbind(rep(1,nobs),runif(nobs),runif(nobs))
    beta=c(0,1,-1)
    nvar=ncol(X)
    simout=simbprobit(X,beta)

    Data=list(X=simout$X,y=simout$y)
    Mcmc=list(R=R,keep=1)

    out=rbprobitGibbs(Data=Data,Mcmc=Mcmc)

    cat(" Betadraws ",fill=TRUE)
    mat=apply(out$betadraw,2,quantile,probs=c(.01,.05,.5,.95,.99))
    mat=rbind(beta,mat); rownames(mat)[1]="beta"; print(mat)

[Package bayesm version 2.0-8 Index]