https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
IndependentGaussianMH Class Reference

A class for performing M-H MCMC sampling with independent Gaussian propoposals. More...

#include <IndependentGaussianMH.h>

Inheritance diagram for IndependentGaussianMH:
[legend]

Public Types

enum  SampleMode { SampleMode::GLOBAL, SampleMode::LOCAL }
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 IndependentGaussianMH (const InputParameters &parameters)
 
virtual int decisionStep () const override
 Return the step after which decision making can begin. More...
 
dof_id_type getNumberOfConfigValues () const
 Return the number of configuration parameters. More...
 
dof_id_type getNumberOfConfigParams () const
 Return the number of configuration parameters. More...
 
dof_id_type getNumParallelProposals () const
 Return the number of parallel proposals. More...
 
const std::vector< Real > & getRandomNumbers () const
 Return the random numbers to facilitate decision making in reporters. More...
 
const std::vector< Real > & getVarSamples () const
 Return the proposed variance samples to facilitate decision making in reporters. More...
 
const std::vector< const Distribution * > getPriors () const
 Return the priors to facilitate decision making in reporters. More...
 
const DistributiongetVarPrior () const
 Return the prior over variance to facilitate decision making in reporters. More...
 
std::vector< RealgetNextLocalRow ()
 
dof_id_type getNumberOfRows () const
 
dof_id_type getNumberOfCols () const
 
dof_id_type getNumberOfLocalRows () const
 
const LocalRankConfiggetRankConfig (bool batch_mode) const
 
virtual bool isAdaptiveSamplingCompleted () const
 
libMesh::Parallel::CommunicatorgetLocalComm ()
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
virtual void initialSetup ()
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void subdomainSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
PerfGraphperfGraph ()
 
T & getSampler (const std::string &name)
 
SamplergetSampler (const std::string &name)
 
T & getSamplerByName (const SamplerName &name)
 
SamplergetSamplerByName (const SamplerName &name)
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
DenseMatrix< RealgetGlobalSamples ()
 
DenseMatrix< RealgetGlobalSamples ()
 
DenseMatrix< RealgetLocalSamples ()
 
DenseMatrix< RealgetLocalSamples ()
 
dof_id_type getLocalRowBegin () const
 
dof_id_type getLocalRowBegin () const
 
dof_id_type getLocalRowEnd () const
 
dof_id_type getLocalRowEnd () const
 
const DistributiongetDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 

Static Public Member Functions

static InputParameters validParams ()
 

Public Attributes

const ConsoleStream _console
 

Protected Types

enum  CommMethod
 

Protected Member Functions

virtual void proposeSamples (const unsigned int seed_value) override
 Fill in the _new_samples vector of vectors (happens within sampleSetUp) More...
 
virtual void sampleSetUp (const Sampler::SampleMode mode) override
 
virtual Real computeSample (dof_id_type row_index, dof_id_type col_index) override
 
void randomIndex (const unsigned int &upper_bound, const unsigned int &exclude, const unsigned int &seed, unsigned int &req_index)
 Sample a random index excluding a specified index. More...
 
void randomIndexPair (const unsigned int &upper_bound, const unsigned int &exclude, const unsigned int &seed, unsigned int &req_index1, unsigned int &req_index2)
 Sample two random indices without repitition excluding a specified index. More...
 
void setNumberOfRandomSeeds (std::size_t number)
 
Real getRand (unsigned int index=0)
 
uint32_t getRandl (unsigned int index, uint32_t lower, uint32_t upper)
 
virtual LocalRankConfig constructRankConfig (bool batch_mode) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &) const
 
const ReporterNamegetReporterName (const std::string &param_name) const
 
virtual void addReporterDependencyHelper (const ReporterName &)
 
void setNumberOfRows (dof_id_type n_rows)
 
void setNumberOfRows (dof_id_type n_rows)
 
void setNumberOfCols (dof_id_type n_cols)
 
void setNumberOfCols (dof_id_type n_cols)
 
virtual void sampleTearDown (const SampleMode)
 
virtual void sampleTearDown (const SampleMode)
 
virtual void computeSampleMatrix (DenseMatrix< Real > &matrix)
 
virtual void computeSampleMatrix (DenseMatrix< Real > &matrix)
 
virtual void computeLocalSampleMatrix (DenseMatrix< Real > &matrix)
 
virtual void computeLocalSampleMatrix (DenseMatrix< Real > &matrix)
 
