Description Usage Arguments Author(s) References See Also Examples
Function for optional use in calls to gSlc()
to control Markov chain Monte Carlo sample sizes values and other specifications for slice sampling-based fitting of generalized additive mixed models.
1 2 | gSlc.control(nBurn=5000,nKept=5000,nThin=5,fixedEffPriorVar=1e10,
sdPriorScale=1e5,numBasis=NULL,preTransfData=TRUE,msgCode=1)
|
nBurn |
The length of the Markov chain Monte Carlo burnin. The first |
nKept |
The number of kept Markov chain Monte Carlo samples after the burnin period. The default value of |
nThin |
Thinning factor applied to the retained Markov chain Monte Carlo samples. Setting |
fixedEffPriorVar |
The variance in the independent zero mean Normal priors of the fixed effect parameters after the data of each predictor have been transformed to the interval [0,1]. The default value of |
sdPriorScale |
The scale parameter in the Half Cauchy priors on standard deviation parameters after the data of each predictor have been transformed to the interval [0,1]. The default value of |
numBasis |
Vector of positive integers specifying the number of spline basis functions to be used for each smooth function component. |
preTransfData |
Boolean flag: |
msgCode |
A code for specification of the nature of messages printed concerning progress of the Markov chain Monte Carlo sampling: |
Tung Pham tungstats@gmail.com and Matt Wand matt.wand@uts.edu.au.
Pham, T. and Wand, M.P. (2018). Generalized additive mixed model analysis via gammSlice
. Australian and New Zealand Journal of Statistics, 60, 279-300.
Zhao, Y., Staudenmayer, J., Coull, B.A. and Wand, M.P. (2003). General design Bayesian generalized linear mixed models. Statistical Science, 21, 35-51.
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 | ## Not run:
library(gammSlice)
set.seed(39402) ; m <- 100 ; n <- 2
beta0True <- 0.5 ; betaxTrue <- 1.7 ; sigsqTrue <- 0.8
idnum <- rep(1:m,each=n) ; x <- runif(m*n)
U <- rep(rnorm(m,0,sqrt(sigsqTrue)),each=n)
mu <- 1/(1+exp(-(beta0True+betaxTrue*x+U)))
y <- rbinom((m*n),1,mu)
fit <- gSlc(y ~ x,random = list(idnum = ~1),family = "binomial")
summary(fit)
# Illustration of user-specified priors:
fitMyPriors <- gSlc(y ~ x,random = list(idnum = ~1),
family = "binomial",
control = gSlc.control(fixedEffPriorVar=1e13,
sdPriorScale=1e3))
summary(fitMyPriors)
# Illustration of specification of larger Markov chain Monte Carlo samples:
fitBigMCMC <- gSlc(y ~ x,random = list(idnum = ~1),family = "binomial",
control = gSlc.control(nBurn=10000,nKept=8000,nThin=10))
summary(fitBigMCMC)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.