hippylib2muq.utility package

Submodules

hippylib2muq.utility.conversion module

This module provides type conversions for the proper use of dependent packages.

hippylib2muq.utility.conversion.const_dlVector(mat, dim)

Construct and initialize a dolfin vector so that it is compatible with matrix \(A\) for the multiplication \(Ax = b\).

Parameters
  • mat (dolfin:matrix) – a dolfin:matrix

  • dim (int) – 0 for b and 1 for x

Returns

an initialized dolfin:vector which is compatiable with mat

hippylib2muq.utility.conversion.dlVector2npArray(vec)

Convert a dolfin:vector to a numpy:ndarray.

Parameters

vec (dolfin:vector) – a dolfin:vector

Returns

converted numpy:ndarray

hippylib2muq.utility.conversion.npArray2dlVector(arr, vec)

Assign values of numpy:ndarray to dolfin:vector.

Parameters
  • arr (numpy:ndarray) – a numpy:ndarray

  • vec (dolfin:vector) – a dolfin:vector assigned by arr

hippylib2muq.utility.postprocessing module

This module provides postprocessing related functions.

hippylib2muq.utility.postprocessing.plot_qoiResult(method_list, qoi_dataset, max_lag=None)

Plot the result of MCMC simulations for the quantity of interest

Parameters
  • method_list (dictionary) – the discriptions of MCMC methods used

  • qoi_dataset (dictionary) – a dictionary returned from a call of hippymuq:track_qoiTracer

  • max_lag (int) – maximum of time lag for computing the autocorrelation function

hippylib2muq.utility.postprocessing.print_methodDict(method_list)

Print the method descriptions formatted for the MCMC simulation.

For MCMC kernel, abbreviations mean –

Name

MCMC kernel

mh

Metropolis-Hastings

dr

Delayed Rejection

For MCMC proposal, abbreviations mean –

Name

MCMC proposal

pcn

Preconditioned Crank-Nicolson

mala

preconditioned Metropolis Adjusted Langevin Algorithm

Note that this auxiliary function is only for the MCMC kernels and proposals listed in the above tables, but other MCMC methods such as Dimension-independent likelihood-informed MCMC are also available for use.

Parameters

method_list (dictionary) – the discriptions of MCMC methods

hippylib2muq.utility.postprocessing.print_qoiResult(method_list, qoi_dataset)

Print the result of MCMC simulations for the quantity of interest.

Parameters
  • method_list (dictionary) – the discriptions of MCMC methods used

  • qoi_dataset (dictionary) – a dictionary returned from a call of hippymuq:track_qoiTracer

Module contents