vreg: Create a model component object for a regression component in...

View source: R/mc_vreg.R

vregR Documentation

Create a model component object for a regression component in the variance function of a gaussian sampling distribution

Description

This function is intended to be used on the right hand side of the formula.V argument to create_sampler or generate_data.

Usage

vreg(
  formula = NULL,
  remove.redundant = FALSE,
  sparse = NULL,
  X = NULL,
  prior = NULL,
  Q0 = NULL,
  b0 = NULL,
  name = ""
)

Arguments

formula

a formula for the regression effects explaining the log-variance. Variable names are looked up in the data frame passed as data argument to create_sampler or generate_data, or in environment(formula).

remove.redundant

whether redundant columns should be removed from the design matrix. Default is FALSE.

sparse

whether the model matrix associated with formula should be sparse. The default is determined by a simple heuristic based on storage size.

X

a (possibly sparse) design matrix can be specified directly, as an alternative to the creation of one based on formula. If X is specified formula is ignored.

prior

prior specification for the coefficients. Currently only normal priors are supported, specified using function pr_normal.

Q0

prior precision matrix for the regression effects. The default is a zero matrix corresponding to a noninformative improper prior. DEPRECATED, please use argument prior instead, i.e. prior = pr_normal(mean = b0.value, precision = Q0.value).

b0

prior mean for the regression effect. Defaults to a zero vector. DEPRECATED, please use argument prior instead, i.e. prior = pr_normal(mean = b0.value, precision = Q0.value).

name

the name of the model component. This name is used in the output of the MCMC simulation function MCMCsim. By default the name will be 'vreg' with the number of the variance model term attached.

Value

An object with precomputed quantities and functions for sampling from prior or conditional posterior distributions for this model component. Intended for internal use by other package functions.

References

E. Cepeda and D. Gamerman (2000). Bayesian modeling of variance heterogeneity in normal regression models. Brazilian Journal of Probability and Statistics, 207-221.

T.I. Lin and W.L. Wang (2011). Bayesian inference in joint modelling of location and scale parameters of the t distribution for longitudinal data. Journal of Statistical Planning and Inference 141(4), 1543-1553.


mcmcsae documentation built on Oct. 11, 2023, 1:06 a.m.