#[non_exhaustive]pub enum Prior {
Discrete {
points: Vec<C64>,
probs: Vec<f64>,
},
BernoulliGaussian {
rho: f64,
},
}Expand description
The prior of every entry of $x$.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Discrete
Points of an alphabet and their probabilities.
BernoulliGaussian
$(1 - \rho)\, \delta(x) + \rho\, \mathcal{N}(0, 1/\rho)$: sparse, of unit variance (Ma & Ping, eq. 43).
Implementations§
Source§impl Prior
impl Prior
Sourcepub fn uniform(c: &Constellation) -> Prior
pub fn uniform(c: &Constellation) -> Prior
Equally likely points of a constellation.
Sourcepub fn with_probs(c: &Constellation, px: Option<&[f64]>) -> Result<Prior>
pub fn with_probs(c: &Constellation, px: Option<&[f64]>) -> Result<Prior>
The points of a constellation with the probabilities px (normalised;
uniform if None).
§Errors
Those of Constellation::priors.
Sourcepub fn bernoulli_gaussian(rho: f64) -> Result<Prior>
pub fn bernoulli_gaussian(rho: f64) -> Result<Prior>
The Bernoulli-Gaussian prior of sparsity rho.
§Errors
comnum_core::Error::Config unless $0 < \rho \le 1$.
Sourcepub fn denoise(&self, r: C64, tau: f64, domain: Domain) -> (C64, f64)
pub fn denoise(&self, r: C64, tau: f64, domain: Domain) -> (C64, f64)
The posterior mean $F(r, \tau)$ and variance $G(r, \tau)$ of $x$ from
$r = x + n$, $n$ of variance $\tau$ in domain (see the module).
Sourcepub fn mse(&self, noise_var: f64, gamma2: f64, domain: Domain) -> (f64, f64)
pub fn mse(&self, noise_var: f64, gamma2: f64, domain: Domain) -> (f64, f64)
The MSE function $\Psi(\sigma^{2}, \gamma^{2})$ and the variance function $\Phi(\sigma^{2}, \gamma^{2})$ of the denoiser applied with the variance $\gamma^{2}$ to $S + \sigma Z$ (see the module), by Gauss–Hermite quadrature.