An implementation of the Dimension Independent Likelihood Informed subspace (DILI) MCMC sampler. More...
#include <DILIKernel.h>
An implementation of the Dimension Independent Likelihood Informed subspace (DILI) MCMC sampler.
Cui, T., Law, K. J., & Marzouk, Y. M. (2016). Dimension-independent likelihood-informed MCMC. Journal of Computational Physics, 304, 109-137.
Configuration Parameters:
Parameter Key | Type | Default Value | Description |
---|---|---|---|
"LIS Block" | String | - | A string pointing to a block of kernel/proposal options for the Likelihood informed subspace. |
"CS Block" | String | - | A string pointing to a block of kernel/proposal options for the Complementary space. Typically this will be a Crank-Nicolson proposal. |
"HessianType" | String | GaussNewton | The type of posterior Hessian to use. Either "Exact" or "GaussNewton" |
"Adapt Interval" | int | -1 | How many MCMC steps to take before updating the average Hessian and the likelihood informed subspace. If negative, the LIS will be fixed to the initial value and will not be udpated. |
"Adapt Start" | int | 1 | The number of MCMC steps taken before updating the LIS. |
"Adapt End" | int | -1 | No LIS updates will occur after this number of MCMC steps. If negative, the LIS will continue to be updated until the end of the chain. |
"Initial Weight" | int | 100 | "Weight" or number of samples given to the to initial Hessian. The weight on the previous average Hessian estimate is given by $(N+W)/(N+W+1)$, where $N$ is the number of MCMC steps taken and $W$ is this parameter. |
"Hess Tolerance" | double | 1e-4 | The lower bound on eigenvalues used to construct the low-rank approximation of the global expected Hessian. |
"LIS Tolerance" | double | 0.1 | Lower bound on eigenvalues used to construct local and global likelihood informed subspaces. Must be larger than Hess Tolerance. |
"Eigensolver Block" | String | - | A string pointing to a block of eigensolver options for solving the generalized eigenvalue problems. |
Definition at line 141 of file DILIKernel.h.
Public Member Functions | |
DILIKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem) | |
DILIKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem, Eigen::VectorXd const &genEigVals, Eigen::MatrixXd const &genEigVecs) | |
DILIKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem, std::shared_ptr< muq::Modeling::GaussianBase > const &prior, std::shared_ptr< muq::Modeling::ModPiece > const &noiseModel, std::shared_ptr< muq::Modeling::ModPiece > const &forwardModelIn) | |
DILIKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem, std::shared_ptr< muq::Modeling::GaussianBase > const &prior, std::shared_ptr< muq::Modeling::ModPiece > const &noiseModel, std::shared_ptr< muq::Modeling::ModPiece > const &forwardModelIn, Eigen::VectorXd const &genEigVals, Eigen::MatrixXd const &genEigVecs) | |
DILIKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem, std::shared_ptr< muq::Modeling::GaussianBase > const &prior, std::shared_ptr< muq::Modeling::ModPiece > const &likelihood) | |
DILIKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem, std::shared_ptr< muq::Modeling::GaussianBase > const &prior, std::shared_ptr< muq::Modeling::ModPiece > const &likelihood, Eigen::VectorXd const &genEigVals, Eigen::MatrixXd const &genEigVecs) | |
virtual | ~DILIKernel ()=default |
virtual std::shared_ptr< TransitionKernel > | LISKernel () |
virtual std::shared_ptr< TransitionKernel > | CSKernel () |
virtual void | PostStep (unsigned int const t, std::vector< std::shared_ptr< SamplingState >> const &state) override |
Allow the kernel to adapt given a new state. More... | |
virtual std::vector< std::shared_ptr< SamplingState > > | Step (unsigned int const t, std::shared_ptr< SamplingState > prevState) override |
virtual void | PrintStatus (std::string prefix) const override |
Eigen::MatrixXd const & | LISVecs () const |
Eigen::VectorXd const & | LISVals () const |
Eigen::MatrixXd const & | LISW () const |
Eigen::VectorXd const & | LISL () const |
unsigned int | LISDim () const |
void | CreateLIS (std::vector< Eigen::VectorXd > const &currState) |
Eigen::VectorXd | ToLIS (Eigen::VectorXd const &x) const |
Eigen::VectorXd | FromLIS (Eigen::VectorXd const &r) const |
Eigen::VectorXd | ToCS (Eigen::VectorXd const &x) const |
Public Member Functions inherited from muq::SamplingAlgorithms::TransitionKernel | |
TransitionKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem) | |
virtual | ~TransitionKernel ()=default |
virtual void | SetCommunicator (std::shared_ptr< parcer::Communicator > newcomm) |
virtual void | PreStep (unsigned int const t, std::shared_ptr< SamplingState > state) |
Allow the kernel to preprocess the current step. More... | |
virtual void | PrintStatus () const |
virtual void | SetBlockInd (int newBlockInd) |
virtual int | GetBlockInd () const |
virtual std::shared_ptr< AbstractSamplingProblem > const & | Problem () const |
Static Public Member Functions | |
static std::shared_ptr< muq::Modeling::ModPiece > | ExtractLikelihood (std::shared_ptr< AbstractSamplingProblem > const &problem, std::string const &nodeName) |
static std::shared_ptr< muq::Modeling::GaussianBase > | ExtractPrior (std::shared_ptr< AbstractSamplingProblem > const &problem, std::string const &nodeName) |
static std::shared_ptr< muq::Modeling::ModPiece > | ExtractNoiseModel (std::shared_ptr< muq::Modeling::ModPiece > const &likelihood) |
static std::shared_ptr< muq::Modeling::ModPiece > | ExtractForwardModel (std::shared_ptr< muq::Modeling::ModPiece > const &likelihoodIn) |
static std::shared_ptr< muq::Modeling::ModPiece > | CreateLikelihood (std::shared_ptr< muq::Modeling::ModPiece > const &forwardModel, std::shared_ptr< muq::Modeling::ModPiece > const &noiseDensity) |
Static Public Member Functions inherited from muq::SamplingAlgorithms::TransitionKernel | |
static std::shared_ptr< TransitionKernel > | Construct (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem) |
Static constructor for the transition kernel. More... | |
static std::shared_ptr< TransitionKernelMap > | GetTransitionKernelMap () |
Additional Inherited Members | |
Public Types inherited from muq::SamplingAlgorithms::TransitionKernel | |
typedef boost::function< std::shared_ptr< TransitionKernel >boost::property_tree::ptree, std::shared_ptr< AbstractSamplingProblem >)> | TransitionKernelConstructor |
typedef std::map< std::string, TransitionKernelConstructor > | TransitionKernelMap |
DILIKernel::DILIKernel | ( | boost::property_tree::ptree const & | pt, |
std::shared_ptr< AbstractSamplingProblem > | problem | ||
) |
Definition at line 71 of file DILIKernel.cpp.
DILIKernel::DILIKernel | ( | boost::property_tree::ptree const & | pt, |
std::shared_ptr< AbstractSamplingProblem > | problem, | ||
Eigen::VectorXd const & | genEigVals, | ||
Eigen::MatrixXd const & | genEigVecs | ||
) |
Definition at line 79 of file DILIKernel.cpp.
DILIKernel::DILIKernel | ( | boost::property_tree::ptree const & | pt, |
std::shared_ptr< AbstractSamplingProblem > | problem, | ||
std::shared_ptr< muq::Modeling::GaussianBase > const & | prior, | ||
std::shared_ptr< muq::Modeling::ModPiece > const & | noiseModel, | ||
std::shared_ptr< muq::Modeling::ModPiece > const & | forwardModelIn | ||
) |
Definition at line 92 of file DILIKernel.cpp.
References eigOpts.
DILIKernel::DILIKernel | ( | boost::property_tree::ptree const & | pt, |
std::shared_ptr< AbstractSamplingProblem > | problem, | ||
std::shared_ptr< muq::Modeling::GaussianBase > const & | prior, | ||
std::shared_ptr< muq::Modeling::ModPiece > const & | noiseModel, | ||
std::shared_ptr< muq::Modeling::ModPiece > const & | forwardModelIn, | ||
Eigen::VectorXd const & | genEigVals, | ||
Eigen::MatrixXd const & | genEigVecs | ||
) |
Definition at line 119 of file DILIKernel.cpp.
DILIKernel::DILIKernel | ( | boost::property_tree::ptree const & | pt, |
std::shared_ptr< AbstractSamplingProblem > | problem, | ||
std::shared_ptr< muq::Modeling::GaussianBase > const & | prior, | ||
std::shared_ptr< muq::Modeling::ModPiece > const & | likelihood | ||
) |
Definition at line 150 of file DILIKernel.cpp.
References eigOpts.
DILIKernel::DILIKernel | ( | boost::property_tree::ptree const & | pt, |
std::shared_ptr< AbstractSamplingProblem > | problem, | ||
std::shared_ptr< muq::Modeling::GaussianBase > const & | prior, | ||
std::shared_ptr< muq::Modeling::ModPiece > const & | likelihood, | ||
Eigen::VectorXd const & | genEigVals, | ||
Eigen::MatrixXd const & | genEigVecs | ||
) |
Definition at line 176 of file DILIKernel.cpp.
|
virtualdefault |
|
protected |
Definition at line 338 of file DILIKernel.cpp.
References muq::SamplingAlgorithms::TransitionKernel::blockInd, muq::Modeling::StochasticEigenSolver::compute(), muq::Modeling::GeneralizedEigenSolver::eigenvalues(), muq::Modeling::GeneralizedEigenSolver::eigenvectors(), eigOpts, forwardModel, hessType, lisDim, lisValTol, logLikelihood, noiseDensity, and prior.
Referenced by CreateLIS().
|
static |
Definition at line 519 of file DILIKernel.cpp.
References muq::Modeling::WorkGraph::AddEdge(), muq::Modeling::WorkGraph::AddNode(), muq::Modeling::WorkGraph::CreateModPiece(), forwardModel, and noiseDensity.
void DILIKernel::CreateLIS | ( | std::vector< Eigen::VectorXd > const & | currState | ) |
Create the likelihood informed subspace for the first time.
Definition at line 372 of file DILIKernel.cpp.
References ComputeLocalLIS(), numLisUpdates, and SetLIS().
Referenced by Step().
|
inlinevirtual |
Definition at line 182 of file DILIKernel.h.
References csKernel.
|
static |
Definition at line 481 of file DILIKernel.cpp.
|
static |
From a ModGraphPiece defining the posterior log density, this function extracts a ModGraphPiece defining the likelihood function.
Definition at line 498 of file DILIKernel.cpp.
References muq::SamplingAlgorithms::TransitionKernel::problem.
|
static |
Definition at line 471 of file DILIKernel.cpp.
|
static |
From a ModGraphPiece defining the posterior log density, this function extracts a GaussianBase instance defining the prior.
Definition at line 441 of file DILIKernel.cpp.
References muq::SamplingAlgorithms::TransitionKernel::problem.
Eigen::VectorXd DILIKernel::FromLIS | ( | Eigen::VectorXd const & | r | ) | const |
|
inline |
|
inlinevirtual |
Definition at line 181 of file DILIKernel.h.
References lisKernel.
|
inline |
Definition at line 216 of file DILIKernel.h.
References lisL.
|
inline |
Definition at line 214 of file DILIKernel.h.
References hessEigVals.
|
inline |
Definition at line 213 of file DILIKernel.h.
References hessU.
|
inline |
Definition at line 215 of file DILIKernel.h.
References hessW.
|
overridevirtual |
Allow the kernel to adapt given a new state.
By default this function does nothing but children can override it to adapt the kernel
[in] | t | The current step |
[in] | state | The current state |
Reimplemented from muq::SamplingAlgorithms::TransitionKernel.
Definition at line 206 of file DILIKernel.cpp.
References adaptEnd, adaptStart, numLisUpdates, updateInterval, and UpdateLIS().
|
overridevirtual |
Reimplemented from muq::SamplingAlgorithms::TransitionKernel.
Definition at line 295 of file DILIKernel.cpp.
|
protected |
Sets up the LIS based on the eigenvalues and eigenvectors solving the problem $Hu = \lambda \Gamma^{-1}u$
Definition at line 305 of file DILIKernel.cpp.
References hessEigVals, hessU, hessUQR, hessW, lisDim, lisL, lisValTol, prior, and UpdateKernels().
Referenced by CreateLIS(), DILIKernel(), and UpdateLIS().
|
overridevirtual |
[in] | t | The current step |
[in] | state | The current state |
Implements muq::SamplingAlgorithms::TransitionKernel.
Definition at line 235 of file DILIKernel.cpp.
References muq::SamplingAlgorithms::TransitionKernel::blockInd, CreateLIS(), csKernel, FromLIS(), hessU, lisDim, lisKernel, ToCS(), and ToLIS().
Eigen::VectorXd DILIKernel::ToCS | ( | Eigen::VectorXd const & | x | ) | const |
Eigen::VectorXd DILIKernel::ToLIS | ( | Eigen::VectorXd const & | x | ) | const |
|
protected |
Definition at line 383 of file DILIKernel.cpp.
References muq::SamplingAlgorithms::TransitionKernel::Construct(), csKernel, csKernelOpts, fullToCS, hessU, hessW, lisDim, lisKernel, lisKernelOpts, lisL, lisToFull, logLikelihood, and prior.
Referenced by SetLIS().
|
protected |
Update the likelihood informed subspace using Hessian information at a new point.
[in] | numSamps | The number of samples that have been used to estimate the current LIS. |
[in] | currState | The current state of the chain. |
Definition at line 413 of file DILIKernel.cpp.
References muq::SamplingAlgorithms::TransitionKernel::blockInd, muq::Modeling::StochasticEigenSolver::compute(), muq::Modeling::GeneralizedEigenSolver::eigenvalues(), muq::Modeling::GeneralizedEigenSolver::eigenvectors(), eigOpts, forwardModel, hessEigVals, hessType, hessUQR, hessValTol, hessW, initialHessSamps, logLikelihood, noiseDensity, prior, and SetLIS().
Referenced by PostStep().
|
protected |
Definition at line 307 of file DILIKernel.h.
Referenced by PostStep().
|
protected |
Definition at line 306 of file DILIKernel.h.
Referenced by PostStep().
|
protected |
Definition at line 297 of file DILIKernel.h.
Referenced by CSKernel(), PrintStatus(), Step(), and UpdateKernels().
|
protected |
Definition at line 264 of file DILIKernel.h.
Referenced by UpdateKernels().
|
protected |
Definition at line 303 of file DILIKernel.h.
Referenced by ComputeLocalLIS(), DILIKernel(), and UpdateLIS().
|
protected |
Definition at line 269 of file DILIKernel.h.
Referenced by ComputeLocalLIS(), CreateLikelihood(), and UpdateLIS().
|
protected |
Definition at line 291 of file DILIKernel.h.
Referenced by UpdateKernels().
|
protected |
Definition at line 279 of file DILIKernel.h.
Referenced by LISVals(), SetLIS(), and UpdateLIS().
|
protected |
Definition at line 300 of file DILIKernel.h.
Referenced by ComputeLocalLIS(), and UpdateLIS().
|
protected |
Definition at line 273 of file DILIKernel.h.
Referenced by FromLIS(), LISVecs(), SetLIS(), Step(), ToCS(), and UpdateKernels().
|
protected |
Definition at line 276 of file DILIKernel.h.
Referenced by SetLIS(), and UpdateLIS().
|
protected |
Definition at line 321 of file DILIKernel.h.
Referenced by UpdateLIS().
|
protected |
Definition at line 282 of file DILIKernel.h.
Referenced by LISW(), SetLIS(), ToCS(), ToLIS(), UpdateKernels(), and UpdateLIS().
|
protected |
Definition at line 308 of file DILIKernel.h.
Referenced by UpdateLIS().
|
protected |
Definition at line 315 of file DILIKernel.h.
Referenced by ComputeLocalLIS(), FromLIS(), LISDim(), PrintStatus(), SetLIS(), Step(), ToCS(), ToLIS(), and UpdateKernels().
|
protected |
Definition at line 294 of file DILIKernel.h.
Referenced by LISKernel(), PrintStatus(), Step(), and UpdateKernels().
|
protected |
Definition at line 263 of file DILIKernel.h.
Referenced by UpdateKernels().
|
protected |
Definition at line 285 of file DILIKernel.h.
Referenced by FromLIS(), LISL(), SetLIS(), ToLIS(), and UpdateKernels().
|
protected |
Definition at line 288 of file DILIKernel.h.
Referenced by UpdateKernels().
|
protected |
Definition at line 327 of file DILIKernel.h.
Referenced by ComputeLocalLIS(), and SetLIS().
|
protected |
Definition at line 266 of file DILIKernel.h.
Referenced by ComputeLocalLIS(), UpdateKernels(), and UpdateLIS().
|
protected |
Definition at line 270 of file DILIKernel.h.
Referenced by ComputeLocalLIS(), CreateLikelihood(), and UpdateLIS().
|
protected |
Definition at line 329 of file DILIKernel.h.
Referenced by CreateLIS(), and PostStep().
|
protected |
Definition at line 267 of file DILIKernel.h.
Referenced by ComputeLocalLIS(), SetLIS(), UpdateKernels(), and UpdateLIS().
|
protected |
Definition at line 305 of file DILIKernel.h.
Referenced by PostStep().