![]() |
CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
|
The class Modelling_ThreePointCorrelation. More...
#include <Modelling_ThreePointCorrelation.h>
Public Member Functions | |
measure::threept::ThreePType | threePType () |
return the type of correlation function More... | |
void | set_data_model (const std::vector< double > Q_DM) |
set the data model for the three-point correlation function More... | |
void | set_data_model_zeta_RSD (const double r1, const double r2, const cbl::cosmology::Cosmology cosmology, const double redshift, const std::string method_Pk="CAMB", const bool NL=false, const int max_ll=5, const double k_min=1.e-4, const double k_max=100, const int step_k=500, const double r_min=1.e-4, const double r_max=200, const int step_r=200, const bool force_realSpace=false, const bool use_k=false, const bool store_output=true, const std::string output_root=cbl::par::defaultString, const int norm=-1, const double prec=1.e-4) |
set the data model for the three-point correlation function (see Slepian, Eisenstein 2017) More... | |
void | set_data_Q_nonlocal (const cosmology::Cosmology cosmology, const double r1, const double r2, const std::vector< double > theta, const std::string model, const std::vector< double > kk, const std::vector< double > Pk_matter) |
set the data model for the three-point correlation function with non-local contributions More... | |
![]() | |
void | m_set_posterior (const int seed) |
set the interal variable m_posterior More... | |
Modelling ()=default | |
default constuctor | |
virtual | ~Modelling ()=default |
default destructor | |
std::shared_ptr< data::Data > | data () |
return the dataset More... | |
std::shared_ptr< data::Data > | data_fit () |
return the dataset More... | |
std::shared_ptr< statistics::Likelihood > | likelihood () |
return the likelihood parameters More... | |
std::shared_ptr< statistics::Posterior > | posterior () |
return the posterior parameters More... | |
std::shared_ptr< statistics::ModelParameters > | likelihood_parameters () |
return the likelihood parameters More... | |
std::shared_ptr< statistics::ModelParameters > | posterior_parameters () |
return the posterior parameters More... | |
virtual void | set_parameter_from_string (const std::string parameter, const double value) |
set the value of a parameter providing its name string More... | |
virtual double | get_parameter_from_string (const std::string parameter) const |
get the value of a parameter providing its name string More... | |
std::shared_ptr< statistics::PriorDistribution > | get_prior (const int i) |
get the internal variable m_parameter_priors More... | |
std::shared_ptr< statistics::Model > | get_response_function () |
return the response function used to compute the super-sample covariance More... | |
void | reset_fit_range () |
reset the fit range More... | |
void | set_fit_range (const double xmin, const double xmax) |
set the fit range More... | |
void | set_fit_range (const double xmin, const double xmax, const double ymin, const double ymax) |
set the fit range More... | |
void | set_data (const std::shared_ptr< data::Data > dataset) |
set the dataset More... | |
void | set_likelihood (const statistics::LikelihoodType likelihood_type, const std::vector< size_t > x_index={0, 2}, const int w_index=-1, const double prec=1.e-10, const int Nres=-1) |
set the likelihood function More... | |
void | set_likelihood (const cbl::statistics::Likelihood_function log_likelihood_function) |
set the likelihood function, given a user-defined log-likelihood function More... | |
void | maximize_likelihood (const std::vector< double > start, const std::vector< std::vector< double >> parameter_limits, const unsigned int max_iter=10000, const double tol=1.e-6, const double epsilon=1.e-3) |
function that maximizes the posterior, finds the best-fit parameters and stores them in the model More... | |
void | maximize_posterior (const std::vector< double > start, const unsigned int max_iter=10000, const double tol=1.e-6, const double epsilon=1.e-3, const int seed=666) |
function that maximizes the posterior, finds the best-fit parameters and stores them in the model More... | |
void | sample_posterior (const int chain_size, const int nwalkers, const int seed=666, const double aa=2, const bool parallel=true) |
sample the posterior, initializing the chains by drawing from the prior distributions More... | |
void | sample_posterior (const int chain_size, const int nwalkers, const double radius, const std::vector< double > start, const unsigned int max_iter=10000, const double tol=1.e-6, const double epsilon=1.e-3, const int seed=666, const double aa=2, const bool parallel=true) |
sample the posterior, initializing the chains in a ball around the posterior best-fit parameters values More... | |
void | sample_posterior (const int chain_size, const int nwalkers, std::vector< double > &value, const double radius, const int seed=666, const double aa=2, const bool parallel=true) |
sample the posterior, initializing the chains by drawing from the prior distributions More... | |
void | sample_posterior (const int chain_size, const std::vector< std::vector< double >> chain_value, const int seed=666, const double aa=2, const bool parallel=true) |
sample the posterior, initializing the chains with input values More... | |
void | sample_posterior (const int chain_size, const int nwalkers, const std::string input_dir, const std::string input_file, const int seed=666, const double aa=2, const bool parallel=true) |
sample the posterior, initializing the chains reading the input values from an input file More... | |
void | importance_sampling (const std::string input_dir, const std::string input_file, const int seed=666, const std::vector< size_t > column={}, const int header_lines_to_skip=1, const bool is_FITS_format=false, const bool apply_to_likelihood=false) |
perform importance sampling More... | |
void | write_chain (const std::string output_dir, const std::string output_file, const int start=0, const int thin=1, const bool is_FITS_format=false, const int prec=5, const int ww=14) |
write the chains obtained after the MCMC sampling More... | |
void | read_chain (const std::string input_dir, const std::string input_file, const int nwalkers, const std::vector< size_t > columns={}, const int skip_header=1, const bool fits=false) |
read the chains More... | |
void | show_results (const int start=0, const int thin=1, const int nbins=50, const bool show_mode=false, const int ns=-1) |
show the results of the MCMC sampling on screen More... | |
void | write_results (const std::string output_dir, const std::string root_file, const int start=0, const int thin=1, const int nbins=50, const bool fits=false, const bool compute_mode=false, const int ns=-1) |
write the results of the MCMC sampling to file More... | |
virtual void | write_model (const std::string output_dir, const std::string output_file, const std::vector< double > xx, const std::vector< double > parameters) |
write the model at xx for given parameters More... | |
virtual void | write_model (const std::string output_dir, const std::string output_file, const std::vector< double > xx, const std::vector< double > yy, const std::vector< double > parameters) |
write the model at xx, yy for given parameters More... | |
virtual void | write_model_at_bestfit (const std::string output_dir, const std::string output_file, const std::vector< double > xx) |
write the model at xx with best-fit parameters obtained from posterior maximization More... | |
virtual void | write_model_at_bestfit (const std::string output_dir, const std::string output_file, const std::vector< double > xx, const std::vector< double > yy) |
write the model at xx, yy with best-fit parameters obtained from likelihood maximization More... | |
virtual void | write_model_from_chains (const std::string output_dir, const std::string output_file, const std::vector< double > xx, const int start=0, const int thin=1) |
write the model at xx computing 16th, 50th and 84th percentiles from the chains More... | |
virtual void | write_model_from_chains (const std::string output_dir, const std::string output_file, const std::vector< double > xx, const std::vector< double > yy, const int start=0, const int thin=1) |
write the model at xx, yy computing 16th, 50th and 84th percentiles from the chains More... | |
double | reduced_chi2 (const std::vector< double > parameter={}) |
the reduced \(\chi^2\) More... | |
Protected Attributes | |
measure::threept::ThreePType | m_threePType |
the three-point correlation function type | |
modelling::threept::STR_data_model_threept | m_data_model |
the container of parameters for three-point correlation function model computation | |
![]() | |
std::shared_ptr< data::Data > | m_data = NULL |
input data to be modelled | |
bool | m_fit_range = false |
check if fit range has been set | |
std::shared_ptr< data::Data > | m_data_fit |
input data restricted to the range used for the fit | |
std::shared_ptr< statistics::Model > | m_model = NULL |
input model | |
std::shared_ptr< statistics::Model > | m_response_func = NULL |
response function for the computation of the super-sample covariance | |
std::shared_ptr< statistics::Likelihood > | m_likelihood = NULL |
likelihood | |
std::vector< std::shared_ptr< statistics::PriorDistribution > > | m_parameter_priors |
prior | |
std::shared_ptr< statistics::Posterior > | m_posterior = NULL |
posterior | |
Constructors/destructors | |
Modelling_ThreePointCorrelation ()=default | |
default constuctor ThreePointCorrelation | |
Modelling_ThreePointCorrelation (const std::shared_ptr< cbl::measure::threept::ThreePointCorrelation > threep) | |
constuctor More... | |
virtual | ~Modelling_ThreePointCorrelation ()=default |
default destructor | |
static std::shared_ptr< Modelling_ThreePointCorrelation > | Create (const std::shared_ptr< measure::threept::ThreePointCorrelation > threep) |
static factory used to construct modelling of three-point correlation functions of any type More... | |
static std::shared_ptr< Modelling_ThreePointCorrelation > | Create (const measure::threept::ThreePType threePType, const std::shared_ptr< data::Data > threept_dataset) |
static factory used to construct modelling of three-point correlation functions of any type More... | |
Additional Inherited Members | |
![]() | |
void | m_set_prior (std::vector< statistics::PriorDistribution > prior_distribution) |
set the internal variable m_parameter_priors More... | |
void | m_isSet_response () |
check if the response function used to compute the super-sample covariance is set | |
The class Modelling_ThreePointCorrelation.
Modelling_ThreePointCorrelation.h "Headers/Modelling_ThreePointCorrelation.h"
This file defines the interface of the base class Modelling_ThreePointCorrelation, used for modelling any kind of three-point correlation function measurements
Definition at line 72 of file Modelling_ThreePointCorrelation.h.
|
inline |
constuctor
threep | the three-point correlation function to model _ThreePointCorrelation |
Definition at line 100 of file Modelling_ThreePointCorrelation.h.
|
static |
static factory used to construct modelling of three-point correlation functions of any type
threePType | type of the three-point correlation function |
threept_dataset | the dataset containing the three-point correlation function to model |
Definition at line 78 of file Modelling_ThreePointCorrelation.cpp.
|
static |
static factory used to construct modelling of three-point correlation functions of any type
threep | the three-point correlation function to model |
Definition at line 55 of file Modelling_ThreePointCorrelation.cpp.
void cbl::modelling::threept::Modelling_ThreePointCorrelation::set_data_model | ( | const std::vector< double > | Q_DM | ) |
set the data model for the three-point correlation function
Q_DM | vector contaning the DM reduced three-point correlation function |
Definition at line 100 of file Modelling_ThreePointCorrelation.cpp.
void cbl::modelling::threept::Modelling_ThreePointCorrelation::set_data_model_zeta_RSD | ( | const double | r1, |
const double | r2, | ||
const cbl::cosmology::Cosmology | cosmology, | ||
const double | redshift, | ||
const std::string | method_Pk = "CAMB" , |
||
const bool | NL = false , |
||
const int | max_ll = 5 , |
||
const double | k_min = 1.e-4 , |
||
const double | k_max = 100 , |
||
const int | step_k = 500 , |
||
const double | r_min = 1.e-4 , |
||
const double | r_max = 200 , |
||
const int | step_r = 200 , |
||
const bool | force_realSpace = false , |
||
const bool | use_k = false , |
||
const bool | store_output = true , |
||
const std::string | output_root = cbl::par::defaultString , |
||
const int | norm = -1 , |
||
const double | prec = 1.e-4 |
||
) |
set the data model for the three-point correlation function (see Slepian, Eisenstein 2017)
r1 | the first triangle side |
r2 | the second triangle side |
cosmology | the fiducial cosmology |
redshift | the redshift |
method_Pk | method used to compute the power spectrum; valid choices for method_Pk are: CAMB [http://camb.info/], CLASS [http://class-code.net/], MPTbreeze-v1 [http://arxiv.org/abs/1207.1465], EisensteinHu [http://background.uchicago.edu/~whu/transfer/transferpage.html] |
NL | 0 → linear power spectrum; 1 → non-linear power spectrum |
max_ll | the maximum legendre multipole in 3pcf model |
k_min | minimum wave vector module up to which the binned dark matter power spectrum is computed |
k_max | maximum wave vector module up to which the binned dark matter power spectrum is computed |
step_k | number of steps used to compute the binned dark matter correlation function |
r_min | minimum separation up to which the integrals of the tree-level 3pcf are computed |
r_max | maximum separation up to which the integrals of the tree-level 3pcf are computed |
step_r | number of steps used to compute the integrals of the tree-level 3pcf |
force_realSpace | \( \rightarrow \) redshift-space model; 1 \( \rightarrow \) real-space model |
use_k | false \( \rightarrow \) do not compute k-integrals; true \( \rightarrow \) compute k-integrals @param use_k → do not compute the k-integrals; 1→ compute the k-integrals |
store_output | if true the output files created by the Boltmann solver are stored; if false the output files are removed |
output_root | the output file root |
norm | 0 → don't normalize the power spectrum; 1 → normalize the power spectrum |
prec | accuracy of the GSL integration |
Definition at line 124 of file Modelling_ThreePointCorrelation.cpp.
void cbl::modelling::threept::Modelling_ThreePointCorrelation::set_data_Q_nonlocal | ( | const cosmology::Cosmology | cosmology, |
const double | r1, | ||
const double | r2, | ||
const std::vector< double > | theta, | ||
const std::string | model, | ||
const std::vector< double > | kk, | ||
const std::vector< double > | Pk_matter | ||
) |
set the data model for the three-point correlation function with non-local contributions
cosmology | the fiducial cosmology |
r1 | the first triangle side |
r2 | the second triangle side |
theta | vector of theta |
model | method used to compute the 3pcf |
kk | vector containing wavevector moduls |
Pk_matter | vector containing the theoretical dark matter power-spectrum |
Definition at line 109 of file Modelling_ThreePointCorrelation.cpp.
|
inline |
return the type of correlation function
Definition at line 143 of file Modelling_ThreePointCorrelation.h.