Skip to content

R package to fit the "Empirical Bayes Poisson Means" model.

Notifications You must be signed in to change notification settings

stephenslab/ebpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ebpm

R package to fit the Empirical Bayes Poisson Means model:

x_i \sim Pois(s_i \lambda_i), i = 1 ... n

\lambda_i \sim g(.)

where x_i, s_i are known, and we want to estimate \lambda_i s. This is analogous to the Normal Means problem.

See model details and derivation in https://zihao12.github.io/ebpmf_demo/ebpm.pdf

Currently implemented methods are: ebpm_point_gamma, ebpm_two_gamma, ebpm_point_gamma, ebpm_gamma_mixture_single_scale, ebpm_exponential_mixture

Quick Start

Install the ebpm package using devtools:

## install.packages("gsl") ## install `gsl` if it is not installed
library(devtools)
install_github("stephenslab/ebpm")
beta = c(rep(0,50),rexp(50))
x = rpois(100,beta) # simulate Poisson observations
s = replicate(100,1)
## there are the following options: `ebpm_exponential_mixture`, `ebpm_gamma_mixture_single_scale`,`ebpm_point_gamma`, `ebpm_two_gamma`
out = ebpm_exponential_mixture(x,s,m=2)
plot(x, out$posterior$mean)

vignettes: https://zihao12.github.io/ebpmf_demo/vignette_ebpm.html

a comparison with the method proposed in "Bayesian inference on quasi-sparse count data": https://zihao12.github.io/ebpmf_demo/compare_GH.html

About

R package to fit the "Empirical Bayes Poisson Means" model.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages