prior: Create prior for Bayesian quantile regression

View source: R/prior.r

priorR Documentation

Create prior for Bayesian quantile regression

Description

prior creates an S3 object of class bayesQR.prior that contains all necessary prior information to estimate a Bayesian quantile regression model.

Usage

  prior(formula, data, alasso, ...)

Arguments

formula

a symbolic description of the model to be fit.

data

an optional data frame containing the variables in the model.

alasso

logical flag for adaptive lasso variable selection (default=FALSE).

...

the prior parameters that are dependent on the method that is used. If omitted, a standard diffuse prior will be used (see details section).

Details

The function prior builds the prior for four types of models, depending on whether the dependent variable is continuous or binary and whether adaptive lasso variable selection is used. Every non-specified prior parameter will get the default value.

Continuous dependent variable without adaptive lasso variable selection:

  • beta0 : nvar(X) x 1 vector of prior means (default: 0)

  • V0 : nvar(X) x nvar(X) prior covariance matrix (default: 100*diag(ncol(X)))

  • shape0 : shape parameter for inverse Gamma prior for sigma (default: 0.01)

  • scale0 : scale parameter for inverse Gamma prior for sigma (default: 0.01)

Continuous dependent variable with adaptive lasso variable selection:

  • sigma_shape : shape parameter for the inverse gamma prior on sigma (default: 0.01)

  • sigma_scale : scale parameter for the inverse gamma prior on sigma (default: 0.01)

  • etasq_shape : shape parameter for the gamma prior on etasq (default: 0.01)

  • etasq_scale : scale parameter for the gamma prior on etasq (default: 0.01)

Binary dependent variable without adaptive lasso variable selection:

  • beta0 : nvar(X) x 1 vector of prior means (default: 0)

  • V0 : nvar(X) x nvar(X) prior covariance matrix (default: 100*diag(ncol(X)))

Binary dependent variable with adaptive lasso variable selection:

  • lambdasq_shape : shape parameter for the gamma prior on lambdasq (default: 0.01)

  • lambdasq_scale : scale parameter for the gamma prior on lambdasq (default: 0.01)

Value

An object of class bayesQR, basically a list containing the following elements:

method

a string containing the method that was used, i.e. indicating whether the dependent variable was continuous or binary and whether adaptive lasso variable selection was used.

...

the prior parameters that are dependent on the method that is used (see details section).

Author(s)

Dries F. Benoit

Examples

# Load the Prostate cancer dataset
data(Prostate)

# Create informative prior object
prior <- prior(lpsa~., data=Prostate, beta0=rep(5,9), V0=diag(9)) 

# Investigate structure of bayesQR.prior object
str(prior)

# Estimate the model parameters with informative prior
out <- bayesQR(lpsa~., data=Prostate, prior=prior, ndraw=5000)

# Print results
summary(out)

bayesQR documentation built on Sept. 9, 2023, 1:06 a.m.

Related to prior in bayesQR...