virtual void computeSampleRow (dof_id_type i, std::vector< Real > &data)
 
virtual void computeSampleRow (dof_id_type i, std::vector< Real > &data)
 
virtual void advanceGenerators (const dof_id_type count)
 
virtual void advanceGenerators (const dof_id_type count)
 
virtual void advanceGenerator (const unsigned int seed_index, const dof_id_type count)
 
virtual void advanceGenerator (const unsigned int seed_index, const dof_id_type count)
 
void setAutoAdvanceGenerators (const bool state)
 
void setAutoAdvanceGenerators (const bool state)
 
void shuffle (std::vector< T > &data, const std::size_t seed_index=0, const CommMethod method=CommMethod::LOCAL)
 
void shuffle (std::vector< T > &data, const std::size_t seed_index=0, const CommMethod method=CommMethod::LOCAL)
 
virtual void executeSetUp ()
 
virtual void executeSetUp ()
 
virtual void executeTearDown ()
 
virtual void executeTearDown ()
 
void saveGeneratorState ()
 
void saveGeneratorState ()
 
void restoreGeneratorState ()
 
void restoreGeneratorState ()
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 

Protected Attributes

const unsigned int _num_parallel_proposals
 Number of parallel proposals to be made and subApps to be executed. More...
 
std::vector< const Distribution * > _priors
 Storage for prior distribution objects to be utilized. More...
 
const Distribution_var_prior
 Storage for prior distribution object of the variance to be utilized. More...
 
const std::vector< Real > * _lower_bound
 Lower bounds for making the next proposal. More...
 
const std::vector< Real > * _upper_bound
 Upper bounds for making the next proposal. More...
 
int _check_step
 Ensure that the MCMC algorithm proceeds in a sequential fashion. More...
 
const std::vector< Real > & _initial_values
 Initial values of the input params to get the MCMC scheme started. More...
 
std::vector< std::vector< Real > > _new_samples
 Vectors of new proposed samples. More...
 
std::vector< Real_new_var_samples
 Vector of new proposed variance samples. More...
 
std::vector< Real_rnd_vec
 Vector of random numbers for decision making. More...
 
 NONE
 
 LOCAL
 
 SEMI_LOCAL
 
const dof_id_type _min_procs_per_row
 
const dof_id_type _max_procs_per_row
 
libMesh::Parallel::Communicator _local_comm
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real_t
 
const Real_t_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
bool _is_transient
 

Private Attributes

const std::vector< Real > & _seed_inputs
 Reporter value the seed input values for proposing the next set of samples. More...
 
const std::vector< Real > & _std_prop
 Standard deviations for making the next proposal. More...
 

Detailed Description

A class for performing M-H MCMC sampling with independent Gaussian propoposals.

Definition at line 17 of file IndependentGaussianMH.h.

Constructor & Destructor Documentation

◆ IndependentGaussianMH()

IndependentGaussianMH::IndependentGaussianMH ( const InputParameters parameters)

Definition at line 28 of file IndependentGaussianMH.C.

30  _seed_inputs(getReporterValue<std::vector<Real>>("seed_inputs")),
31  _std_prop(getParam<std::vector<Real>>("std_prop"))
32 {
33  // Error check for sizes of proposal stds
34  if (_std_prop.size() != _priors.size())
35  paramError("std_prop",
36  "The number of proposal stds, initial values, and priors should be the same.");
37 }
PMCMCBase(const InputParameters &parameters)
Definition: PMCMCBase.C:46
std::vector< const Distribution * > _priors
Storage for prior distribution objects to be utilized.
Definition: PMCMCBase.h:109
const T & getReporterValue(const std::string &param_name, const std::size_t time_index=0)
const std::vector< Real > & _seed_inputs
Reporter value the seed input values for proposing the next set of samples.
const std::vector< Real > & _std_prop
Standard deviations for making the next proposal.
const T & getParam(const std::string &name) const
void paramError(const std::string &param, Args... args) const
const InputParameters & parameters() const

Member Function Documentation

◆ computeSample()

Real PMCMCBase::computeSample ( dof_id_type  row_index,
dof_id_type  col_index 
)
overrideprotectedvirtualinherited

Implements Sampler.

Definition at line 207 of file PMCMCBase.C.

