View source: R/bayesx.control.R
bayesx.control | R Documentation |
Various parameters that control fitting of regression models
using bayesx
.
bayesx.control(model.name = "bayesx.estim",
family = "gaussian", method = "MCMC", verbose = FALSE,
dir.rm = TRUE, outfile = NULL, replace = FALSE, iterations = 12000L,
burnin = 2000L, maxint = NULL, step = 10L, predict = TRUE,
seed = NULL, hyp.prior = NULL, distopt = NULL, reference = NULL,
zipdistopt = NULL, begin = NULL, level = NULL, eps = 1e-05,
lowerlim = 0.001, maxit = 400L, maxchange = 1e+06, leftint = NULL,
lefttrunc = NULL, state = NULL, algorithm = NULL, criterion = NULL,
proportion = NULL, startmodel = NULL, trace = NULL,
steps = NULL, CI = NULL, bootstrapsamples = NULL, ...)
model.name |
character, specify a base name model output files are named
with in |
family |
character, specify the distribution used for the model, options
for all methods, |
method |
character, which method should be used for estimation, options
are |
verbose |
logical, should output be printed to the |
dir.rm |
logical, should the the |
outfile |
character, specify a directory where |
replace |
if set to |
iterations |
integer, sets the number of iterations for the sampler. |
burnin |
integer, sets the burn-in period of the sampler. |
maxint |
integer, if first or second order random walk priors are
specified, in some cases the data will be slightly grouped: The range between the minimal and
maximal observed covariate values will be divided into (small) intervals, and for each interval
one parameter will be estimated. The grouping has almost no effect on estimation results as long
as the number of intervals is large enough. With the |
step |
integer, defines the thinning parameter for MCMC simulation.
E.g., |
predict |
logical, option |
seed |
integer, set the seed of the random number generator in
BayesX, usually set using function |
hyp.prior |
numeric, defines the value of the hyper-parameters |
distopt |
character, defines the implemented formulation for the negative
binomial model if the response distribution is negative binomial. The two possibilities are to
work with a negative binomial likelihood ( |
reference |
character, option |
zipdistopt |
character, defines the zero inflated distribution for the
regression analysis. The two possibilities are to work with a zero infated Poisson distribution
( |
begin |
character, option |
level |
integer, besides the posterior means and medians, BayesX
provides point-wise posterior credible intervals for every effect in the model. In a Bayesian
approach based on MCMC simulation techniques credible intervals are estimated by computing the
respective quantiles of the sampled effects. By default, BayesX computes (point-wise)
credible intervals for nominal levels of 80 |
eps |
numeric, defines the termination criterion of the estimation
process. If both the relative changes in the regression coefficients and the variance parameters
are less than |
lowerlim |
numeric, since small variances are close to the boundary of
their parameter space, the usual fisher-scoring algorithm for their determination has to be
modified. If the fraction of the penalized part of an effect relative to the total effect is
less than |
maxit |
integer, defines the maximum number of iterations to be used in
estimation. Since the estimation process will not necessarily converge, it may be useful to
define an upper bound for the number of iterations. Note, that BayesX returns results
based on the current values of all parameters even if no convergence could be achieved within
|
maxchange |
numeric, defines the maximum value that is allowed for relative changes in parameters in one iteration to prevent the program from crashing because of numerical problems. Note, that BayesX produces results based on the current values of all parameters even if the estimation procedure is stopped due to numerical problems, but an error message will be printed in the output window. |
leftint |
character, gives the name of the variable that contains the
lower (left) boundary |
lefttrunc |
character, option |
state |
character, for multi-state models, |
algorithm |
character, specifies the selection algorithm. Possible values
are |
criterion |
character, specifies the goodness of fit criterion. If
|
proportion |
numeric, this option may be used in combination with option
|
startmodel |
character, defines the start model for variable selection.
Options are |
trace |
character, specifies how detailed the output in the output window
will be. Options are |
steps |
integer, defines the maximum number of iterations. If the
selection process has not converged after |
CI |
character, compute confidence intervals for linear and nonlinear
terms. Option |
bootstrapsamples |
integer, defines the number of bootstrap samples used
for |
... |
not used |
A list with the arguments specified is returned.
Nikolaus Umlauf, Thomas Kneib, Stefan Lang, Achim Zeileis.
For methodological and reference details see the BayesX manuals available at: https://www.uni-goettingen.de/de/bayesx/550513.html.
Belitz C, Lang S (2008). Simultaneous selection of variables and smoothing parameters in structured additive regression models. Computational Statistics & Data Analysis, 53, 61–81.
Chambers JM, Hastie TJ (eds.) (1992). Statistical Models in S. Chapman & Hall, London.
Umlauf N, Adler D, Kneib T, Lang S, Zeileis A (2015). Structured Additive Regression Models: An R Interface to BayesX. Journal of Statistical Software, 63(21), 1–46. https://www.jstatsoft.org/v63/i21/
bayesx
.
bayesx.control()
## Not run:
set.seed(111)
n <- 500
## regressors
dat <- data.frame(x = runif(n, -3, 3))
## response
dat$y <- with(dat, 10 + sin(x) + rnorm(n, sd = 0.6))
## estimate models with
## bayesx MCMC and REML
b1 <- bayesx(y ~ sx(x), method = "MCMC", data = dat)
b2 <- bayesx(y ~ sx(x), method = "REML", data = dat)
## compare reported output
summary(b1)
summary(b2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.