CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
cbl::statistics::ModelParameters Class Reference

The class ModelParameters. More...

#include <ModelParameters.h>

Inheritance diagram for cbl::statistics::ModelParameters:

Public Member Functions

virtual void reset ()
 reset the parameter vectors
 
virtual void set_parameter_covariance (const int start=0, const int thin=1)
 set the internal method m_parameter_covariance More...
 
virtual double parameter_covariance (const int i, const int j) const
 return the protected member m_parameter_covariance More...
 
virtual std::vector< std::vector< double > > parameter_covariance () const
 return the protected member m_parameter_covariance More...
 
virtual void show_results (const int start, const int thin, const int nbins, const int seed=34121, const bool show_mode=false, const int ns=-1, const int nb=-1, const std::vector< double > weight={})
 show the results on the standard output More...
 
virtual void write_results (const std::string dir, const std::string file, const int start, const int thin, const int nbins, const int seed=34121, const bool compute_mode=false, const int ns=-1, const int nb=-1, const std::vector< double > weight={})
 store the results to file More...
 
virtual size_t chain_size () const
 return the private member m_chain_size More...
 
virtual size_t chain_nwalkers () const
 return the private member m_chain_nwalkers More...
 
virtual void set_chain (const size_t size, const size_t nwalkers)
 set the chain More...
 
virtual void reset_chain ()
 reset the chain using m_size and m_nwalkers
 
virtual void expand_chain (const int append)
 expand the already existing chain More...
 
virtual double chain_value (const int param, const int pos, const int ww) const
 return the private member m_chain_values at the pos step for the ww-th walker, for the chosen parameter More...
 
virtual std::vector< double > chain_value_parameters (const int pos, const int ww) const
 return the private member m_values at the pp-th step for the ww-th step for all the parameters More...
 
virtual std::vector< double > parameter_chain_values (const int par, const int start=0, const int thin=1) const
 return all the chain values for a parameter More...
 
virtual void set_chain_value (const int param, const int pos, const int ww, const double value)
 set the private member m_chain_values at the pp-th step for the ww-th step More...
 
virtual void set_chain_values (const std::vector< std::vector< double >> values, const int nwalkers)
 set the chain values More...
 
virtual void set_chain_values (const std::vector< std::vector< std::vector< double >>> values)
 set the chain values More...
 
virtual void initialize_chain (const std::vector< std::vector< double >> values)
 initialize the chain values More...
 
virtual void initialize_chain_from_prior ()
 initialize the chain values random sampling the parameter priors
 
virtual void initialize_chain_ball (const std::vector< double > center, const double radius, const double seed)
 initialize the chain values More...
 
virtual void initialize_chain_ball_bestfit (const double radius, const double seed)
 initialize the chain values around bestfit values More...
 
Constructors/destructors
 ModelParameters ()=default
 default constructor
 
 ModelParameters (const size_t nparameters, std::vector< ParameterType > parameterTypes, std::vector< std::string > parameterNames)
 constructor for ModelParameters More...
 
 ModelParameters (const size_t nparameters, std::vector< std::string > parameterNames)
 constructor for ModelParameters More...
 
 ~ModelParameters ()=default
 default destructor
 
Member functions used to set private/protected of the ModelParameters
size_t nparameters () const
 return the total number of parameters More...
 
size_t nparameters_base () const
 return the number of base parameters More...
 
std::vector< unsigned int > base_parameter () const
 return the private member m_base_parameters More...
 
size_t nparameters_derived () const
 return the number of derived parameters More...
 
size_t nparameters_correlated () const
 return the number of correlated parameters More...
 
std::vector< unsigned int > derived_parameter () const
 return the private member m_derived_parameter More...
 
ParameterType type (const int p) const
 return the model parameter type More...
 
std::vector< ParameterTypetype () const
 return all the model parameter names More...
 
std::string name (const int p) const
 return the model parameter name More...
 
