EPprobit: Compute the EP (expectation propagation) approximation of a...

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/EP.R

Description

The function computes the EP approximation of a probit regression with Gaussian prior. The user must specify the design matrix, the response vector and the prior variance. For more information on the default prior variance see Chopin and Ridgway [2015].

Usage

1
EPprobit(X, Y, s)

Arguments

X

Design matrix. The matrix should include a constant column if a bias is to be considered.

Y

Response vector. The vector should take values in 0,1.

s

Prior variance. The prior is taken to be spherical Gaussian, the variance must therefore be specified in the form of a scalar. For default choices see Chopin and Ridgway [2015].

Details

The implementation is based on the remarks of Chopin and Ridgway (2015) and computes a Gaussian approximation to the Bayesian logit model. The approximation can serve as a very efficient estimation or as the starting point to Monte Carlo algorithms. The output value is given in the form of the parameters of the Gaussian approximation (mean and variance matrix) and an approximation to the log marginal likelihood.

Value

m

Mean of the Gaussian approximation

V

Variance matrix of the Gaussian approximation

Z

Approximated log marginal likelihood

Note

More priors and models should be available shortly.

Author(s)

James Ridgway

References

N. Chopin and J. Ridgway. Leave Pima Indians alone: binary regression as a benchmark for Bayesian computation. arxiv:1506.08640.

Examples

1
2
3
4
5
library(MASS)
data(Pima.tr)
Y<-as.matrix(as.numeric(Pima.tr[,8]))-1
X<-cbind(1,data.matrix(Pima.tr[,1:7]))
Sol<-EPprobit(X,Y,100)

Example output

Loading required package: Rcpp
Loading required package: MASS

EPGLM documentation built on May 29, 2017, 3:54 p.m.