level_posterior.RdComputes the complete three-component posterior for a vector of observed wavelet coefficients at one resolution level.
level_posterior(
d,
pi_j,
omega_j,
beta_j,
sigma,
likelihood,
laplace_rate,
quadrature_n,
use_exact_wendland
)A numeric vector of observed wavelet coefficients. The calculation is vectorized, with one posterior calculation for each element.
The prior probability of the point-mass spike at zero for the resolution level. It must lie in \([0,1]\).
The conditional prior probability of the Wendland slab among nonzero coefficients. It must lie in \([0,1]\).
The positive common support scale for the two continuous slabs.
The positive Gaussian noise standard deviation. It is used for the Gaussian likelihood and for Gaussian quadrature calculations.
Either "gaussian" or "laplace".
The positive rate \(\lambda\) used by the Laplace
working likelihood. It is ignored when likelihood =
"gaussian", but should still be supplied.
The number of Gauss-Legendre nodes used for numerical integration.
Logical value indicating whether the exact finite-sum Wendland formula should be used for Laplace moments.
The continuous slab is $$ g_j(\theta)=\omega_j g_W(\theta;\beta_j) +(1-\omega_j)g_S(\theta;\beta_j). $$ For component \(c\in\{W,S\}\), define $$ M_{r,c,j}(d)=\int_{-\beta_j}^{\beta_j} \theta^r g_c(\theta;\beta_j)L(d\mid\theta)\,d\theta, \qquad r\in\{0,1\}. $$ The posterior component probabilities are $$ p_{0,j}(d)=\frac{\pi_jL(d\mid0)}{D_j(d)},\quad p_{W,j}(d)=\frac{(1-\pi_j)\omega_jM_{0,W,j}(d)}{D_j(d)},\quad p_{S,j}(d)=\frac{(1-\pi_j)(1-\omega_j)M_{0,S,j}(d)}{D_j(d)}, $$ where $$ D_j(d)=\pi_jL(d\mid0)+(1-\pi_j) \{\omega_jM_{0,W,j}(d)+(1-\omega_j)M_{0,S,j}(d)\}. $$ The returned posterior mean is $$ \delta_j(d)=p_{W,j}(d)\mu_{W,j}(d) +p_{S,j}(d)\mu_{S,j}(d), \qquad \mu_{c,j}(d)=M_{1,c,j}(d)/M_{0,c,j}(d). $$ The spike contributes zero to this posterior mean. Computations are performed on the log scale where appropriate to reduce numerical underflow. Endpoint cases such as \(\pi_j=1\) or \(\omega_j=0\) are handled explicitly.
A list with one row or one entry per value of d:
log_marginalThe log marginal density \(\log D_j(d)\).
probabilityA matrix with columns spike,
wendland, and semicircle, containing posterior component
probabilities.
posterior_meanThe posterior-mean shrinkage estimate \(\delta_j(d)\).
component_meanA matrix containing the posterior means conditional on the Wendland and semicircle components.
component_log_m0A matrix containing the log zeroth moments for the two continuous components.
quadrature_fallbacksThe number of Wendland coefficients for which the exact Laplace calculation used numerical fallback.
Sanyal, N. (2026). Resolution-Adaptive Compact-Support Priors for Bayesian Wavelet Denoising: A Wendland-Semicircle Slab Mixture for Low-SNR Signal Recovery. Axioms, 15(9), 678. <DOI:10.3390/axioms15090678>
d <- c(-1, 0, 1)
post <- level_posterior(
d = d,
pi_j = 0.75,
omega_j = 0.5,
beta_j = 2,
sigma = 1,
likelihood = "gaussian",
laplace_rate = 0.5,
quadrature_n = 24L,
use_exact_wendland = TRUE
)
post$posterior_mean
#> [1] -9.558009e-02 -6.147970e-18 9.558009e-02
post$probability
#> spike wendland semicircle
#> [1,] 0.7599115 0.1248556 0.11523293
#> [2,] 0.7942359 0.1165886 0.08917549
#> [3,] 0.7599115 0.1248556 0.11523293