#include <ExpensiveSamplingProblem.h>
Definition at line 16 of file ExpensiveSamplingProblem.h.
Public Member Functions | |
ExpensiveSamplingProblem (std::shared_ptr< muq::Modeling::ModPiece > const &target, std::shared_ptr< muq::Modeling::ModPiece > const &qoi, Eigen::VectorXd const ¢roid, boost::property_tree::ptree pt) | |
ExpensiveSamplingProblem (std::shared_ptr< muq::Modeling::ModPiece > const &target, std::shared_ptr< muq::Modeling::ModPiece > const &qoi, boost::property_tree::ptree pt) | |
ExpensiveSamplingProblem (std::shared_ptr< muq::Modeling::ModPiece > const &target, boost::property_tree::ptree pt) | |
ExpensiveSamplingProblem (std::shared_ptr< muq::Modeling::ModPiece > const &target, Eigen::VectorXd const ¢roid, boost::property_tree::ptree pt) | |
ExpensiveSamplingProblem (std::shared_ptr< muq::Modeling::ModPiece > const &target, boost::property_tree::ptree pt, std::shared_ptr< parcer::Communicator > comm) | |
ExpensiveSamplingProblem (std::shared_ptr< muq::Modeling::ModPiece > const &target, Eigen::VectorXd const ¢roid, boost::property_tree::ptree pt, std::shared_ptr< parcer::Communicator > comm) | |
virtual | ~ExpensiveSamplingProblem ()=default |
virtual double | LogDensity (std::shared_ptr< SamplingState > const &state) override |
unsigned int | CacheSize () const |
virtual void | AddOptions (boost::property_tree::ptree &pt) const override |
virtual std::shared_ptr< SamplingState > | QOI () override |
Public Member Functions inherited from muq::SamplingAlgorithms::SamplingProblem | |
SamplingProblem (std::shared_ptr< muq::Modeling::ModPiece > const &targetIn) | |
SamplingProblem (std::shared_ptr< muq::Modeling::ModPiece > const &targetIn, std::shared_ptr< muq::Modeling::ModPiece > const &qoiIn) | |
virtual | ~SamplingProblem ()=default |
virtual std::shared_ptr< AbstractSamplingProblem > | Clone () const override |
virtual Eigen::VectorXd | GradLogDensity (std::shared_ptr< SamplingState > const &state, unsigned const blockWrt) override |
std::shared_ptr< muq::Modeling::ModPiece > | GetDistribution () |
Public Member Functions inherited from muq::SamplingAlgorithms::AbstractSamplingProblem | |
AbstractSamplingProblem (Eigen::VectorXi const &blockSizesIn, Eigen::VectorXi const &blockSizesQOIIn) | |
AbstractSamplingProblem (Eigen::VectorXi const &blockSizesIn) | |
virtual | ~AbstractSamplingProblem ()=default |
Public Attributes | |
unsigned int | cumbeta = 0 |
Cumulative beta refinements. More... | |
unsigned int | cumgamma = 0 |
Cumulative gamma refinements. More... | |
unsigned int | cumkappa = 0 |
Cumulative kappa refinements. More... | |
double | lastLyapunov = 0.0 |
The Lyapunov function at the most recently accepted point. More... | |
double | lastThreshold = 0.0 |
The error threshold at the most recently accepted point. More... | |
Public Attributes inherited from muq::SamplingAlgorithms::AbstractSamplingProblem | |
const int | numBlocks |
const Eigen::VectorXi | blockSizes |
const int | numBlocksQOI |
const Eigen::VectorXi | blockSizesQOI |
muq::SamplingAlgorithms::ExpensiveSamplingProblem::ExpensiveSamplingProblem | ( | std::shared_ptr< muq::Modeling::ModPiece > const & | target, |
std::shared_ptr< muq::Modeling::ModPiece > const & | qoi, | ||
Eigen::VectorXd const & | centroid, | ||
boost::property_tree::ptree | pt | ||
) |
[in] | target | The target distribution |
[in] | qoi | The quantity of interest |
[in] | centroid | The centroid of the distribution |
[in] | pt | Options for the sampling problem |
muq::SamplingAlgorithms::ExpensiveSamplingProblem::ExpensiveSamplingProblem | ( | std::shared_ptr< muq::Modeling::ModPiece > const & | target, |
std::shared_ptr< muq::Modeling::ModPiece > const & | qoi, | ||
boost::property_tree::ptree | pt | ||
) |
[in] | target | The target distribution |
[in] | qoi | The quantity of interest |
[in] | pt | Options for the sampling problem |
muq::SamplingAlgorithms::ExpensiveSamplingProblem::ExpensiveSamplingProblem | ( | std::shared_ptr< muq::Modeling::ModPiece > const & | target, |
boost::property_tree::ptree | pt | ||
) |
[in] | target | The target distribution |
[in] | pt | Options for the sampling problem |
muq::SamplingAlgorithms::ExpensiveSamplingProblem::ExpensiveSamplingProblem | ( | std::shared_ptr< muq::Modeling::ModPiece > const & | target, |
Eigen::VectorXd const & | centroid, | ||
boost::property_tree::ptree | pt | ||
) |
[in] | target | The target distribution |
[in] | centroid | The centroid of the distribution |
[in] | pt | Options for the sampling problem |
ExpensiveSamplingProblem::ExpensiveSamplingProblem | ( | std::shared_ptr< muq::Modeling::ModPiece > const & | target, |
boost::property_tree::ptree | pt, | ||
std::shared_ptr< parcer::Communicator > | comm | ||
) |
[in] | target | The target distribution |
[in] | pt | Options for the sampling problem |
[in] | comm | Parallel communicator for regression |
Definition at line 55 of file ExpensiveSamplingProblem.cpp.
References reg, SetUp(), and muq::SamplingAlgorithms::SamplingProblem::target.
ExpensiveSamplingProblem::ExpensiveSamplingProblem | ( | std::shared_ptr< muq::Modeling::ModPiece > const & | target, |
Eigen::VectorXd const & | centroid, | ||
boost::property_tree::ptree | pt, | ||
std::shared_ptr< parcer::Communicator > | comm | ||
) |
[in] | target | The target distribution |
[in] | centroid | The centroid of the distribution |
[in] | pt | Options for the sampling problem |
[in] | comm | Parallel communicator for regression |
Definition at line 63 of file ExpensiveSamplingProblem.cpp.
References reg, SetUp(), and muq::SamplingAlgorithms::SamplingProblem::target.
|
virtualdefault |
|
overridevirtual |
Sometimes, there will be problem-specific options that need to be passed to the SamplingAlgorithm. This function adds any of those options to the given property_tree.
Reimplemented from muq::SamplingAlgorithms::AbstractSamplingProblem.
Definition at line 241 of file ExpensiveSamplingProblem.cpp.
unsigned int ExpensiveSamplingProblem::CacheSize | ( | ) | const |
Definition at line 239 of file ExpensiveSamplingProblem.cpp.
References reg.
|
private |
Check to make sure we have enough model evaluations.
Check to see if the state has the nearest neighbors already stored. If yes, return them, if not, find and return them.
[in] | state | Find the nearest neighbors closest to this point |
[out] | neighbors | The nearest neighbors |
[out] | results | The log-target at the nearest neighbors |
Definition at line 142 of file ExpensiveSamplingProblem.cpp.
References reg.
Referenced by RefineSurrogate().
|
private |
Check to make sure we have enough model evaluations.
[in] | state | If we do not have enough points, sample from a standard Gaussian centered at this point |
Definition at line 132 of file ExpensiveSamplingProblem.cpp.
References cumkappa, gamma, reg, and regQoI.
Referenced by RefineSurrogate().
|
private |
Compute the error threshold.
[in] | x | The state of the MCMC chain |
Definition at line 150 of file ExpensiveSamplingProblem.cpp.
References gamma, level, and LogLyapunovFunction().
Referenced by RefineSurrogate().
|
overridevirtual |
Reimplemented from muq::SamplingAlgorithms::SamplingProblem.
Definition at line 91 of file ExpensiveSamplingProblem.cpp.
References beta, cumbeta, cumgamma, eta, lastLyapunov, muq::SamplingAlgorithms::SamplingProblem::lastState, lastThreshold, LogLyapunovFunction(), RefineSurrogate(), reg, and step.
|
private |
Estimate the Lyapunov function.
Defaults to \(V(x) = \exp{(\|x-\bar{x}\|_2)}\).
[in] | x | the input point \(x\) |
Definition at line 128 of file ExpensiveSamplingProblem.cpp.
References centroid, and lyapunovPara.
Referenced by ErrorThreshold(), and LogDensity().
|
overridevirtual |
Reimplemented from muq::SamplingAlgorithms::SamplingProblem.
Definition at line 245 of file ExpensiveSamplingProblem.cpp.
References muq::SamplingAlgorithms::SamplingProblem::lastState, muq::SamplingAlgorithms::SamplingProblem::qoi, and regQoI.
|
private |
Replace the point that is farthest from the new point
[in] | state | The point where we are evalauting the log target |
[in] | index | The index of the point that we are replacing |
[out] | neighbors | The nearest neighbors |
[out] | results | The log-target at the nearest neighbors |
Definition at line 225 of file ExpensiveSamplingProblem.cpp.
|
private |
[in] | state | The state where we are evalauting the log target |
[in] | radius | The radus of the nearest neighbor ball |
[out] | neighbors | The nearest neighbors |
[out] | results | The log-target at the nearest neighbors |
Definition at line 154 of file ExpensiveSamplingProblem.cpp.
References RefineSurrogate(), and reg.
|
private |
[in] | step | The current MCMC step |
[in] | state | The state where we are evalauting the log target |
[out] | neighbors | The nearest neighbors |
[out] | results | The log-target at the nearest neighbors |
Definition at line 188 of file ExpensiveSamplingProblem.cpp.
References beta, CheckNeighbors(), CheckNumNeighbors(), cumbeta, cumgamma, ErrorThreshold(), gamma, level, reg, step, and tau0.
Referenced by LogDensity(), and RefineSurrogate().
|
private |
Set up the sampling problem.
[in] | pt | Options for the sampling problem |
Definition at line 72 of file ExpensiveSamplingProblem.cpp.
References beta, eta, gamma, lyapunovPara, reg, muq::SamplingAlgorithms::SamplingProblem::target, and tau0.
Referenced by ExpensiveSamplingProblem().
|
private |
Parameters for random refinement.
Refine with probability \(\beta = \beta_0 t^{-\beta_1}\). \(\beta_0\) is "BetaScale" and it defaults to \(0\). \(\beta_1\) is "BetaExponent" and it defaults to \(RAND_MAX\).
Definition at line 165 of file ExpensiveSamplingProblem.h.
Referenced by LogDensity(), RefineSurrogate(), and SetUp().
|
private |
The centroid of the distribution (input parameter)
Definition at line 183 of file ExpensiveSamplingProblem.h.
Referenced by LogLyapunovFunction().
unsigned int muq::SamplingAlgorithms::ExpensiveSamplingProblem::cumbeta = 0 |
Cumulative beta refinements.
Definition at line 195 of file ExpensiveSamplingProblem.h.
Referenced by LogDensity(), and RefineSurrogate().
unsigned int muq::SamplingAlgorithms::ExpensiveSamplingProblem::cumgamma = 0 |
Cumulative gamma refinements.
Definition at line 198 of file ExpensiveSamplingProblem.h.
Referenced by LogDensity(), and RefineSurrogate().
unsigned int muq::SamplingAlgorithms::ExpensiveSamplingProblem::cumkappa = 0 |
Cumulative kappa refinements.
Definition at line 201 of file ExpensiveSamplingProblem.h.
Referenced by CheckNumNeighbors().
|
private |
Tail correction parameter.
Definition at line 186 of file ExpensiveSamplingProblem.h.
Referenced by LogDensity(), and SetUp().
|
private |
Parameters for structural refinement.
Refine if the error threshold exceeds \(\gamma = \gamma_0 l^{-\gamma_1}\), where \(l\) is the current error threshold level (ExpensiveSamplingProblem::level). \(\gamma_0\) is "GammaScale" and it defaults to \(1\). \(\gamma_1\) is "GammaExponent" and it defaults to \(1.0\).
Definition at line 177 of file ExpensiveSamplingProblem.h.
Referenced by CheckNumNeighbors(), ErrorThreshold(), RefineSurrogate(), and SetUp().
double muq::SamplingAlgorithms::ExpensiveSamplingProblem::lastLyapunov = 0.0 |
The Lyapunov function at the most recently accepted point.
Definition at line 204 of file ExpensiveSamplingProblem.h.
Referenced by LogDensity().
double muq::SamplingAlgorithms::ExpensiveSamplingProblem::lastThreshold = 0.0 |
The error threshold at the most recently accepted point.
Definition at line 207 of file ExpensiveSamplingProblem.h.
Referenced by LogDensity().
|
private |
The current error threshold level.
Definition at line 189 of file ExpensiveSamplingProblem.h.
Referenced by ErrorThreshold(), and RefineSurrogate().
|
private |
The scaling and exponent for the Lyapunov function.
Definition at line 180 of file ExpensiveSamplingProblem.h.
Referenced by LogLyapunovFunction(), and SetUp().
|
private |
The regression for the log-likelihood.
Definition at line 156 of file ExpensiveSamplingProblem.h.
Referenced by CacheSize(), CheckNeighbors(), CheckNumNeighbors(), ExpensiveSamplingProblem(), LogDensity(), RefineSurrogate(), and SetUp().
|
private |
The regression for the quantity of interest.
Definition at line 159 of file ExpensiveSamplingProblem.h.
Referenced by CheckNumNeighbors(), QOI(), and RefineSurrogate().
|
private |
The current step in the MCMC chain.
Definition at line 192 of file ExpensiveSamplingProblem.h.
Referenced by LogDensity(), and RefineSurrogate().
|
private |
The length of the first level.
\(\tau_0\) is "FirstLevelLength" and defaults to \(1.0\).
Definition at line 171 of file ExpensiveSamplingProblem.h.
Referenced by RefineSurrogate(), and SetUp().