bayesQR: Bayesian quantile regression model

View source: R/bayesQR.R

bayesQRR Documentation

Bayesian quantile regression model

Description

This function estimates a Bayesian quantile regression model The response variable is assumed to follow a asymmetric Laplace distribution.

Usage

bayesQR(
  formula,
  tau = 0.5,
  data,
  itNum,
  thin = 1,
  betaValue = NULL,
  sigmaValue = 1,
  vSampleInit = NULL,
  priorVar = 100,
  hyperSigma = c(0.1, 0.1),
  refresh = 100,
  sigmaSampling = TRUE,
  quiet = T,
  tobit = FALSE,
  recordLat = FALSE
)

Arguments

formula

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

tau

Quantile of interest.

data

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

itNum

Number of iterations.

thin

Thinning parameter. Default value is 1.

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 elicitation 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.

sigmaSampling

If TRUE, the default, the MCMC procedure will draw values from the posterior distribution of sigma. Otherwise, it will fix the value to 1 for all values of the chain.

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.

recordLat

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

Value

A list with the chains of all parameters of interest.

References

Kozumi and Kobayashi (2011) - Gibbs sampling methods for Bayesian quantile regression. Journal of Statistical Computation and Simulation.

Examples

set.seed(1)

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