208 {
209  if (_t_step < 1)
210  for (unsigned int i = 0; i < _num_parallel_proposals; ++i)
212 
213  // Combine the proposed samples with experimental configurations
215 
216  return _new_samples_confg[row_index][col_index];
217 }
const unsigned int _num_parallel_proposals
Number of parallel proposals to be made and subApps to be executed.
Definition: PMCMCBase.h:106
const std::vector< Real > & _initial_values
Initial values of the input params to get the MCMC scheme started.
Definition: PMCMCBase.h:124
std::vector< std::vector< Real > > _new_samples_confg
Vectors of new proposed samples combined with the experimental configuration values.
Definition: PMCMCBase.h:148
void combineWithExperimentalConfig()
Generates combinations of the new samples with the experimental configurations.
Definition: PMCMCBase.C:165
std::vector< std::vector< Real > > _new_samples
Vectors of new proposed samples.
Definition: PMCMCBase.h:127

◆ decisionStep()

virtual int IndependentGaussianMH::decisionStep ( ) const
inlineoverridevirtual

Return the step after which decision making can begin.

Reimplemented from PMCMCBase.

Definition at line 24 of file IndependentGaussianMH.h.

Referenced by proposeSamples().

24 { return 2; }

◆ getNumberOfConfigParams()

dof_id_type PMCMCBase::getNumberOfConfigParams ( ) const
inlineinherited

Return the number of configuration parameters.

Definition at line 34 of file PMCMCBase.h.

Referenced by PMCMCDecision::PMCMCDecision().

34 { return _confg_values.size(); }
std::vector< std::vector< Real > > _confg_values
Configuration values.
Definition: PMCMCBase.h:145

◆ getNumberOfConfigValues()

dof_id_type PMCMCBase::getNumberOfConfigValues ( ) const
inlineinherited

Return the number of configuration parameters.

Definition at line 29 of file PMCMCBase.h.

Referenced by PMCMCDecision::PMCMCDecision().

29 { return _confg_values[0].size(); }
std::vector< std::vector< Real > > _confg_values
Configuration values.
Definition: PMCMCBase.h:145

◆ getNumParallelProposals()

dof_id_type PMCMCBase::getNumParallelProposals ( ) const
inlineinherited

Return the number of parallel proposals.

Definition at line 39 of file PMCMCBase.h.

Referenced by PMCMCDecision::PMCMCDecision().

39 { return _num_parallel_proposals; }
const unsigned int _num_parallel_proposals
Number of parallel proposals to be made and subApps to be executed.
Definition: PMCMCBase.h:106

◆ getPriors()

const std::vector< const Distribution * > PMCMCBase::getPriors ( ) const
inherited

Return the priors to facilitate decision making in reporters.

Definition at line 195 of file PMCMCBase.C.

196 {
197  return _priors;
198 }
std::vector< const Distribution * > _priors
Storage for prior distribution objects to be utilized.
Definition: PMCMCBase.h:109

◆ getRandomNumbers()

const std::vector< Real > & PMCMCBase::getRandomNumbers ( ) const
inherited

Return the random numbers to facilitate decision making in reporters.

Definition at line 183 of file PMCMCBase.C.

184 {
185  return _rnd_vec;
186 }
std::vector< Real > _rnd_vec
Vector of random numbers for decision making.
Definition: PMCMCBase.h:133

◆ getVarPrior()

const Distribution * PMCMCBase::getVarPrior ( ) const
inherited

Return the prior over variance to facilitate decision making in reporters.

Definition at line 201 of file PMCMCBase.C.

202 {
203  return _var_prior;
204 }
const Distribution * _var_prior
Storage for prior distribution object of the variance to be utilized.
Definition: PMCMCBase.h:112

◆ getVarSamples()

const std::vector< Real > & PMCMCBase::getVarSamples ( ) const
inherited

Return the proposed variance samples to facilitate decision making in reporters.

Definition at line 189 of file PMCMCBase.C.

190 {
191  return _new_var_samples;
192 }
std::vector< Real > _new_var_samples
Vector of new proposed variance samples.
Definition: PMCMCBase.h:130

◆ proposeSamples()

void IndependentGaussianMH::proposeSamples ( const unsigned int  seed_value)
overrideprotectedvirtual

Fill in the _new_samples vector of vectors (happens within sampleSetUp)

Parameters
seed_valueThe seed for the random number generator

Reimplemented from PMCMCBase.

Definition at line 40 of file IndependentGaussianMH.C.