std::vector< std::string > name () const
 return all the model parameter names More...
 
virtual std::string status (const int p) const
 return the model parameter status More...
 
virtual std::vector< std::string > status () const
 return all the model parameter status More...
 
virtual std::vector< double > full_parameter (const std::vector< double > parameter_value) const
 return all the model parameters, for internal usage More...
 
virtual void set_parameters (const size_t nparameters, std::vector< ParameterType > parameterTypes, std::vector< std::string > parameterNames)
 set the parameter More...
 
virtual void set_parameters (const size_t nparameters, std::vector< std::string > parameterNames)
 set the parameter More...
 
virtual void set_parameters (const size_t nparameters, const std::vector< std::shared_ptr< PriorDistribution >> priorDistributions, std::vector< ParameterType > parameterTypes, std::vector< std::string > parameterNames)
 set the parameter More...
 
virtual size_t nparameters_free () const
 return the number of free parameters More...
 
virtual std::vector< unsigned int > free_parameter () const
 return the private member m_free_parameter More...
 
virtual size_t nparameters_fixed () const
 return the number of fixed parameters More...
 
virtual std::vector< unsigned int > fixed_parameter () const
 return the private member m_fixed_parameters More...
 
Member functions to manage fixed/free parameters
virtual void free (const int p)
 set m_fixed to false More...
 
virtual void fix (const int p, const double value)
 fix the parameter at the input value More...
 
virtual void fix_at_bestfit (const int p)
 fix the parameter at the bestfit value, contained in m_bestfit_value More...
 
virtual double bestfit_value (const int p) const
 get the protected member m_value More...
 
virtual std::vector< double > bestfit_value () const
 get the protected member m_value More...
 
virtual void set_bestfit_values (const std::vector< double > bestfit_value)
 set the protected member m_bestfit_value More...
 
virtual void set_bestfit_values (const int start, const int thin, const int nbins, const int seed)
 set the protected member m_bestfit_value More...
 
virtual void write_bestfit_info ()
 write the bestfit info
 
Member functions used to interact with prior distribution
virtual void set_prior_distribution (const int p, const std::shared_ptr< PriorDistribution > priorDistribution)
 set the prior distribution for the p-th parameter More...
 
virtual void set_prior_distribution (const std::vector< std::shared_ptr< PriorDistribution >> priorDistributions)
 set the prior distributions for the parameters More...
 
virtual void set_prior_distribution_seed (const std::shared_ptr< random::UniformRandomNumbers_Int > ran_generator)
 set the prior distributions for the parameters More...
 
virtual std::shared_ptr< PriorDistributionprior_distribution (const int p) const
 get the prior distribution for the p-th parameter More...
 
virtual std::vector< std::shared_ptr< PriorDistribution > > prior_distribution () const
 get the prior distribution for the p-th parameter More...
 
virtual std::shared_ptr< Priorprior () const
 get the prior function More...
 
Member functions used to interact with posterior distribution
virtual void set_posterior_distribution (const int start, const int thin, const int nbins, const int seed=34121, const std::vector< double > weight={})
 set the prior distribution for the p-th parameter More...
 
virtual std::shared_ptr< PosteriorDistributionposterior_distribution (const int par) const
 get the posterior distribution for the chosen parameter More...
 

Protected Member Functions

virtual void m_set_parameter_type ()
 private member to set the parameter types
 

Protected Attributes

std::vector< ParameterTypem_parameter_type
 model parameters
 
std::vector< std::string > m_parameter_name
 model parameter types
 
size_t m_nparameters = 0
 number of parameters
 
size_t m_nparameters_base = 0
 number of base parameters
 
size_t m_nparameters_derived = 0
 number of derived parameters
 
size_t m_nparameters_correlated = 0
 number of correlated parameters
 
std::vector< unsigned int > m_base_parameter
 indexes of base parameters
 
