This repository contains an R package for performing "Adaptive Shrinkage."
To install the ashr package first you need to install devtools
install.packages("devtools")
library(devtools)
install_github("stephens999/ashr")
The main function in the ashr package is ash
. To get minimal help:
> library(ashr)
> ?ash
The ashr (Adaptive SHrinkage") package aims to provide simple, generic, and flexible methods to derive
shrinkage-based" estimates and credible intervals for unknown quantities
The ``adaptive" nature of the shrinkage is two-fold. First, the appropriate amount of shrinkage is determined from the data, rather than being pre-specified. Second, the amount of shrinkage undergone by each
As an important special case, these methods address the "multiple comparisons" setting, where interest focuses on which
The methods are based on treating the vectors
Specifically,
we assume that the true
The key assumption is that
Then, given
We fit this hierarchical model using the following "Empirical Bayes" approach. First we estimate the hyper-parameters
These conditional distributions can be conveniently summarized in various ways, including point estimates (e.g. the posterior means or medians), and credible intervals/regions.
The key components of this hierarchical model
are the distribution
-
The likelihood for
$\beta_j$ is t, with known degrees of freedom, centered on$\hat\beta_j$ , with scale parameter$s_j$ . -
The distribution
$g(\cdot; \pi)$ is a mixture of zero-centered normal distributions, or zero-centered uniform distributions. For example, for the normals we would have:$$g(\cdot; \pi) = \sum_{k=1}^K pi_k N(\cdot; 0, \sigma^2_k).$$ In practice, we currently fix the number of components$K$ to be large, and take the variances$\sigma_1<\sigma_2<\dots<\sigma_K$ to be fixed, and vary from very small (possibly 0), to very large -- sufficiently large that typically$\hat\pi_K=0$ .