https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AffineInvariantStretchDecision.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
13
16{
18 params.addClassDescription("Perform decision making for Affine Invariant stretch MCMC.");
19 return params;
20}
21
23 : PMCMCDecision(parameters),
24 _aiss(dynamic_cast<const AffineInvariantStretchSampler *>(&_sampler)),
25 _step_size(_aiss->getAffineStepSize())
26{
27 // Check whether the selected sampler is a stretch sampler or not
28 if (!_aiss)
29 paramError("sampler", "The selected sampler is not of type AffineInvariantStretchSampler.");
30}
31
32void
34 const std::vector<Real> & evidence)
35{
36 for (unsigned int i = 0; i < tv.size(); ++i)
37 tv[i] = std::exp(std::min((_priors.size() - 1) * std::log(_step_size[i]) + evidence[i], 0.0));
38}
registerMooseObject("StochasticToolsApp", AffineInvariantStretchDecision)
A class for performing Affine Invariant Ensemble MCMC with stretch sampler.
const AffineInvariantStretchSampler *const _aiss
Affine stretch sampler.
virtual void computeTransitionVector(std::vector< Real > &tv, const std::vector< Real > &evidence) override
Compute the transition probability vector (after the computation of evidence)
const std::vector< Real > & _step_size
Affine step sizes.
AffineInvariantStretchDecision(const InputParameters &parameters)
A class for performing Affine Invariant Ensemble MCMC with stretch sampler.
void addClassDescription(const std::string &doc_string)
void paramError(const std::string &param, Args... args) const
PMCMCDecision will help making sample accept/reject decisions in MCMC schemes (for e....
const std::vector< const Distribution * > _priors
Storage for the priors.
static InputParameters validParams()