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

The class PriorDistribution. More...

#include "Headers/PriorDistribution.h"

Inherits cbl::glob::CombinedDistribution.

Public Member Functions

Constructors/destructors
 PriorDistribution ()
 default constructor
 
 PriorDistribution (const glob::DistributionType priorType, const double value)
 constructor of a constant distribution More...
 
 PriorDistribution (const glob::DistributionType priorType, const double xmin, const double xmax, const int seed=1)
 constructor of a flat distribution More...
 
 PriorDistribution (const glob::DistributionType priorType, const std::vector< double > prior_params, const double xmin, const double xmax, const int seed=1)
 constructor More...
 
 PriorDistribution (const glob::DistributionType priorType, const distribution_func prior_func, const std::shared_ptr< void > prior_fixed_pars, const std::vector< double > prior_pars, const double xmin, const double xmax, const int seed=1)
 constructor More...
 
 PriorDistribution (const glob::DistributionType priorType, const std::vector< double > discrete_values, const std::vector< double > weights, const int seed=1)
 constructor More...
 
 PriorDistribution (const glob::DistributionType priorType, const std::vector< double > var, const std::vector< double > dist, const int nbin, const std::string interpolationType, const int seed=1)
 constructor More...
 
 PriorDistribution (const glob::DistributionType priorType, const std::vector< double > meanVec, const std::vector< std::vector< double >> covMat, const std::vector< double > xMinVec, const std::vector< double > xMaxVec, const int seed=3213)
 constructor of multidimensional distributions More...
 
 PriorDistribution (const std::string filename, const std::string path, const std::vector< int > columns_to_read, const int skip_nlines=0, const int type_data=0, const bool normalize=true, const int distNum=200, const double rMAX=2, const double cell_size=2)
 constructor of multidimensional distributions from external chains More...
 
 ~PriorDistribution ()=default
 default destructor
 

Detailed Description

Constructor & Destructor Documentation

◆ PriorDistribution() [1/8]

cbl::statistics::PriorDistribution::PriorDistribution ( const glob::DistributionType  priorType,
const double  value 
)
inline

constructor of a constant distribution

Parameters
priorTypethe type of distribution to be created
valuethe value to be returned

Definition at line 77 of file PriorDistribution.h.

◆ PriorDistribution() [2/8]

cbl::statistics::PriorDistribution::PriorDistribution ( const glob::DistributionType  priorType,
const double  xmin,
const double  xmax,
const int  seed = 1 
)
inline

constructor of a flat distribution

Parameters
priorTypethe type of distribution to be created
xminlower limit of the distribution
xmaxupper limit of the distribution
seedthe distribution seed for random sampling

Definition at line 91 of file PriorDistribution.h.

◆ PriorDistribution() [3/8]

cbl::statistics::PriorDistribution::PriorDistribution ( const glob::DistributionType  priorType,
const std::vector< double >  prior_params,
const double  xmin,
const double  xmax,
const int  seed = 1 
)
inline

constructor

Parameters
priorTypethe type of distribution to be created
prior_paramsparameters of the distribution function or discrete list of values for discrete distribution
xminlower limit of the distribution
xmaxupper limit of the distribution
seedthe distribution seed for random sampling

Definition at line 108 of file PriorDistribution.h.

◆ PriorDistribution() [4/8]

cbl::statistics::PriorDistribution::PriorDistribution ( const glob::DistributionType  priorType,
const distribution_func  prior_func,
const std::shared_ptr< void >  prior_fixed_pars,
const std::vector< double >  prior_pars,
const double  xmin,
const double  xmax,
const int  seed = 1 
)
inline

constructor

Parameters
priorTypethe type of distribution to be created
prior_functhe functional form of the distribution
prior_fixed_parsthe fixed parameters
prior_parsthe distribution parameters
xminlower limit of the distribution
xmaxupper limit of the distribution
seedthe distribution seed for random sampling

Definition at line 129 of file PriorDistribution.h.

◆ PriorDistribution() [5/8]

cbl::statistics::PriorDistribution::PriorDistribution ( const glob::DistributionType  priorType,
const std::vector< double >  discrete_values,
const std::vector< double >  weights,
const int  seed = 1 
)
inline

constructor

Parameters
priorTypethe type of distribution to be created
discrete_valueslist of discrete values
weightslist of weights for discrete values
seedthe distribution seed for random sampling

Definition at line 144 of file PriorDistribution.h.

◆ PriorDistribution() [6/8]

cbl::statistics::PriorDistribution::PriorDistribution ( const glob::DistributionType  priorType,
const std::vector< double >  var,
const std::vector< double >  dist,
const int  nbin,
const std::string  interpolationType,
const int  seed = 1 
)
inline

constructor

Parameters
priorTypethe type of distribution to be created
varvector containing binned values
distlist of distribution values for each bin
nbinthe number of bins
interpolationTypethe kind of interpolation
seedthe distribution seed for random sampling

Definition at line 163 of file PriorDistribution.h.

◆ PriorDistribution() [7/8]

cbl::statistics::PriorDistribution::PriorDistribution ( const glob::DistributionType  priorType,
const std::vector< double >  meanVec,
const std::vector< std::vector< double >>  covMat,
const std::vector< double >  xMinVec,
const std::vector< double >  xMaxVec,
const int  seed = 3213 
)
inline

constructor of multidimensional distributions

Parameters
priorTypethe type of combined distribution to be created (only Gaussian type available for the moment)
meanVecvector containing the mean of the distributions
covMatthe covariance matrix of the multidimensional distribution
xMinVecvector containing the minima of the distributions
xMaxVecvector containing the maxima of the distributions
seedthe distribution seed for random sampling

Definition at line 184 of file PriorDistribution.h.

◆ PriorDistribution() [8/8]

cbl::statistics::PriorDistribution::PriorDistribution ( const std::string  filename,
const std::string  path,
const std::vector< int >  columns_to_read,
const int  skip_nlines = 0,
const int  type_data = 0,
const bool  normalize = true,
const int  distNum = 200,
const double  rMAX = 2,
const double  cell_size = 2 
)
inline

constructor of multidimensional distributions from external chains

Parameters
filenamethe name of the file to read
paththe path where the file is stored
columns_to_readvector of integers correspondent to the columns to read. The first columns has index 1. The last number of the vector represents the column with the values of the Posterior distribution
skip_nlinesthe number of lines to skip at the beginning of the file
type_datathe type of data read as last column: 0 \(\rightarrow\) log(posterior), 1 \(\rightarrow\) posterior, 2 \(\rightarrow\) chi2
normalizeif true the posterior distribution is normalized between 0 and 1
distNumthe maximum number of points used to interpolate
rMAXthe radius used to search for close points
cell_sizethe size of cells of the normalised chain mesh (each side has lenght 100)

Definition at line 219 of file PriorDistribution.h.


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