41 {
42  std::vector<Real> old_sample = (_t_step > decisionStep()) ? _seed_inputs : _initial_values;
43  for (unsigned int j = 0; j < _num_parallel_proposals; ++j)
44  for (unsigned int i = 0; i < _priors.size(); ++i)
45  {
46  if (_lower_bound)
48  old_sample[i],
49  _std_prop[i],
50  (*_lower_bound)[i],
51  (*_upper_bound)[i]);
52  else
53  _new_samples[j][i] = Normal::quantile(getRand(seed_value), old_sample[i], _std_prop[i]);
54  }
55 }
const unsigned int _num_parallel_proposals
Number of parallel proposals to be made and subApps to be executed.
Definition: PMCMCBase.h:106
const std::vector< Real > & _initial_values
Initial values of the input params to get the MCMC scheme started.
Definition: PMCMCBase.h:124
const std::vector< Real > * _lower_bound
Lower bounds for making the next proposal.
Definition: PMCMCBase.h:115
std::vector< const Distribution * > _priors
Storage for prior distribution objects to be utilized.
Definition: PMCMCBase.h:109
Real getRand(unsigned int index=0)
virtual int decisionStep() const override
Return the step after which decision making can begin.
const std::vector< Real > & _seed_inputs
Reporter value the seed input values for proposing the next set of samples.
const std::vector< Real > & _std_prop
Standard deviations for making the next proposal.
const std::vector< Real > * _upper_bound
Upper bounds for making the next proposal.
Definition: PMCMCBase.h:118
virtual Real quantile(const Real &p) const override
std::vector< std::vector< Real > > _new_samples
Vectors of new proposed samples.
Definition: PMCMCBase.h:127
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
virtual Real quantile(const Real &p) const override
Definition: Normal.C:80

◆ randomIndex()

void PMCMCBase::randomIndex ( const unsigned int upper_bound,
const unsigned int exclude,
const unsigned int seed,
unsigned int req_index 
)
protectedinherited

Sample a random index excluding a specified index.

Parameters
upper_boundThe upper bound provided
excludeThe index to be excluded from sampling
seedThe seed of the random number generator
req_indexThe required index to be filled

Definition at line 141 of file PMCMCBase.C.

Referenced by AffineInvariantStretchSampler::proposeSamples(), and PMCMCBase::randomIndexPair().

145 {
146  req_index = exclude;
147  while (req_index == exclude)
148  req_index = getRandl(seed, 0, upper_bound);
149 }
uint32_t getRandl(unsigned int index, uint32_t lower, uint32_t upper)

◆ randomIndexPair()

void PMCMCBase::randomIndexPair ( const unsigned int upper_bound,
const unsigned int exclude,
const unsigned int seed,
unsigned int req_index1,
unsigned int req_index2 
)
protectedinherited

Sample two random indices without repitition excluding a specified index.

Parameters
upper_boundThe upper bound provided
excludeThe index to be excluded from sampling
seedThe seed of the random number generator
req_index1The required index 1 to be filled
req_index2The required index 2 to be filled

Definition at line 152 of file PMCMCBase.C.

Referenced by AffineInvariantDES::proposeSamples().

157 {
158  randomIndex(upper_bound, exclude, seed, req_index1);
159  req_index2 = req_index1;
160  while (req_index1 == req_index2)
161  randomIndex(upper_bound, exclude, seed, req_index2);
162 }
void randomIndex(const unsigned int &upper_bound, const unsigned int &exclude, const unsigned int &seed, unsigned int &req_index)
Sample a random index excluding a specified index.
Definition: PMCMCBase.C:141

◆ sampleSetUp()

void PMCMCBase::sampleSetUp ( const Sampler::SampleMode  mode)
overrideprotectedvirtualinherited

Reimplemented from Sampler.

Definition at line 124 of file PMCMCBase.C.

125 {
126  if (_t_step < 1 || _check_step == _t_step)
127  return;
129 
130  unsigned int seed_value = _t_step > 0 ? (_t_step - 1) : 0;
131 
132  // Filling the new_samples vector of vectors with new proposal samples
133  proposeSamples(seed_value);
134 
135  // Draw random numbers to facilitate decision making later on
136  for (unsigned int j = 0; j < _num_parallel_proposals; ++j)
137  _rnd_vec[j] = getRand(seed_value);
138 }
const unsigned int _num_parallel_proposals
Number of parallel proposals to be made and subApps to be executed.
Definition: PMCMCBase.h:106
int _check_step
Ensure that the MCMC algorithm proceeds in a sequential fashion.
Definition: PMCMCBase.h:121
Real getRand(unsigned int index=0)
virtual void proposeSamples(const unsigned int seed_value)
Fill in the _new_samples vector of vectors (happens within sampleSetUp)
Definition: PMCMCBase.C:116
std::vector< Real > _rnd_vec
Vector of random numbers for decision making.
Definition: PMCMCBase.h:133
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")

