Last updated: 2020-01-22

Checks: 2 0

Knit directory: Note/

This reproducible R Markdown analysis was created with workflowr (version 1.5.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/.Rhistory

Unstaged changes:
    Modified:   analysis/bibliography.bib

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view them.

File Version Author Date Message
html 19e6d10 zouyuxin 2020-01-22 Build site.
Rmd 897f54f zouyuxin 2020-01-22 wflow_publish(“analysis/varbvs.Rmd”)

Carbonetto, Stephens, and others (2012) introduce varbvs, which uses variational Bayes to do variable selection. The method scales linearly with the number of variables. They assume each regression coefficient \(\beta_i\) is independent of the other regression coefficients a posteriori. Variational estimates of posterior distributions can be inaccurate. For instance, they are often too concentrated. They focus on assessing the accuracy of the variational approximation. In situations where the conditional independence assumption (\(X_i\) and \(X_j\) are independent) is violated, we would not expect accurate approximations of the posterior inclusion probabilities.

The model is \[ Y = \sum_{k=1}^{p} X_k \beta_k + \epsilon, \epsilon \sim N(0, \sigma^2) \] The binary variables \(\gamma = (\gamma_1, \cdots, \gamma_p)^\intercal\) to indicate whether or not each variable is included in the model. They assign priors to the indicator variables \(\gamma\) and coefficients \(\beta\), then compute posterior probabilities by averaging over choices of \(\beta\) and \(\gamma\), and any additional model parameters, such as \(\sigma^2\). Priors: \[\begin{align*} p(\gamma_k = 1) &= \pi \\ \beta_k | \gamma_k=1 &\sim N(0, \sigma^2 \sigma_{\beta}^2). \end{align*}\]

The hyperparameters \(\theta = (\sigma^2, \sigma_{\beta}^2, \pi)\).

The posterior probability that variable \(X_k\) is included in the linear model of \(Y\) is \[ PIP(k) = p(\gamma_k = 1 | X, y) = \frac{\sum_{\gamma_{-k}} \int \int p(y, \beta, \gamma_k = 1, \gamma_{-k} | X, \theta) d \beta d \theta}{\sum_{\gamma} \int \int p(y, \beta, \gamma|X, \theta) d \beta d \theta}. \] The joint probability of \(y\), \(\beta\) and \(\gamma\) given \(X\) and \(\theta\) is \[ p(y, \beta, \gamma|X, \theta) = p(y | X, \beta, \sigma^2) \prod_{k=1}^{p} p(\beta_k | \gamma_k, \sigma^2, \sigma_{\beta}^2) \prod_{k=1}^{p} p(\gamma_k | \pi). \] MCMC methods approximate the intractable sums and integrals by implementing Metropolis-Hastings moves that explore models with strong support under the posterior.

\[\begin{align*} q(\beta, \gamma; \phi) &= \prod_{k=1}^{p} q(\beta_k, \gamma_k; \phi_k) \\ q(\beta_k, \gamma_k; \phi_k) &= \begin{cases} \alpha_k N(\beta_k | \mu_k, s_k^2) \quad &\text{if } \gamma_k = 1 \\ (1-\alpha_k) \delta_0(\beta_k) \quad & \text{ow} \end{cases} \end{align*}\]

\(\phi_k = (\alpha_k, \mu_k, s_k^2)\).

\[\begin{align*} Var(\beta_k|\gamma_k = 1) &= s_k^2 = \frac{\sigma^2}{(X^\intercal X)_{kk} + 1/\sigma_{\beta}^2} \\ E(\beta_k | \gamma_k = 1) &= \mu_k = \frac{s_k^2}{\sigma^2} \left( (X^\intercal y)_k - \sum_{j \neq k}(X^\intercal X)_{jk} \alpha_j \mu_j \right) \\ \text{Posterior odds = Bayes factor × prior odds } \quad \frac{p(\gamma_k = 1|X, y, \theta)}{p(\gamma_k = 0|X, y, \theta)} &= \frac{\alpha_k}{1-\alpha_k} = \frac{\pi}{1-\pi} \times \frac{s_k}{\sigma_{\beta} \sigma} \times e^{SSR_k/2} \\ SSR_k &= \mu_{k}^2/s_k^2 \end{align*}\]

They use importance sampling to integrate over the hyperparameters.

Carbonetto, Peter, Matthew Stephens, and others. 2012. “Scalable Variational Inference for Bayesian Variable Selection in Regression, and Its Accuracy in Genetic Association Studies.” Bayesian Analysis 7 (1). International Society for Bayesian Analysis: 73–108.