Package: ebnm 1.1-42

Peter Carbonetto

ebnm: Solve the Empirical Bayes Normal Means Problem

Provides simple, fast, and stable functions to fit the normal means model using empirical Bayes. For available models and details, see function ebnm(). Our JSS article, Willwerscheid, Carbonetto, and Stephens (2025) <doi:10.18637/jss.v114.i03>, provides a detailed introduction to the package.

Authors:Jason Willwerscheid [aut], Matthew Stephens [aut], Peter Carbonetto [aut, cre], Andrew Goldstein [ctb], Yusha Liu [ctb]

ebnm_1.1-42.tar.gz
ebnm_1.1-42.zip(r-4.7)ebnm_1.1-42.zip(r-4.6)ebnm_1.1-42.zip(r-4.5)
ebnm_1.1-42.tgz(r-4.6-any)ebnm_1.1-42.tgz(r-4.5-any)
ebnm_1.1-42.tar.gz(r-4.7-any)ebnm_1.1-42.tar.gz(r-4.6-any)
ebnm_1.1-42.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION
card.svg |card.png
ebnm/json (API)

# Install 'ebnm' in R:
install.packages('ebnm', repos = c('https://stephenslab.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/stephenslab/ebnm/issues

Datasets:
  • wOBA - 2022 MLB wOBA Data

On CRAN:

Conda:

8.29 score 13 stars 2 packages 276 scripts 288 downloads 28 exports 38 dependencies

Last updated from:825edf1e30. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK190
source / vignettesOK723
linux-release-x86_64OK159
macos-release-arm64OK135
macos-oldrel-arm64OK137
windows-develOK161
windows-releaseOK134
windows-oldrelOK121
wasm-releaseOK110

Exports:ebnmebnm_add_samplerebnm_ashebnm_check_fnebnm_deconvolverebnm_flatebnm_generalized_binaryebnm_groupebnm_horseshoeebnm_normalebnm_normal_scale_mixtureebnm_npmleebnm_output_allebnm_output_defaultebnm_point_exponentialebnm_point_laplaceebnm_point_massebnm_point_normalebnm_scale_normalmixebnm_scale_npmleebnm_scale_unimixebnm_unimodalebnm_unimodal_nonnegativeebnm_unimodal_nonpositiveebnm_unimodal_symmetricgammamixhorseshoelaplacemix

Dependencies:ashrclicpp11deconvolveRdplyretrunctfarvergenericsggplot2gluegtableinvgammairlbaisobandlabelinglatticelifecyclemagrittrMatrixmixsqppillarpkgconfigR6RColorBrewerRcppRcppArmadillorlangS7scalesSQUAREMtibbletidyselecttruncnormtrustutf8vctrsviridisLitewithr

Extending ebnm with custom ebnm-style functions
The scaled-t prior family | Overview of the implementation process | Step 1: Define the prior family class | Step 2: Implement the optimization function | (Optional) Include gradients in the optimization | Step 3: Implement the posterior summary function | Step 4: Put it all together | Step 5: Verify the EBNM function | Step 6: Use the new EBNM function to analyze a data set | Session information

Last update: 2025-09-04
Started: 2024-03-13

Introduction to the empirical Bayes normal means model via shrinkage estimation
The normal means model and empirical Bayes | An illustration: shrinkage estimation | Session information | References

Last update: 2025-09-04
Started: 2024-02-12

An analysis of weighted on-base averages using the ebnm package
The "wOBA" data set | The "ebnm" function | Comparing different priors | Reanalyzing the data using a nonparametric prior | Background on the "weighted on-base average" | Session information | References

Last update: 2024-03-13
Started: 2024-02-15

Readme and manuals

Help Manual

Help pageTopics
Extract posterior means from a fitted EBNM modelcoef.ebnm
Obtain credible intervals using a fitted EBNM modelconfint.ebnm
Solve the EBNM problemebnm ebnm_output_all ebnm_output_default
Add sampler to an ebnm_objectebnm_add_sampler
Solve the EBNM problem using an ash family of distributionsebnm_ash
Check a custom ebnm functionebnm_check_fn
Solve the EBNM problem using the "deconvolveR" family of distributionsebnm_deconvolver
Solve the EBNM problem using a flat priorebnm_flat
Solve the EBNM problem using generalized binary priorsebnm_generalized_binary
Solve the EBNM problem for grouped dataebnm_group
Solve the EBNM problem using horseshoe priorsebnm_horseshoe
Solve the EBNM problem using normal priorsebnm_normal
Solve the EBNM problem using scale mixtures of normalsebnm_normal_scale_mixture
Solve the EBNM problem using the family of all distributionsebnm_npmle
Solve the EBNM problem using point-exponential priorsebnm_point_exponential
Solve the EBNM problem using point-Laplace priorsebnm_point_laplace
Solve the EBNM problem using a point mass priorebnm_point_mass
Solve the EBNM problem using point-normal priorsebnm_point_normal
Set scale parameter for scale mixtures of normalsebnm_scale_normalmix
Set scale parameter for NPMLE and deconvolveR prior familyebnm_scale_npmle
Set scale parameter for nonparametric unimodal prior familiesebnm_scale_unimix
Solve the EBNM problem using unimodal distributionsebnm_unimodal
Solve the EBNM problem using unimodal nonnegative distributionsebnm_unimodal_nonnegative
Solve the EBNM problem using unimodal nonpositive distributionsebnm_unimodal_nonpositive
Solve the EBNM problem using symmetric unimodal distributionsebnm_unimodal_symmetric
Extract posterior estimates from a fitted EBNM modelfitted.ebnm
Constructor for gammamix classgammamix
Constructor for horseshoe classhorseshoe
Constructor for laplacemix classlaplacemix
Extract the log likelihood from a fitted EBNM modellogLik.ebnm
Get the number of observations used to fit an EBNM modelnobs.ebnm
Plot an ebnm objectplot.ebnm
Use the estimated prior from a fitted EBNM model to solve the EBNM problem for new datapredict.ebnm
Print an ebnm objectprint.ebnm
Print a summary.ebnm objectprint.summary.ebnm
Obtain posterior quantiles using a fitted EBNM modelquantile.ebnm
Calculate residuals for a fitted EBNM modelresiduals.ebnm
Sample from the posterior of a fitted EBNM modelsimulate.ebnm
Summarize an ebnm objectsummary.ebnm
Extract posterior variances from a fitted EBNM modelvcov.ebnm
2022 MLB wOBA DatawOBA