This example shows how to model the projected two-point correlation function to constrain the linear bias
try {
const std::string file_catalogue = "../input/cat.dat";
const std::string dir_output = "../output/";
const std::string dir_pairs = dir_output+"pairs/";
const std::string dir_covariance = dir_output+"covariance/";
const std::string MK = "mkdir -p "+dir_output+" "+dir_pairs+" "+dir_covariance; if (system(MK.c_str())) {}
std::cout << "I'm reading the input catalogue..." << std::endl;
const double N_R = 3.;
const double rpMin = 10.;
const double rpMax = 30.;
const int nbins_D1 = 3;
const double shift_D1 = 0.5;
const double piMin = 0.;
const double piMax = 50.;
const int nbins_D2 = 10;
const double shift_D2 = 0.5;
const double piMax_integral = 50.;
const auto TwoP =
cbl::measure::twopt::TwoPointCorrelation::Create(
cbl::measure::twopt::TwoPType::_projected_, catalogue, random_catalogue,
cbl::BinType::_logarithmic_, rpMin, rpMax, nbins_D1, shift_D1, piMin, piMax, nbins_D2, shift_D2, piMax_integral);
TwoP->write(dir_output, "wp.dat");
const double redshift = 1.;
const int chain_size = 1000;
const int nwalkers = 10;
const int seed = 666;
const int burn_in = 0.;
const int thin = 1.;
const std::string filename = "model_projected";
}
return 0;
}
int main()
main function to create the logo of the CosmoBolognaLib
The class Modelling_TwoPointCorrelation_projected.
void set_sigma8(const double sigma8=-1.)
set the value of σ8
const char * what() const noexcept override
the error description
static std::shared_ptr< TwoPointCorrelation > Create(const TwoPType type, const catalogue::Catalogue data, const catalogue::Catalogue random, const BinType binType, const double Min, const double Max, const int nbins, const double shift, const CoordinateUnits angularUnits=CoordinateUnits::_radians_, std::function< double(double)> angularWeight=nullptr, const bool compute_extra_info=false, const double random_dilution_fraction=1.)
static factory used to construct two-point correlation functions of any type
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
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
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
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
void set_fit_range(const double xmin, const double xmax)
set the fit range
void set_data_model(const cbl::cosmology::Cosmology cosmology, const double redshift, const std::string method_Pk="CAMB", const double sigmaNL_perp=0., const double sigmaNL_par=0., const bool NL=true, const double bias=1., const double pimax=40., const double r_min=1., const double r_max=350., const double k_min=1.e-4, const double k_max=100., const int step=500, const std::string output_dir=par::defaultString, const std::string output_root="test", const int norm=-1, const double aa=0., const bool GSL=true, const double prec=1.e-3, const std::string file_par=par::defaultString, const double Delta=200., const bool isDelta_critical=true, const std::vector< double > cluster_redshift={}, const std::vector< double > cluster_mass_proxy={}, const std::vector< double > cluster_mass_proxy_error={}, const std::string model_bias="Tinker", const std::string meanType="mean_bias", const int seed=666, const cbl::cosmology::Cosmology cosmology_mass={}, const std::vector< double > redshift_source={})
set the data used to construct generic models of the two-point correlation function
The class Modelling_TwoPointCorrelation_projected.
void set_model_linearBias(const statistics::PriorDistribution bsigma8_prior)
set the model to fit the projected two-point correlation function assuming a linear bias
@ _createRandom_box_
random catalogue with cubic geometry (or parallelepiped) in comoving coordinates
@ _Uniform_
Identity function.
@ _projected_
the projected two-point correlation function, w(rp)
@ _Poisson_
Poissonian error.
@ _Gaussian_Covariance_
Gaussian likelihood covariance.
@ _observed_
observed coordinates (R.A., Dec, redshift)
@ _logarithmic_
logarithmic binning