https://mooseframework.inl.gov
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 
32 void
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 }
PMCMCDecision will help making sample accept/reject decisions in MCMC schemes (for e...
Definition: PMCMCDecision.h:22
registerMooseObject("StochasticToolsApp", AffineInvariantStretchDecision)
A class for performing Affine Invariant Ensemble MCMC with stretch sampler.
AffineInvariantStretchDecision(const InputParameters &parameters)
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)
void paramError(const std::string &param, Args... args) const
const std::vector< Real > & _step_size
Affine step sizes.
const std::vector< const Distribution * > _priors
Storage for the priors.
static InputParameters validParams()
Definition: PMCMCDecision.C:17
void addClassDescription(const std::string &doc_string)
A class for performing Affine Invariant Ensemble MCMC with stretch sampler.