std::vector< unsigned int > m_derived_parameter
 indexes of the derived parameters
 

Detailed Description

The class ModelParameters.

"Headers/ModelParameters.h"

This class is used to define the model parameters

Definition at line 108 of file ModelParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

cbl::statistics::ModelParameters::ModelParameters ( const size_t  nparameters,
std::vector< ParameterType parameterTypes,
std::vector< std::string >  parameterNames 
)

constructor for ModelParameters

Parameters
nparametersthe number of parameters
parameterTypesthe parameter types
parameterNamesthe parameter names

Definition at line 105 of file ModelParameters.cpp.

◆ ModelParameters() [2/2]

cbl::statistics::ModelParameters::ModelParameters ( const size_t  nparameters,
std::vector< std::string >  parameterNames 
)

constructor for ModelParameters

Parameters
nparametersthe number of parameters
parameterNamesthe parameter names

Definition at line 114 of file ModelParameters.cpp.

Member Function Documentation

◆ base_parameter()

std::vector<unsigned int> cbl::statistics::ModelParameters::base_parameter ( ) const
inline

return the private member m_base_parameters

Returns
the private member m_base_parameters

Definition at line 213 of file ModelParameters.h.

◆ bestfit_value() [1/2]

virtual std::vector<double> cbl::statistics::ModelParameters::bestfit_value ( ) const
inlinevirtual

get the protected member m_value

Returns
the parameter bestfit values

Reimplemented in cbl::statistics::LikelihoodParameters, and cbl::statistics::PosteriorParameters.

Definition at line 423 of file ModelParameters.h.

◆ bestfit_value() [2/2]

virtual double cbl::statistics::ModelParameters::bestfit_value ( const int  p) const
inlinevirtual

get the protected member m_value

Parameters
pthe p-th parameter
Returns
the bestfit value of the parameter

Reimplemented in cbl::statistics::LikelihoodParameters, and cbl::statistics::PosteriorParameters.

Definition at line 415 of file ModelParameters.h.

◆ chain_nwalkers()

virtual size_t cbl::statistics::ModelParameters::chain_nwalkers ( ) const
inlinevirtual

return the private member m_chain_nwalkers

Returns
the chain size

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 659 of file ModelParameters.h.

◆ chain_size()

virtual size_t cbl::statistics::ModelParameters::chain_size ( ) const
inlinevirtual

return the private member m_chain_size

Returns
the chain size

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 651 of file ModelParameters.h.

◆ chain_value()

virtual double cbl::statistics::ModelParameters::chain_value ( const int  param,
const int  pos,
const int  ww 
) const
inlinevirtual

return the private member m_chain_values at the pos step for the ww-th walker, for the chosen parameter

Parameters
paramthe parameter index
posthe position in the chain
wwthe walker index
Returns
the chain value

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 698 of file ModelParameters.h.

◆ chain_value_parameters()

virtual std::vector<double> cbl::statistics::ModelParameters::chain_value_parameters ( const int  pos,
const int  ww 
) const
inlinevirtual

return the private member m_values at the pp-th step for the ww-th step for all the parameters

Parameters
posthe position in the chain
wwthe walker index
Returns
the chain value

Definition at line 711 of file ModelParameters.h.

◆ derived_parameter()

std::vector<unsigned int> cbl::statistics::ModelParameters::derived_parameter ( ) const
inline

return the private member m_derived_parameter

Returns
the private member m_derived_parameter

Definition at line 234 of file ModelParameters.h.

◆ expand_chain()

virtual void cbl::statistics::ModelParameters::expand_chain ( const int  append)
inlinevirtual

expand the already existing chain

Parameters
appendthe lenght of the empty chunk of the chain

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 683 of file ModelParameters.h.

◆ fix()

virtual void cbl::statistics::ModelParameters::fix ( const int  p,
const double  value 
)
inlinevirtual

fix the parameter at the input value

