7 InferenceProblem::InferenceProblem(std::shared_ptr<muq::Modeling::ModPiece>
const& likelyIn,
8 std::shared_ptr<muq::Modeling::ModPiece>
const& priorIn,
12 inverseTemp(inverseTempIn){}
15 std::shared_ptr<muq::Modeling::ModPiece>
const& priorIn,
16 std::shared_ptr<muq::Modeling::ModPiece>
const& qoiIn,
21 inverseTemp(inverseTempIn) {}
29 double likelyVal =
likely->Evaluate(state->state).at(0)(0);
30 double priorVal =
prior->Evaluate(state->state).at(0)(0);
31 state->meta[
"LogLikelihood"] = likelyVal;
32 state->meta[
"LogPrior"] = priorVal;
43 return std::make_shared<SamplingState>(
qoi->Evaluate(
lastState->state));
47 unsigned const blockWrt)
52 Eigen::VectorXd sens = Eigen::VectorXd::Ones(1);
53 return inverseTemp *
likely->Gradient(0, blockWrt, state->state, sens) +
prior->Gradient(0, blockWrt, state->state, sens);
Abstract base class for MCMC and Importance Sampling problems.
std::shared_ptr< muq::Modeling::ModPiece > likely
The log-likelihood function.
std::shared_ptr< muq::Modeling::ModPiece > qoi
std::shared_ptr< muq::Modeling::ModPiece > prior
The prior log-density.
virtual std::shared_ptr< AbstractSamplingProblem > Clone() const override
InferenceProblem(std::shared_ptr< muq::Modeling::ModPiece > const &likelyIn, std::shared_ptr< muq::Modeling::ModPiece > const &priorIn, double inverseTempIn=1.0)
virtual Eigen::VectorXd GradLogDensity(std::shared_ptr< SamplingState > const &state, unsigned const blockWrt) override
virtual double LogDensity(std::shared_ptr< SamplingState > const &state) override
virtual std::shared_ptr< SamplingState > QOI() override
std::shared_ptr< SamplingState > lastState