This example shows how to model baryon acoustic oscillations in the monopole of the two-point correlation function
try {
const double hh = 0.7;
const double Omega_b = 0.0224/(hh*hh);
const double Omega_M = 0.274;
const double n_s = 0.96;
const double sigma8 = 0.8;
const std::string dir_input = "../input/";
const std::string dir_output = "../output/";
const std::string dir_chains = dir_output+"chains/";
const std::string MK = "mkdir -p "+dir_output+" "+dir_chains; if (system(MK.c_str())) {}
const std::string file_xi = dir_input+"Anderson_2013_CMASSDR11_monopole_prerecon.dat";
const std::string file_cov = dir_input+"Anderson_2013_CMASSDR11_monopole_prerecon_cov.dat";
const int skipped_lines = 1;
const auto twop_dataset = std::make_shared<cbl::data::Data1D>(
cbl::data::Data1D(file_xi, skipped_lines));
twop_dataset->set_covariance(file_cov);
const double redshift = 0.57;
const double sigmaNL = 8.;
model_twop.
set_data_model(cosmology, redshift,
"CAMB", sigmaNL, sigmaNL,
false, 2.);
model_twop.
set_model_BAO(alpha_prior, BB_prior, A0_prior, A1_prior, A2_prior);
const int chain_size = 1000;
const int nwalkers = 100;
const std::string chain_file = "Anderson_2013_CMASSDR11_monopole_prerecon_chains.dat";
const double xmin = 40., xmax = 160.;
const int burn_in = 100;
const int thin = 10;
}
return 0;
}
int main()
main function to create the logo of the CosmoBolognaLib
The class Modelling_TwoPointCorrelation1D_monopole.
void set_parameters(const std::vector< CosmologicalParameter > parameter, const std::vector< double > value)
set the value of some cosmological paramters
const char * what() const noexcept override
the error description
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
The class Modelling_TwoPointCorrelation1D_monopole.
void set_model_BAO(const statistics::PriorDistribution alpha_prior={}, const statistics::PriorDistribution bs8_prior={}, const statistics::PriorDistribution A0_prior={}, const statistics::PriorDistribution A1_prior={}, const statistics::PriorDistribution A2_prior={})
set the function to model the monopole of the two-point correlation function, taking into accout geom...
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 PriorDistribution.
@ _sigma8_
: the power spectrum normalisation
@ _hh_
: the Hubble constant at z=0 divided by 100
@ _Omega_matter_LCDM_
: the density of baryons, cold dark matter and massive neutrinos (in units of the critical density) a...
@ _Omega_baryon_
: the baryon density at z=0
@ _n_spec_
: the primordial spectral index
@ _Uniform_
Identity function.
@ _Gaussian_Covariance_
Gaussian likelihood covariance.