dRUMAuxMix: Auxiliary mixture sampling for the binomial logit model

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

Description

dRUMAuxMix simulates the posterior distribution of the regression coefficients of a binomial logit model and returns the MCMC draws. The sampling procedure is based on an algorithm using data augmentation, where the regression coefficients are estimated by rewriting the binomial logit model as a latent variable model called difference random utility model (dRUM). The Type III generalized logistic distribution of the error in this dRUM representation is approximated by a scale mixture of normal distributions.

Usage

1
2
dRUMAuxMix(yi, Ni, X, sim = 12000, burn = 2000, b0, B0,
           start, verbose = 500)

Arguments

yi

an integer vector of counts for binomial data.

Ni

an integer vector containing the number of trials for binomial data.

X

a design matrix of predictors.

sim

number of MCMC draws including burn-in. The default value is 12000 draws.

burn

number of MCMC draws discarded as burn-in. Default is a burn-in of 2000 draws.

b0

an optional vector of length dims = ncol(X) containing the prior mean. Otherwise a vector of zeros is used.

B0

an optional dims x dims prior variance-covariance matrix. Otherwise a diagonal matrix with all diagonal elements equal to 10 is used.

start

an optional vector of length dims = ncol(X) containing the starting values for the regression parameters. Otherwise a vector of zeros is used.

verbose

an optional non-negative integer indicating that in each verbose-th iteration step a status report is printed (default: verbose = 500). If 0, no output is generated during MCMC sampling.

Details

For details concerning the algorithm see the paper by Fussl, Fruehwirth-Schnatter and Fruehwirth (2013).

Value

The output is a list object of class "binomlogit" containing

beta

a dims x sim matrix of sampled regression coefficients from the posterior distribution

sim

the argument sim

burn

the argument burn

dims

number of covariates (dims = ncol(X))

t

number of binomial observations/covariate patterns (t = length(yi)); covariate patterns where Ni = 0 are not included

b0

the argument b0

B0

the argument B0

duration

a numeric value indicating the total time (in secs) used for the function call

duration_wBI

a numeric value indicating the time (in secs) used for the sim-burn MCMC draws after burn-in

To display the output use print, summary and plot. The print method prints the number of observations and covariates entered in the routine, the total number of MCMC draws (including burn-in), the number of draws discarded as burn-in and the runtime used for the whole algorithm and for the sim-burn MCMC draws after burn-in. The summary method additionally returns the used prior parameters b0 and B0 and the posterior mean for the regression coefficients without burn-in. The plot method plots the MCMC draws and their acf for each regression coefficient, both without burn-in.

Note

dRUMAuxMix can also be used to estimate the regression coefficients in the individual dRUM representation of the binomial logit model, i.e. using binary observations as input. For this purpose, add a column in the data set next to the binary response variable, containing the repetition parameter Ni = 1 for each binary observation.

Author(s)

Agnes Fussl <avf@gmx.at>

References

Agnes Fussl, Sylvia Fruehwirth-Schnatter and Rudolf Fruehwirth (2013), "Efficient MCMC for Binomial Logit Models". ACM Transactions on Modeling and Computer Simulation 23, 1, Article 3, 21 pages.

See Also

dRUMIndMH, dRUMHAM, IndivdRUMIndMH

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Auxiliary mixture sampling in the aggregated dRUM representation of a
## binomial logit model

## load caesarean birth data
data(caesarean)
yi <- as.numeric(caesarean[,1])                          
Ni <- as.numeric(caesarean[,2])                           
X <- as.matrix(caesarean[,-(1:2)])

## start auxiliary mixture sampler
aux1=dRUMAuxMix(yi,Ni,X,verbose=0)
## Not run: 
aux2=dRUMAuxMix(yi,Ni,X)

## End(Not run)

print(aux1)
summary(aux1)
plot(aux1)

## Not run: 
## Auxiliary mixture sampling in the individual dRUM representation of a
## binomial logit model

## load caesarean birth data
data(caesarean_aux)
yi <- as.numeric(caesarean_aux[,1])                          
Ni <- as.numeric(caesarean_aux[,2])                           
X <- as.matrix(caesarean_aux[,-(1:2)])

## start auxiliary mixture sampler
aux3=dRUMAuxMix(yi,Ni,X)

print(aux3)
summary(aux3)
plot(aux3)

## End(Not run)

binomlogit documentation built on May 1, 2019, 7:28 p.m.