ash_pois | R Documentation |
Uses Empirical Bayes to fit the model
y_j | \lambda_j ~ Poi(c_j \lambda_j)
with
h(lambda_j) ~ g()
where h
is a specified link function (either "identity" or "log" are permitted).
ash_pois(y, scale = 1, link = c("identity", "log"), ...)
y |
vector of Poisson observations. |
scale |
vector of scale factors for Poisson observations: the model is |
link |
string, either "identity" or "log", indicating the link function. |
... |
other parameters to be passed to ash |
The model is fit in two stages: i) estimate g
by maximum likelihood (over the set of symmetric
unimodal distributions) to give estimate \hat{g}
;
ii) Compute posterior distributions for \lambda_j
given y_j,\hat{g}
.
Note that the link function h
affects the prior assumptions (because, e.g., assuming a unimodal prior on \lambda
is
different from assuming unimodal on \log\lambda
), but posterior quantities are always computed for the
for \lambda
and *not* h(\lambda)
.
beta = c(rep(0,50),rexp(50))
y = rpois(100,beta) # simulate Poisson observations
y.ash = ash_pois(y,scale=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.