bayesQR: Bayesian quantile regression model

Description Usage Arguments Value References Examples

View source: R/bayesQR.R

Description

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

Usage

1
2
3
4
5
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, blocksV = 0,
  stopOrdering = FALSE, numOrdered = itNum/2)

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.

blocksV

Number of blocks used to sample in the posterior distribution of the latent variable. If 0, then blocking is not used and all latent observations are sampled from. Default value is 0.

stopOrdering

If TRUE, it will stop ordering the weighted residuals in order to update the states of the latent variables, and will consider the ordering of some particular state of the chain; if FALSE, for every iteration of the MCMC procedure, it will keep reordering these residual terms. Default is FALSE.

numOrdered

The number of iterations that will be used to order the weighted residuals needed for the update of the posterior distribution of the latent variables. Default is half the size of the MCMC chain.

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

1

brsantos/baquantreg documentation built on Dec. 10, 2018, 1 p.m.