Description Usage Arguments Details Value Author(s) References See Also Examples
dRUMHAM
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). For binomial observations where the success rate yi/Ni
is neither close to 0 nor close to 1 we use the normal distribution as for the dRUMIndMH
sampler to approximate the Type III generalized logistic distributed error in the dRUM representation. For extreme ratios yi/Ni <= low
and yi/Ni >= up
the error is approximated by the precise scale mixture of normal distributions as used for the dRUMAuxMix
sampler. The resulting posterior of this regression model is then used as proposal density for the regression coefficients.
1 2 |
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 |
B0 |
an optional |
start |
an optional vector of length |
low |
a numeric value between 0 and 1 indicating that for all observations where the ratio |
up |
a numeric value between 0 and 1 indicating that for all observations where the ratio |
verbose |
an optional non-negative integer indicating that in each |
For details concerning the algorithm see the paper by Fussl, Fruehwirth-Schnatter and Fruehwirth (2013).
The output is a list object of class c("binomlogitHAM","binomlogit")
containing
beta |
a |
sim |
the argument |
burn |
the argument |
dims |
number of covariates ( |
t |
number of binomial observations/covariate patterns ( |
b0 |
the argument |
B0 |
the argument |
low |
the argument |
up |
the argument |
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 |
rate |
acceptance rate based on the |
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, the runtime used for the whole algorithm and for the sim-burn
MCMC draws after burn-in and the acceptance rate. The summary
method additionally returns the boundaries low
and up
used for HAM sampling, the 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.
Agnes Fussl <avf@gmx.at>
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.
dRUMIndMH
, dRUMAuxMix
, IndivdRUMIndMH
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Hybrid 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 HAM sampler
ham1 <- dRUMHAM(yi,Ni,X)
## Not run:
ham2 <- dRUMHAM(yi,Ni,X,low=0.01,up=0.99)
## End(Not run)
print(ham1)
summary(ham1)
plot(ham1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.