FEniCSDiffusion1D#
- class cuqipy_fenics.testproblem.FEniCSDiffusion1D(dim=100, endpoint=1, exactSolution=None, SNR=100, observation_operator=None, mapping=None, left_bc=0, right_bc=1)#
1D Diffusion PDE problem using FEniCS. The problem has Dirichlet boundary conditions.
- Parameters:
dim (int, Default 100) – Dimension of the 1D problem
endpoint (float, Default 1) – Endpoint of the 1D grid (starts at 0).
exactSolution (ndarray, CUQIarray, Default None) – Exact solution used to generate data. If None a default exact solution is chosen.
SNR (float, Default 100) – Signal-to-noise ratio.
mapping (str or callable) – mapping to parametrize the Bayesian parameters. If provided as string, it can take one of the values: [‘exponential’]
- data#
Generated (noisy) data
- Type:
ndarray
- model#
The forward model
- Type:
cuqi.model.Model
- prior#
Distribution of the prior (Default = None)
- Type:
cuqi.distribution.Distribution
- likelihood#
Likelihood function.
- Type:
cuqi.likelihood.Likelihood
- exactSolution#
Exact solution (ground truth)
- Type:
ndarray
- exactData#
Noise free data
- Type:
ndarray
- infoSring#
String with information about the problem, noise etc.
- Type:
str
- MAP()#
Compute MAP estimate of posterior. NB: Requires prior to be defined.
- sample_posterior(Ns)#
Sample Ns samples of the posterior. NB: Requires prior to be defined.
- __init__(dim=100, endpoint=1, exactSolution=None, SNR=100, observation_operator=None, mapping=None, left_bc=0, right_bc=1)#
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, experimental])Run an Uncertainty Quantification (UQ) analysis on the Bayesian problem and provide a summary of the results.
__init__
([dim, endpoint, exactSolution, ...])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
Extract the observed data from likelihood
The likelihood function.
Extract the cuqi model from likelihood.
Create posterior distribution from likelihood and prior.
The prior distribution