Computes 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
)

Arguments

d

A numeric vector of observed wavelet coefficients. The calculation is vectorized, with one posterior calculation for each element.

pi_j

The prior probability of the point-mass spike at zero for the resolution level. It must lie in \([0,1]\).

omega_j

The conditional prior probability of the Wendland slab among nonzero coefficients. It must lie in \([0,1]\).

beta_j

The positive common support scale for the two continuous slabs.

sigma

The positive Gaussian noise standard deviation. It is used for the Gaussian likelihood and for Gaussian quadrature calculations.

likelihood

Either "gaussian" or "laplace".

laplace_rate

The positive rate \(\lambda\) used by the Laplace working likelihood. It is ignored when likelihood = "gaussian", but should still be supplied.

quadrature_n

The number of Gauss-Legendre nodes used for numerical integration.

use_exact_wendland

Logical value indicating whether the exact finite-sum Wendland formula should be used for Laplace moments.

Details

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.

Value

A list with one row or one entry per value of d:

log_marginal

The log marginal density \(\log D_j(d)\).

probability

A matrix with columns spike, wendland, and semicircle, containing posterior component probabilities.

posterior_mean

The posterior-mean shrinkage estimate \(\delta_j(d)\).

component_mean

A matrix containing the posterior means conditional on the Wendland and semicircle components.

component_log_m0

A matrix containing the log zeroth moments for the two continuous components.

quadrature_fallbacks

The number of Wendland coefficients for which the exact Laplace calculation used numerical fallback.

References

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>

Author

Nilotpal Sanyal

Examples

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