Learn R Programming

bayess (version 1.4)

hmflatprobit: Metropolis-Hastings for the probit model under a flat prior

Description

This random walk Metropolis-Hastings algorithm takes advantage of the availability of the maximum likelihood estimator (available via the glm function) to center and scale the random walk in an efficient manner.

Usage

hmflatprobit(niter, y, X, scale)

Arguments

niter
number of iterations
y
binary response variable
X
covariates
scale
scale of the random walk

Value

  • The function produces a sample of $\beta$'s of size niter.

See Also

hmflatlogit

Examples

Run this code
data(bank)
bank=as.matrix(bank)
y=bank[,5]
X=bank[,1:4]
flatprobit=hmflatprobit(1000,y,X,1)
mean(flatprobit[101:1000,1])

Run the code above in your browser using DataLab