◆ validParams()

InputParameters IndependentGaussianMH::validParams ( )
static

Definition at line 17 of file IndependentGaussianMH.C.

18 {
20  params.addClassDescription("Perform M-H MCMC sampling with independent Gaussian propoposals.");
21  params.addRequiredParam<ReporterName>("seed_inputs",
22  "Reporter with seed inputs values for the next proposals.");
23  params.addRequiredParam<std::vector<Real>>("std_prop",
24  "Standard deviations for making the next proposal.");
25  return params;
26 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Definition: PMCMCBase.C:18

Member Data Documentation

◆ _check_step

int PMCMCBase::_check_step
protectedinherited

Ensure that the MCMC algorithm proceeds in a sequential fashion.

Definition at line 121 of file PMCMCBase.h.

Referenced by PMCMCBase::PMCMCBase(), and PMCMCBase::sampleSetUp().

◆ _initial_values

const std::vector<Real>& PMCMCBase::_initial_values
protectedinherited

Initial values of the input params to get the MCMC scheme started.

Definition at line 124 of file PMCMCBase.h.

Referenced by PMCMCBase::computeSample(), PMCMCBase::PMCMCBase(), and proposeSamples().

◆ _lower_bound

const std::vector<Real>* PMCMCBase::_lower_bound
protectedinherited

Lower bounds for making the next proposal.

Definition at line 115 of file PMCMCBase.h.

Referenced by PMCMCBase::PMCMCBase(), AffineInvariantDES::proposeSamples(), proposeSamples(), and AffineInvariantStretchSampler::proposeSamples().

◆ _new_samples

std::vector<std::vector<Real> > PMCMCBase::_new_samples
protectedinherited

◆ _new_var_samples

std::vector<Real> PMCMCBase::_new_var_samples
protectedinherited

Vector of new proposed variance samples.

Definition at line 130 of file PMCMCBase.h.

Referenced by PMCMCBase::getVarSamples(), PMCMCBase::PMCMCBase(), AffineInvariantDES::proposeSamples(), and AffineInvariantStretchSampler::proposeSamples().

◆ _num_parallel_proposals

const unsigned int PMCMCBase::_num_parallel_proposals
protectedinherited

◆ _priors

std::vector<const Distribution *> PMCMCBase::_priors
protectedinherited

◆ _rnd_vec

std::vector<Real> PMCMCBase::_rnd_vec
protectedinherited

Vector of random numbers for decision making.

Definition at line 133 of file PMCMCBase.h.

Referenced by PMCMCBase::getRandomNumbers(), PMCMCBase::PMCMCBase(), and PMCMCBase::sampleSetUp().

◆ _seed_inputs

const std::vector<Real>& IndependentGaussianMH::_seed_inputs
private

Reporter value the seed input values for proposing the next set of samples.

Definition at line 31 of file IndependentGaussianMH.h.

Referenced by proposeSamples().

◆ _std_prop

const std::vector<Real>& IndependentGaussianMH::_std_prop
private

Standard deviations for making the next proposal.

Definition at line 34 of file IndependentGaussianMH.h.

Referenced by IndependentGaussianMH(), and proposeSamples().

◆ _upper_bound

const std::vector<Real>* PMCMCBase::_upper_bound
protectedinherited

Upper bounds for making the next proposal.

Definition at line 118 of file PMCMCBase.h.

Referenced by PMCMCBase::PMCMCBase(), and proposeSamples().

◆ _var_prior

const Distribution* PMCMCBase::_var_prior
protectedinherited

Storage for prior distribution object of the variance to be utilized.

Definition at line 112 of file PMCMCBase.h.

Referenced by PMCMCBase::getVarPrior(), PMCMCBase::PMCMCBase(), AffineInvariantDES::proposeSamples(), and AffineInvariantStretchSampler::proposeSamples().


The documentation for this class was generated from the following files: