stephens999 / ashr

An R package for adaptive shrinkage
GNU General Public License v3.0
80 stars 36 forks source link

Default Prior is Described Incorrectly in Documentation #136

Closed eweine closed 2 years ago

eweine commented 2 years ago

In the documentation for ash the entry for prior indicates that it defaults to the uniform. However, I was suspicious of this because the first entry in the default parameters list is "nullbiased". Indeed, I confirmed that nullbiased is actually the prior. This can be seen with the code below:

set.seed(1)
x <- c(rnorm(100, 0, 1), rep(0, 100))
y <- x + rnorm(200)
ash_fit_default <- ashr::ash(y, rep(1, 200))
ash_fit_unif <- ashr::ash(y, rep(1, 200), prior = "uniform")
ash_fit_nullbiased <- ashr::ash(y, rep(1, 200), prior = "nullbiased")
pcarbo commented 2 years ago

The convention in R is that the default is the first setting in the list, so we don't actually need to say explicitly:

prior = c("nullbiased", "uniform", "unit")