Movatterモバイル変換


[0]ホーム

URL:


ebnm: Solvethe empirical Bayes normal means problem

Travis Build StatusAppveyor Build statusCircleCI build statuscodecov

Theebnm package provides functions to solve the(heteroskedastic) “empirical Bayes normal means” (EBNM) problem forvarious choices of prior family. The model is

\[ x_j \ | \ θ_j,\ s_j \sim N(θ_j,\ s_j^2)\]

\[ θ_j \ | \ s_j \sim g \in \mathcal{G}\]

where the distribution\(g\) is tobe estimated. The distribution\(g\) isreferred to as the “prior distribution” for\(θ\) and\(\mathcal{G}\) is a specified family ofprior distributions. Several options for\(\mathcal{G}\) are implemented, someparametric and others non-parametric; see below for examples.

Solving the EBNM problem involves two steps. First, estimate\(g \in \mathcal{G}\) via maximum marginallikelihood, yielding an estimate

\[ \hat{g} := \arg\max_{g \in\mathcal{G}}\ L(g) \]

where

\[ L(g):= \Pi_j\ \int\ p(x_j \ | \ θ_j,\s_j)\ g(dθ_j) \]

Second, compute the posterior distributions\(p(θ_j \ | \ x_j,\ s_j,\ \hat{g})\) and/orsummaries such as posterior means and posterior second moments.

The prior families that have been implemented include:

“point_normal”: The family of mixtures where one component is a pointmass at\(μ\) and the other is a normaldistribution centered at\(μ\).

“point_laplace”: The family of mixtures where one component is apoint mass at zero and the other is a double-exponentialdistribution.

“point_exponential”: The family of mixtures where one component is apoint mass at zero and the other is a (nonnegative) exponentialdistribution.

“normal”: The family of normal distributions.

“horseshoe”: The family of horseshoe distributions.

“normal_scale_mixture”: The family of scale mixtures of normals.

“unimodal”: The family of all unimodal distributions.

“unimodal_symmetric”: The family of symmetric unimodaldistributions.

“unimodal_nonnegative”: The family of unimodal distributions withsupport constrained to be greater than the mode.

“unimodal_nonpositive”: The family of unimodal distributions withsupport constrained to be less than the mode.

“generalized_binary”: The family of mixtures where one component is apoint mass at zero and the other is a truncated normal distribution withlower bound zero and nonzero mode.

“npmle”: The family of all distributions.

“deconvolver”: A non-parametric exponential family with a naturalspline basis. Like npmle, there is no unimodal assumption, but whereasnpmle produces spiky estimates for\(g\), deconvolver estimates are much moreregular. See Narasimhan and Efron (2020) for details.

“flat”: A “non-informative” improper uniform prior.

“point_mass”: The family of all point masses.

License

Theebnm source code repository is free software: you canredistribute it under the terms of theGNU General PublicLicense. All the files in this project are part ofebnm.This project is distributed in the hope that it will be useful, butwithout any warranty; without even the implied warrantyofmerchantability or fitness for a particularpurpose.

Quick Start

Install the ebnm package:

install.packages("ebnm")

Loadebnm into your R environment, and get help:

library(ebnm)?ebnm

Try an example:

set.seed(1)theta=c(rep(0,500),rnorm(500))# true meansx= theta+rnorm(1000)# observations with standard error 1ebnm_res=ebnm_point_normal(x,1)plot(ebnm_res)

[8]ページ先頭

©2009-2025 Movatter.jp