Learn R Programming

R2BayesX (version 0.1-2)

bayesx.control: Control Parameters for BayesX

Description

Various parameters that control fitting of regression models using bayesx.

Usage

bayesx.control(model.name = "bayesx.estim", 
  family = "gaussian", method = "MCMC", verbose = TRUE, 
  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, ...)

Arguments

model.name
character, specify a base name model output files are named with in outfile.
family
character, specify the distribution used for the model, options for all methods, "MCMC", "REML" and "STEP" are: "binomial", "binomial
method
character, which method should be used for estimation, options are "MCMC", "HMCMC" (hierarchical MCMC), "REML" and "STEP".
verbose
logical, should output be printed to the R console during runtime of bayesx.
dir.rm
logical, should the the output files and directory removed after estimation?
outfile
character, specify a directory where bayesx should store all output files, all output files will be named with model.name as the
replace
if set to TRUE, the files in the output directory specified in argument outfile will be replaced.
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
step
integer, defines the thinning parameter for MCMC simulation. E.g., step = 50 means, that only every 50th sampled parameter will be stored and used to compute characteristics of t
predict
logical, option predict may be specified to compute samples of the deviance D, the effective number of parameters pD and the deviance information criteri
seed
integer, set the seed of the random number generator in BayesX, usually set using function set.seed.
hyp.prior
numeric, defines the value of the hyper-parameters a and b for the inverse gamma prior of the overall variance parameter $\sigma^2$, if the response distribution is G
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 l
reference
character, option reference is meaningful only if either family = "multinomial" or family = "multinomialprobit" is specified as the response distributi
zipdistopt
character, defines the zero inflated distribution for the regression analysis. The two possibilities are to work with a zero infated Poisson distribution (zipdistopt = "zip") or
begin
character, option begin is meaningful only if family = "cox" is specified as the response distribution. In this case begin specifies the variable that records when
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 simulat
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 eps, th
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 penaliz
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
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 Bayes
leftint
character, gives the name of the variable that contains the lower (left) boundary $T_{lo}$ of the interval $[T_{lo}, T_{up}]$ for an interval censored observation. for right censored or unce
lefttrunc
character, option lefttrunc specifies the name of the variable containing the left truncation time $T_{tr}$. For observations that are not truncated, we have to specify $T_{tr}
state
character, for multi-state models, state specifies the current state variable of the process.
algorithm
character, specifies the selection algorithm. Possible values are "cdescent1" (adaptive algorithms in the methodology manual, see subsection 6.3), "cdescent2" (adap
criterion
character, specifies the goodness of fit criterion. If criterion = "MSEP" is specified the data are randomly divided into a test- and validation data set. The test data set is u
proportion
numeric, this option may be used in combination with option criterion = "MSEP", see above. In this case the data are randomly divided into a training and a validation sample. prop
startmodel
character, defines the start model for variable selection. Options are "linear", "empty", "full" and "userdefined".
trace
character, specifies how detailed the output in the output window will be. Options are "trace_on", "trace_half" and "trace_off".
steps
integer, defines the maximum number of iterations. If the selection process has not converged after steps iterations the algorithm terminates and a warning is raised. Setting
CI
character, compute confidence intervals for linear and nonlinear terms. Option CI allows to compute confidence intervals. Options are CI = "none", confidence interv
bootstrapsamples
integer, defines the number of bootstrap samples used for "CI = MCMCbootstrap".
...
not used

Value

  • A list with the arguments specified is returned.

References

For methodological and reference details see the BayesX manuals available at: http://www.BayesX.org.

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 J. M., Hastie T. J. (eds.) (1992). Statistical Models in S. Chapman & Hall, London.

See Also

bayesx.

Examples

Run this code
bayesx.control()

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)

Run the code above in your browser using DataLab