![]() |
CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
|
The class PosteriorDistribution. More...
#include "Headers/PosteriorDistribution.h"


Public Member Functions | |
Constructors/destructors | |
| PosteriorDistribution () | |
| default constructor | |
| PosteriorDistribution (const glob::DistributionType posteriorType, const double value) | |
| constructor of a constant distribution More... | |
| PosteriorDistribution (const glob::DistributionType distributionType, const std::vector< double > discrete_values, const std::vector< double > weights, const int seed=1) | |
| constructor More... | |
| PosteriorDistribution (const glob::DistributionType distributionType, const std::vector< double > var, const std::vector< double > dist, const int nbin, const std::string interpolationType, const int seed=1) | |
| constructor More... | |
| ~PosteriorDistribution ()=default | |
| default destructor | |
Public Member Functions inherited from cbl::glob::Distribution | |
| DistributionType | distributionType () const |
| return the distribution type More... | |
| double | operator() (double xx) |
| evaluate distribution More... | |
| double | log_distribution (double xx) |
| evaluate log-distribution More... | |
| void | set_seed (const int seed) |
| set distribution seed More... | |
| void | set_limits (const double xmin, const double xmax) |
| set the distribution limits More... | |
| void | set_constant_distribution (const double value) |
| set a constant distribution More... | |
| void | set_uniform_distribution (const double xmin, const double xmax, const int seed=1) |
| set an uniform distribution with input limits and seed More... | |
| void | set_gaussian_distribution (const double mean, const double sigma, const int seed=1) |
| set normal distribution More... | |
| void | set_poisson_distribution (const double mean, const int seed=1) |
| set poisson distribution More... | |
| void | set_custom_distribution (const distribution_func func, const std::shared_ptr< void > distribution_fixed_pars, const std::vector< double > distribution_pars, const int seed=1) |
| set a custom distribution More... | |
| void | set_discrete_values (const std::vector< double > discrete_values, const std::vector< double > weights, const int seed=1) |
| set discrete distribution values and weights More... | |
| void | set_binned_distribution (const std::vector< double > var, const std::vector< double > dist, const std::string interpolationType="Spline", const int seed=1) |
| set discrete distribution values and weights More... | |
| double | xmin () const |
| return the private member m_xmin More... | |
| double | xmax () const |
| return the private member m_xmax More... | |
| double | get_mean () const |
| return the private member m_mean More... | |
| double | get_sigma () const |
| return the private member m_sigma More... | |
| double | get_seed () const |
| return the private member m_seed More... | |
| double | distribution_range () const |
| the distribution range More... | |
| bool | isIncluded (const double value) const |
| check if a value is included in the distribution limits More... | |
| double | sample () const |
| sample a value from the distribution More... | |
| double | sample (const int seed) |
| sample a value from the distribution More... | |
| std::vector< double > | sample_vector (const int nvalues) |
| sample values from the distribution More... | |
| double | mean () |
| return the mean value of the distribution More... | |
| double | variance () |
| return the standard deviation of the distribution More... | |
| double | std () |
| return the standard deviation of the distribution More... | |
| double | skewness () |
| return the skewness of the distribution More... | |
| double | kurtosis () |
| return the kurtosis of the distribution More... | |
| std::vector< double > | moments () |
| return the moments of the distribution distribution More... | |
| double | median () |
| return the median of the distibution More... | |
| double | percentile (const unsigned int i) |
| return the i-th percentile of the distribution More... | |
| double | mode () |
| return the distribution mode More... | |
| void | get_distribution (std::vector< double > &xx, std::vector< double > &fx, std::vector< double > &err, const std::vector< double > FF, const std::vector< double > WW, const int nbin, const bool linear=true, const std::string file_out=par::defaultString, const double fact=1., const double V1=par::defaultDouble, const double V2=par::defaultDouble, const bool bin_type=true, const bool conv=false, const double sigma=0.) |
| derive and store the number distribution of a given std::vector More... | |
| Distribution () | |
| default constructor | |
| Distribution (const DistributionType distributionType, const double value) | |
| constructor of a constant distribution More... | |
| Distribution (const DistributionType distributionType, const double xmin, const double xmax, const int seed=3213) | |
| constructor of a flat distribution More... | |
| Distribution (const DistributionType distributionType, const std::vector< double > distribution_params, const double xmin, const double xmax, const int seed=1) | |
| constructor More... | |
| Distribution (const DistributionType distributionType, const distribution_func func, const std::shared_ptr< void > distribution_fixed_pars, const std::vector< double > distribution_pars, const double xmin, const double xmax, const int seed=1) | |
| constructor More... | |
| Distribution (const DistributionType distributionType, const std::vector< double > discrete_values, const std::vector< double > weights, const int seed=1) | |
| constructor More... | |
| Distribution (const DistributionType distributionType, const std::vector< double > var, const std::vector< double > dist, const int nbin, const std::string interpolationType, const int seed=1) | |
| constructor More... | |
| ~Distribution ()=default | |
| default destructor | |
Additional Inherited Members | |
Protected Member Functions inherited from cbl::glob::Distribution | |
| void | m_set_distribution_normalization () |
| set distribution normalization | |
| double | m_moments_integrator (const double xx, const unsigned int order) |
| integrand of the moments distribution More... | |
| double | m_central_moments_integrator (const double xx, const unsigned int order) |
| integrand of the central moments of the distribution More... | |
| double | m_percentile_integrator (const double xx) |
| integrand of the percentile of the distribution More... | |
Protected Attributes inherited from cbl::glob::Distribution | |
| DistributionType | m_distributionType |
| the type of distribution | |
| distribution_func | m_func |
| the probability distribution function | |
| std::shared_ptr< random::RandomNumbers > | m_distribution_random |
| the distribution random generator | |
| double | m_xmin |
| the distribution lower limit | |
| double | m_xmax |
| the distribution upper limit | |
| std::vector< double > | m_distribution_func_pars |
| the parameters of the distribution function | |
| std::shared_ptr< void > | m_distribution_func_fixed_pars |
| void pointer for the distribution function | |
| double | m_distribution_normalization |
| the distribution normalization | |
| double | m_log_distribution_normalization |
| the natural log of distribution normalization | |
| double | m_mean |
| the distribution mean | |
| double | m_variance |
| the distribution variance | |
| double | m_sigma |
| the distribution standard deviation | |
| int | m_seed |
| the distribution seed | |
The class PosteriorDistribution.
This class is used to define the distribution
Definition at line 53 of file PosteriorDistribution.h.
|
inline |
constructor of a constant distribution
| posteriorType | the type of distribution to be created |
| value | the value to be returned |
Definition at line 78 of file PosteriorDistribution.h.
|
inline |
constructor
| distributionType | the type of distribution to be created |
| discrete_values | list of discrete values |
| weights | list of weights for discrete values |
| seed | the distribution seed for random sampling |
Definition at line 93 of file PosteriorDistribution.h.
|
inline |
constructor
| distributionType | the type of distribution to be created |
| var | vector containing binned values |
| dist | list of distribution values for each bin |
| nbin | the number of bins |
| interpolationType | the kind of interpolation |
| seed | the distribution seed for random sampling |
Definition at line 112 of file PosteriorDistribution.h.