Deconvolution1D#

class cuqi.testproblem.Deconvolution1D(dim=128, PSF='gauss', PSF_param=None, PSF_size=None, BC='periodic', phantom='sinc', phantom_param=None, noise_type='gaussian', noise_std=0.01, prior=None, use_legacy=False)#

Create a 1D periodic deconvolution test problem defined by the inverse problem

\[\mathbf{b} = \mathbf{A}\mathbf{x},\]

where \(\mathbf{b}\) is a (noisy) convolved signal, \(\mathbf{x}\) is a sharp (clean) signal and \(\mathbf{A}\) is a convolution operator.

The convolution operator is defined by specifying a point spread function and boundary conditions and is computed via scipy.ndimage.convolve1D. By default, the matrix representation of the convolution operator is computed and stored.

The inputs are padded to fit the boundary conditions. https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.convolve1d.html

Parameters:
  • dim (int, default 128) – size of the (dim,dim) deconvolution problem

  • PSF (string or ndarray, default 'Gauss') –

    Determines type of the underlying point spread function (PSF).
    Depending if use_legacy is True or False, the following options are available:
    ’Gauss’ - a 1D Gaussian blur function
    ’Moffat’ - a 1D Moffat blur function (non-LEGACY only)
    ’Defocus’ - an out-of-focus 1D blur function (non-LEGACY only)
    ’sinc’ or ‘prolate’ - a sinc function (LEGACY only)
    ’vonMises’ - a periodic version of the Gauss function (LEGACY only)
    ndarray - a custom PSF represented as a 1D ndarray.

  • PSF_param (scalar, default depends on PSF) –

    A parameter that determines the shape of the PSF;
    the larger the parameter, the larger the blur on the signal.
    Ignored if PSF is a ndarray.

  • PSF_size (int, default equal to dim) –

    The size of the PSF.
    Ignored if PSF is a ndarray.

  • BC (string, default 'periodic') –

    Boundary conditions for the convolution.
    ’zero’ - zero boundary conditions
    ’periodic’ - periodic boundary conditions
    ’Mirror’ - Reflected around center of last pixel boundary conditions
    ’Reflect’ - Reflected around edge of last pixel boundary conditions
    ’Nearest’ - Replicates last element of boundary

  • phantom (string or ndarray, default 'sinc') –

    The phantom that is sampled to produce the exact solution (signal).
    ’Gauss’ - a Gaussian function
    ’sinc’ - a sinc function
    ’vonMises’ - a periodic version of the Gauss function
    ’square’ - a “top hat” function
    ’hat’ - a triangular hat function
    ’bumps’ - two bumps
    ’derivGauss’ - the first derivative of Gauss function
    ’pc’ - Piece-wise constant phantom
    ’skyscraper’ - Piece-wise constant phantom with multiple peaks
    ndarray - a custom phantom

  • phantom_param (scalar, default depends on phantom) –

    A parameter that determines the horizontal scaling of the
    function; the larger the parameter the more horizontally
    compressed. Does not apply to phantom = ‘bumps’, ‘pc’, ‘skyscraper’ or ndarray.

  • noise_type (string, default 'gaussian') –

    The type of noise
    ”Gaussian” - Additive Gaussian white noise¨
    ”scaledGaussian” - Gaussian noise with standard deviation
    scaled by magnitude of the data for each
    point.

  • noise_std (scalar, default 0.01) – Standard deviation of the noise

  • prior (cuqi.distribution.Distribution, Default Gaussian) – Distribution of the prior

  • use_legacy (bool, Default False) – If True, use the legacy matrix representation of the forward model. The legacy representation has different choices for the PSF. The data is scaled differently than the non-legacy representation.

__init__(dim=128, PSF='gauss', PSF_param=None, PSF_size=None, BC='periodic', phantom='sinc', phantom_param=None, noise_type='gaussian', noise_std=0.01, prior=None, use_legacy=False)#

Methods

MAP([disp, x0])

Compute the Maximum A Posteriori (MAP) estimate of the posterior.

ML([disp, x0])

Compute the Maximum Likelihood (ML) estimate of the posterior.

UQ([Ns, Nb, percent, exact])

Run an Uncertainty Quantification (UQ) analysis on the Bayesian problem and provide a summary of the results.

__init__([dim, PSF, PSF_param, PSF_size, ...])

get_components()

Method that returns the model, the data and additional information to be used in formulating the Bayesian problem.

sample_posterior(Ns[, Nb, callback])

Sample the posterior.

sample_prior(Ns[, callback])

Sample the prior distribution.

set_data(**kwargs)

Set the data of the problem.

Attributes

data

Extract the observed data from likelihood

likelihood

The likelihood function.

model

Extract the cuqi model from likelihood.

posterior

Create posterior distribution from likelihood and prior.

prior

The prior distribution