Parameters
pthe p-th parameter
valuethe input value

Reimplemented in cbl::statistics::LikelihoodParameters.

Definition at line 392 of file ModelParameters.h.

◆ fix_at_bestfit()

virtual void cbl::statistics::ModelParameters::fix_at_bestfit ( const int  p)
inlinevirtual

fix the parameter at the bestfit value, contained in m_bestfit_value

Parameters
pthe p-th parameter

Reimplemented in cbl::statistics::LikelihoodParameters.

Definition at line 401 of file ModelParameters.h.

◆ fixed_parameter()

virtual std::vector<unsigned int> cbl::statistics::ModelParameters::fixed_parameter ( ) const
inlinevirtual

return the private member m_fixed_parameters

Returns
the private member m_fixed_parameters

Reimplemented in cbl::statistics::PosteriorParameters, and cbl::statistics::LikelihoodParameters.

Definition at line 366 of file ModelParameters.h.

◆ free()

virtual void cbl::statistics::ModelParameters::free ( const int  p)
inlinevirtual

set m_fixed to false

Parameters
pthe p-th parameter

Reimplemented in cbl::statistics::LikelihoodParameters.

Definition at line 382 of file ModelParameters.h.

◆ free_parameter()

virtual std::vector<unsigned int> cbl::statistics::ModelParameters::free_parameter ( ) const
inlinevirtual

return the private member m_free_parameter

Returns
the private member m_free_parameter

Reimplemented in cbl::statistics::PosteriorParameters, and cbl::statistics::LikelihoodParameters.

Definition at line 350 of file ModelParameters.h.

◆ full_parameter()

vector< double > cbl::statistics::ModelParameters::full_parameter ( const std::vector< double >  parameter_value) const
virtual

return all the model parameters, for internal usage

Parameters
parameter_valuevector of parameters
Returns
all the parameter values

Reimplemented in cbl::statistics::PosteriorParameters, and cbl::statistics::LikelihoodParameters.

Definition at line 43 of file ModelParameters.cpp.

◆ initialize_chain()

virtual void cbl::statistics::ModelParameters::initialize_chain ( const std::vector< std::vector< double >>  values)
inlinevirtual

initialize the chain values

Parameters
valuesthe starting values

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 766 of file ModelParameters.h.

◆ initialize_chain_ball()

virtual void cbl::statistics::ModelParameters::initialize_chain_ball ( const std::vector< double >  center,
const double  radius,
const double  seed 
)
inlinevirtual

initialize the chain values

Parameters
centerthe ball center
radiusthe ball radius
seedthe random number generator seed

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 785 of file ModelParameters.h.

◆ initialize_chain_ball_bestfit()

virtual void cbl::statistics::ModelParameters::initialize_chain_ball_bestfit ( const double  radius,
const double  seed 
)
inlinevirtual

initialize the chain values around bestfit values

Parameters
radiusthe ball radius
seedthe random number generator seed

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 796 of file ModelParameters.h.

◆ name() [1/2]

std::vector<std::string> cbl::statistics::ModelParameters::name ( ) const
inline

return all the model parameter names

Returns
vector containing all the parameter names

Definition at line 266 of file ModelParameters.h.

◆ name() [2/2]

std::string cbl::statistics::ModelParameters::name ( const int  p) const
inline

return the model parameter name

Parameters
pthe index of the parameter
Returns
the parameter name

Definition at line 259 of file ModelParameters.h.

◆ nparameters()

size_t cbl::statistics::ModelParameters::nparameters ( ) const

return the total number of parameters

Returns
the total number of parameters

Definition at line 123 of file ModelParameters.cpp.

◆ nparameters_base()

size_t cbl::statistics::ModelParameters::nparameters_base ( ) const

return the number of base parameters

Returns
the number of base parameters

Definition at line 132 of file ModelParameters.cpp.

◆ nparameters_correlated()

