varbvsproxybf: Compute Bayes factors measuring improvement-in-fit along 1...

varbvsproxybfR Documentation

Compute Bayes factors measuring improvement-in-fit along 1 dimension.

Description

For each candidate variable j, this function returns a Bayes factor measuring the improvement in fit when variable j is included in the model instead of variable i; that is, a larger Bayes factor indicates a better model fit by swapping variables i and j. From an optimization perspective, this could be viewed as addressing the following question: if you had to update the variational parameters for one variable so as to improve the "fit" of the variational approximation after setting the posterior inclusion probability for variable i to zero, which variable would you choose?

Usage

  varbvsproxybf(X, Z, y, fit, i, vars)

Arguments

X

n x p input matrix, where n is the number of samples, and p is the number of variables. X cannot be sparse, and cannot have any missing values (NA).

Z

n x m covariate data matrix, where m is the number of covariates. Do not supply an intercept as a covariate (i.e., a column of ones), because an intercept is automatically included in the regression model. For no covariates, set Z = NULL.

y

Vector of length n containing values of the continuous outcome.

fit

An object inheriting from class varbvs, usually the result of calling function varbvs. Currently, this is only implemented for linear regression (family = "gaussian"); any other choice will produce an error.

i

Variable against will. Typically, will be a variable included in the regression model with high probability, but not always.

vars

Set of candidate "proxy" variables. This set may include i, but not does not have to.

Value

varbvsproxybf returns a list with the following components:

BF

Matrix containing Bayes factors for each candidate proxy variable and for each hyperparameter setting.

mu

Matrix containing estimated posterior means for each candidate proxy variable and for each hyperparameter setting.

s

Matrix containing estimated posterior variances for each candidate proxy variance for each hyperparameter setting.

Author(s)

Peter Carbonetto peter.carbonetto@gmail.com

See Also

varbvs


varbvs documentation built on June 7, 2023, 5:43 p.m.