This example shows how to model redshift-space distortions in the monopole of the two-point correlation function
try {
const std::string file_catalogue = "../input/cat.dat";
const double N_R = 1.;
const double rMin = 10.;
const double rMax = 30.;
const int nbins = 10;
const double shift = 0.5;
const std::string dir = "../output/";
const std::string file = "xi.dat";
TwoP->write(dir, file);
const double redshift = 1.;
const double xmin = 10.;
const double xmax = 40.;
const int chain_size = 1000;
const int nwalkers = 10;
const int seed = 666;
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_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
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
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 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
The class Modelling_TwoPointCorrelation1D_monopole.
void set_model_Kaiser(const statistics::PriorDistribution fsigma8_prior={}, const statistics::PriorDistribution bsigma8_prior={})
set the parameters to model the monopole of the two-point correlation function in redshift space
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.
@ _createRandom_box_
random catalogue with cubic geometry (or parallelepiped) in comoving coordinates
@ _Uniform_
Identity function.
@ _monopole_
the angle-averaged two-point correlation function, i.e. the monopole, ξ(r)
@ _Poisson_
Poissonian error.
@ _Gaussian_Error_
Gaussian likelihood error.
@ _observed_
observed coordinates (R.A., Dec, redshift)
std::vector< T > logarithmic_bin_vector(const size_t nn, const T min, const T max)
fill a std::vector with logarithmically spaced values