multBayesQR: Multiple-output Bayesian quantile regression model

View source: R/multBayesQR.R

multBayesQRR Documentation

Multiple-output Bayesian quantile regression model

Description

This function estimates a multiple-output Bayesian quantile regression model

Usage

multBayesQR(
  response,
  formulaPred,
  directionPoint,
  tau = 0.5,
  dataFile,
  itNum = 2000,
  burnin,
  thin = 1,
  chains = NULL,
  betaValue = NULL,
  sigmaValue = 1,
  vSampleInit = NULL,
  priorVar = 100,
  hyperSigma = c(0.1, 0.1),
  refresh = 100,
  bayesx = TRUE,
  sigmaSampling = TRUE,
  quiet = T,
  tobit = FALSE,
  numCores = 1,
  recordLat = FALSE,
  outfile = NULL,
  check_bayesx = FALSE,
  path_bayesx = NULL,
  adaptive_dir = FALSE,
  ...
)

Arguments

response

Names of response variables

formulaPred

a formula object, with . on the left side of a ~ operator, and the predictor terms, separated by + operators, on the right side.

directionPoint

Either a vector with the same number of dimensions of response variable, indicating a direction, or a integer indicating the number of directions equally spaced in the unit circle one should estimate. When the response has more than 2 dimensions, this should determine the number of points considered in each dimension, in order to define the number of directions taken into account in estimation. The number of directions is then equal to length_1d^d, where d is the dimension of the response variable.

tau

Quantiles of interest. Default is th median, tau = 0.5.

dataFile

A data.frame from which to find the variables defined in the formula.

itNum

Number of iterations.

burnin

Size of the initial to be discarded.

thin

Thinning parameter. Default value is 1.

chains

The number of chains to be run for each parameter. Only available when using bayes = TRUE and its default is one, when this is equal to NULL.

betaValue

Initial values for the parameter beta for the continuous part.

sigmaValue

Initial value for the scale parameter.

vSampleInit

Initial value for the latent variables.

priorVar

Value that multiplies a identity matrix in the elicition process of the prior variance of the regression parameters.

hyperSigma

Vector of size containing the hyperparameters of the inverse gamma distribution for the sigma parameter of the asymmetric Laplace distribution. Default is c(0.1, 0.1), which gives a noninformative prior for sigma.

refresh

Interval between printing a message during the iteration process. Default is set to 100.

bayesx

If TRUE, the default, it uses bayesX software to estimate the quantile regression oarameters, which can be faster. If FALSE, it uses a Rcpp implementation of the MCMC sampler.

sigmaSampling

If TRUE, the default, it will sample from the posterior distribution of the scale parameter. If FALSE, all values will be fixed to 1.

quiet

If TRUE, the default, it does not print messages to check if the MCMC is actually updating. If FALSE, it will use the value of refresh to print messages to control the iteration process.

tobit

If TRUE, it will input the censored value for all observations with y = 0, according to the model. If FALSE, the default, it will estimate the parameter without this inputation process.

numCores

The number of cores that could be used for estimating parallel models when more than one direction is considered.

recordLat

If TRUE, it will keep the Markov chain samples for the latent variable. Default is FALSE.

outfile

argument to be passed to bayesx.control, in order to define a directory where all output files should be saved.

check_bayesx

To check whether all calls to BayesX generated valid chain values for all models. In case there are NA values, it calls BayesX just for those models with problems. This is only considered when outfile is different than NULL.

path_bayesx

When check_bayes is TRUE, the user must inform the path of BayesX in order for these new calls of the program.

adaptive_dir

If TRUE, then directions will take into account the marginal quantiles of each dimension of the response variable. Otherwise, the direction vector are created creating all possible combinations of points inside the interval [-1, 1] given the number of points directionPoint. The default is FALSE.

...

arguments passed to bayesx.control.

Value

A list with the chains of all parameters of interest.


brsantos/baquantreg documentation built on Feb. 8, 2023, 8:18 a.m.