size_t cbl::statistics::ModelParameters::nparameters_correlated ( ) const

return the number of correlated parameters

Returns
the number of correlated parameters

Definition at line 150 of file ModelParameters.cpp.

◆ nparameters_derived()

size_t cbl::statistics::ModelParameters::nparameters_derived ( ) const

return the number of derived parameters

Returns
the number of derived parameters

Definition at line 141 of file ModelParameters.cpp.

◆ nparameters_fixed()

virtual size_t cbl::statistics::ModelParameters::nparameters_fixed ( ) const
inlinevirtual

return the number of fixed parameters

Returns
the number of fixed parameters

Reimplemented in cbl::statistics::PosteriorParameters, and cbl::statistics::LikelihoodParameters.

Definition at line 358 of file ModelParameters.h.

◆ nparameters_free()

virtual size_t cbl::statistics::ModelParameters::nparameters_free ( ) const
inlinevirtual

return the number of free parameters

Returns
the number of free parameters

Reimplemented in cbl::statistics::PosteriorParameters, and cbl::statistics::LikelihoodParameters.

Definition at line 342 of file ModelParameters.h.

◆ parameter_chain_values()

virtual std::vector<double> cbl::statistics::ModelParameters::parameter_chain_values ( const int  par,
const int  start = 0,
const int  thin = 1 
) const
inlinevirtual

return all the chain values for a parameter

Parameters
parthe parameter index
startthe starting position
thinnumber of jumped indexes in the chain
Returns
the chain value

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 725 of file ModelParameters.h.

◆ parameter_covariance() [1/2]

virtual std::vector<std::vector<double> > cbl::statistics::ModelParameters::parameter_covariance ( ) const
inlinevirtual

return the protected member m_parameter_covariance

Returns
vector containing the parameter covariance matrix

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 550 of file ModelParameters.h.

◆ parameter_covariance() [2/2]

virtual double cbl::statistics::ModelParameters::parameter_covariance ( const int  i,
const int  j 
) const
inlinevirtual

return the protected member m_parameter_covariance

Parameters
iindex i
jindex j
Returns
the value of the parameter covariance at i,j

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 541 of file ModelParameters.h.

◆ posterior_distribution()

virtual std::shared_ptr<PosteriorDistribution> cbl::statistics::ModelParameters::posterior_distribution ( const int  par) const
inlinevirtual

get the posterior distribution for the chosen parameter

Parameters
parthe index of the parameter
Returns
the protected member m_parameter_posterior[param]

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 584 of file ModelParameters.h.

◆ prior()

virtual std::shared_ptr<Prior> cbl::statistics::ModelParameters::prior ( ) const
inlinevirtual

get the prior function

Returns
pointer to a class Prior

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 517 of file ModelParameters.h.

◆ prior_distribution() [1/2]

virtual std::vector<std::shared_ptr<PriorDistribution> > cbl::statistics::ModelParameters::prior_distribution ( ) const
inlinevirtual

get the prior distribution for the p-th parameter

Returns
pointer to the prior distribution of the p-th parameter

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 509 of file ModelParameters.h.

◆ prior_distribution() [2/2]

virtual std::shared_ptr<PriorDistribution> cbl::statistics::ModelParameters::prior_distribution ( const int  p) const
inlinevirtual

get the prior distribution for the p-th parameter

Parameters
pthe p-th parameter
Returns
pointer to the prior distribution of the p-th parameter

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 500 of file ModelParameters.h.

◆ set_bestfit_values() [1/2]

virtual void cbl::statistics::ModelParameters::set_bestfit_values ( const int  start,
const int  thin,
const int  nbins,
const int  seed 
)
inlinevirtual

set the protected member m_bestfit_value

Parameters
startthe starting position
thinnumber of jumped indexes in the chain
nbinsthe number of bins
seedseed for random extraction

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 445 of file ModelParameters.h.

◆ set_bestfit_values() [2/2]

