Usage
bcplm(formula, link = "log", data, inits = NULL,
weights, offset, subset, na.action, contrasts = NULL,
n.chains = 3, n.iter = 2000, n.burnin = floor(n.iter / 2),
n.thin = max(1, floor(n.chains * (n.iter - n.burnin) / n.sims)),
n.sims = 1000, n.report = 2, prior.beta.mean = NULL,
prior.beta.var = NULL, bound.phi = 100, bound.p = c(1.01, 1.99),
tune.iter = 5000, n.tune = floor(tune.iter/100),
basisGenerators = c("tp", "tpU", "bsp", "sp2d"), ...)
Arguments
formula
an object of class formula
. See glm
and glmer
for details. link
a specification for the model link function. This can be either a literal character string or a numeric number. If it is a character string, it must be one of "log", "identity", "sqrt" or "inverse". If it is numeric, it is the same as the link.power
inits
a list of initial values to be used for each chain. It must be of length n.chains
. Each element is a named list with the following components: 'beta' (fixed effects), 'phi' (dispersion), 'p' (index parameter) and 'Sigma' (variance components)
data, subset, weights, na.action, offset, contrasts
further model specification arguments as in cpglm
; see there for details. n.chains
an integer indicating the number of Markov chains (default: 3
).
n.iter
the number of total iterations per chain (including burn in; default: 2000
)
n.burnin
the length of burn in, i.e. number of iterations to discard at the beginning. Default
is n.iter/2
, that is, discarding the first half of the simulations.
n.thin
thinning rate. Must be a positive integer. Set n.thin > 1
to save memory and
computation time if n.iter
is large. Default is max(1, floor(n.chains * (n.iter - n.burnin) / 1000))
which will only thin if there are at
n.sims
The approximate number of simulations to keep after thinning (all chains combined).
n.report
if greater than zero, fitting information will be printed out n.report
times for each chain.
prior.beta.mean
a vector of prior means for the fixed effects. Default is a vector of zeros.
prior.beta.var
a vector of prior variances for the fixed effects. Default is a vector of 10000
's.
bound.phi
a numeric value indicating the upper bound of the uniform prior for the dispersion parameter. The default is 100
. The lower bound is set to be 0
in the function.
bound.p
a vector of lower and upper bounds for the index parameter $p$. The default is c(1.01, 1.99)
.
tune.iter
the number of iterations used for tuning the proposal variances used in the Metropolis-Hastings updates. These iterations will not be included in the final output. Default is 5000
. Set it to be zero if the tuning process is not desired.
n.tune
a positive integer (default: 20
). The tune.iter
iterations is divided into n.tune
loops. Proposal variances are updated at the end of each loop if acceptance rates are outside the desired interval.
basisGenerators
a character vector of names of functions that generate spline bases. See tp
for details.