varbvsproxybf | R Documentation |
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?
varbvsproxybf(X, Z, y, fit, i, vars)
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 |
y |
Vector of length n containing values of the continuous outcome. |
fit |
An object inheriting from class |
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
|
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. |
Peter Carbonetto peter.carbonetto@gmail.com
varbvs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.