virtual void cbl::statistics::ModelParameters::set_bestfit_values ( const std::vector< double >  bestfit_value)
inlinevirtual

set the protected member m_bestfit_value

Parameters
bestfit_valueparameter bestfit values

Reimplemented in cbl::statistics::LikelihoodParameters, and cbl::statistics::PosteriorParameters.

Definition at line 431 of file ModelParameters.h.

◆ set_chain()

virtual void cbl::statistics::ModelParameters::set_chain ( const size_t  size,
const size_t  nwalkers 
)
inlinevirtual

set the chain

Parameters
sizethe chain lenght
nwalkersthe number of parallel walkers

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 669 of file ModelParameters.h.

◆ set_chain_value()

virtual void cbl::statistics::ModelParameters::set_chain_value ( const int  param,
const int  pos,
const int  ww,
const double  value 
)
inlinevirtual

set the private member m_chain_values at the pp-th step for the ww-th step

Parameters
paramthe parameter index
posthe position in the chain
wwthe walker index
valuethe chain value

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 740 of file ModelParameters.h.

◆ set_chain_values() [1/2]

virtual void cbl::statistics::ModelParameters::set_chain_values ( const std::vector< std::vector< double >>  values,
const int  nwalkers 
)
inlinevirtual

set the chain values

Parameters
valuesthe input chain values
nwalkersthe number of parallel walkers

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 750 of file ModelParameters.h.

◆ set_chain_values() [2/2]

virtual void cbl::statistics::ModelParameters::set_chain_values ( const std::vector< std::vector< std::vector< double >>>  values)
inlinevirtual

set the chain values

Parameters
valuesthe input chain values

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 758 of file ModelParameters.h.

◆ set_parameter_covariance()

virtual void cbl::statistics::ModelParameters::set_parameter_covariance ( const int  start = 0,
const int  thin = 1 
)
inlinevirtual

set the internal method m_parameter_covariance

Parameters
startthe starting position
thinnumber of jumped indexes in the chain

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 529 of file ModelParameters.h.

◆ set_parameters() [1/3]

virtual void cbl::statistics::ModelParameters::set_parameters ( const size_t  nparameters,
const std::vector< std::shared_ptr< PriorDistribution >>  priorDistributions,
std::vector< ParameterType parameterTypes,
std::vector< std::string >  parameterNames 
)
inlinevirtual

set the parameter

Parameters
nparametersthe number of parameters
priorDistributionsthe priorDistributions
parameterTypesthe parameter types
parameterNamesthe parameter names

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 326 of file ModelParameters.h.

◆ set_parameters() [2/3]

void cbl::statistics::ModelParameters::set_parameters ( const size_t  nparameters,
std::vector< ParameterType parameterTypes,
std::vector< std::string >  parameterNames 
)
virtual

set the parameter

Parameters
nparametersthe number of parameters
parameterTypesthe parameter types
parameterNamesthe parameter names

Reimplemented in cbl::statistics::LikelihoodParameters.

Definition at line 159 of file ModelParameters.cpp.

◆ set_parameters() [3/3]

void cbl::statistics::ModelParameters::set_parameters ( const size_t  nparameters,
std::vector< std::string >  parameterNames 
)
virtual

set the parameter

Parameters
nparametersthe number of parameters
parameterNamesthe parameter names

Definition at line 213 of file ModelParameters.cpp.

◆ set_posterior_distribution()

virtual void cbl::statistics::ModelParameters::set_posterior_distribution ( const int  start,
const int  thin,
const int  nbins,
const int  seed = 34121,
const std::vector< double >  weight = {} 
)
inlinevirtual

set the prior distribution for the p-th parameter

Parameters
startthe starting position
thinnumber of jumped indexes in the chain
nbinsthe number of bins
seedseed for random extraction
weightchain weight

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 573 of file ModelParameters.h.

◆ set_prior_distribution() [1/2]

virtual void cbl::statistics::ModelParameters::set_prior_distribution ( const int  p,
const std::shared_ptr< PriorDistribution priorDistribution 
)
inlinevirtual

set the prior distribution for the p-th parameter

Parameters
pthe p-th parameter
priorDistributionthe prior distribution

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 470 of file ModelParameters.h.

◆ set_prior_distribution() [2/2]

virtual void cbl::statistics::ModelParameters::set_prior_distribution ( const std::vector< std::shared_ptr< PriorDistribution >>  priorDistributions)
inlinevirtual

set the prior distributions for the parameters

Parameters
priorDistributionsthe prior distributions

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 479 of file ModelParameters.h.

◆ set_prior_distribution_seed()

virtual void cbl::statistics::ModelParameters::set_prior_distribution_seed ( const std::shared_ptr< random::UniformRandomNumbers_Int ran_generator)
inlinevirtual

set the prior distributions for the parameters

Parameters
ran_generatorthe random generator

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 488 of file ModelParameters.h.

◆ show_results()

virtual void cbl::statistics::ModelParameters::show_results ( const int  start,
const int  thin,
const int  nbins,
const int  seed = 34121,
const bool  show_mode = false,
const int  ns = -1,
const int  nb = -1,
const std::vector< double >  weight = {} 
)
inlinevirtual

show the results on the standard output

Parameters
startthe starting position
thinnumber of jumped indexes in the chain
nbinsthe number of bins
seedseed for random extraction
show_modetrue \(\rightarrow\) show the posterior mode; false \(\rightarrow\) do not show the posterior mode
nsnumber of samples used to estimate the covariance matrix
nbnumber of data measurements, e.g. the bins of the dataset
weightchain weight

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 613 of file ModelParameters.h.

◆ status() [1/2]

virtual std::vector<std::string> cbl::statistics::ModelParameters::status ( ) const
inlinevirtual

return all the model parameter status

Returns
vector containing all the parameter statuss

Reimplemented in cbl::statistics::PosteriorParameters, and cbl::statistics::LikelihoodParameters.

Definition at line 283 of file ModelParameters.h.

◆ status() [2/2]

virtual std::string cbl::statistics::ModelParameters::status ( const int  p) const
inlinevirtual

return the model parameter status

Parameters
pthe index of the parameter
Returns
the parameter status

Reimplemented in cbl::statistics::PosteriorParameters, and cbl::statistics::LikelihoodParameters.

Definition at line 275 of file ModelParameters.h.

◆ type() [1/2]

std::vector<ParameterType> cbl::statistics::ModelParameters::type ( ) const
inline

return all the model parameter names

Returns
vector containing all the parameter names

Definition at line 250 of file ModelParameters.h.

◆ type() [2/2]

ParameterType cbl::statistics::ModelParameters::type ( const int  p) const
inline

return the model parameter type

Parameters
pthe index of the parameter
Returns
vector containing the parameter type

Definition at line 243 of file ModelParameters.h.

◆ write_results()

virtual void cbl::statistics::ModelParameters::write_results ( const std::string  dir,
const std::string  file,
const int  start,
const int  thin,
const int  nbins,
const int  seed = 34121,
const bool  compute_mode = false,
const int  ns = -1,
const int  nb = -1,
const std::vector< double >  weight = {} 
)
inlinevirtual

store the results to file

Parameters
dirname of the output folder
filename of the output file
startthe starting position
thinnumber of jumped indexes in the chain
nbinsthe number of bins
seedseed for random extraction
compute_modetrue \(\rightarrow\) compute the posterior mode; false \(\rightarrow\) do not compute the posterior mode
nsnumber of samples used to estimate the covariance matrix
nbnumber of data measurements, e.g. the bins of the dataset
weightchain weight

Reimplemented in cbl::statistics::PosteriorParameters.

Definition at line 643 of file ModelParameters.h.


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