{'fraction_non_alphanumeric': 0.024264606208485834, 'fraction_numerical': 0.0064389318151009895, 'mean_word_length': 4.797642436149312, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Bayesian evidence as a tool for comparing datasets

We introduce a new conservative test for quantifying the consistency of two or more datasets. The test is based on the Bayesian answer to the question, ``How much more probable is it that all my data were generated from the same model system than if each dataset were generated from an independent set of model parameters?''. We make explicit the connection between evidence ratios and the differences in peak chi-squared values, the latter of which are more widely used and more cheaply calculated. Calculating evidence ratios for three cosmological datasets (recent CMB data (WMAP, ACBAR, CBI, VSA), SDSS and the most recent SNe Type 1A data) we find that concordance is favoured and the tightening of constraints on cosmological parameters is indeed justified.


I. INTRODUCTION
The apparent mutual agreement of a wide range of cosmological observations has led to the current climate of "concordance" in cosmology [1,2,3,4,5,6,7,8]. The practice of combining independent datasets, by the multiplication of their associated likelihood functions, in order to increase the precision of the parameters of the world model is now standard, but quantitative consistency checking is emphasised to a much lesser degree. As all physicists will agree, accurate cosmology is preferable to precision cosmology, and it is this that motivates this short communication.
The purpose of this work is to demonstrate one application of Bayesian model selection, that of checking that the far simpler model of a universal set of parameters for modeling all datasets is justified by the data themselves: in doing so we make the connection between the Bayesian formulation of the problem and the pragmatic approach taken at much lower computational cost by the experimental community. In this work we show that, as is so often the case, the standard approach is justified on the grounds of common sense, and demonstrate the reduction of this common sense to calculation via probability theory.
As usual, the route to model selection is via the Bayesian evidence. The evidence for a model H from data d is just the probability Pr(d|H), and can be calculated in principle by marginalising the unnormalised posterior probability distribution function over all M parameters θ in the model: In practice, calculating this integral is rarely feasible, but other techniques exist to provide estimates of the evidence [see, for example , 9]. More detailed introductions to the evidence and its central role in the problem of model selection are available elsewhere [10,11] -here we make the general remarks that the evidence increases sharply with increasing goodness-of-fit, and decreases with increasing model complexity (quantifying the principle of Occam's razor). We show later explicitly how these two aspects come to the surface and, for the specific case of Gaussian measurement errors, result in model selection proceeding by the comparison of differences in the ubiquitous chi-squared statistic with an "Occam" factor which takes the form of an effective number of parameters. The more general approach advocated here is applicable to any likelihood functions (Pr(d|θ, H)), not just those having Gaussian form, and takes into account the full extent of the pdf's involved. It is of course also sensitive to the parameters' prior pdf (Pr(θ|H)): broader priors represent more complex models and so naturally give lower evidence values. Evidence is the natural tool for comparing datasets in this way: it enables us to quantify such questions as "Is the mismatch between two experiments large enough to warrant investigation into possible sources of systematics or new physics?" The simplest model for all the cosmological data in hand is that they provide information on the same set of cosmological parameters: this is the standard assumption made in all the joint analyses to date. Let H 0 represent the hypothesis that "there is one set of parameters that describes our cosmological model." In other words, we believe that we understand both cosmology and our experiments to the extent that there should be no further freedom beyond the parameters specified. However, if we are interested in accuracy as well as precision then we should take care to allow for systematic differences be-tween datasets: the most extreme case would be the one where the observations were in such strong disagreement that they appeared to give conflicting measurements of all the model parameters. In this case one could consider the hypothesis H 1 that "there is a different set of parameters for modeling each dataset." The conservatism of such a model comparison exercise is readily apparent: the large increase in model complexity incurred when moving from H 0 to H 1 means that the joint analysis is intrinsically more favourable. This means that any result in favour of H 1 may be taken as a clear indication of discord between the two experiments. Note also that this test is easily done given that the evidence values will have been calculated for alternative purposes, such as comparing two physical models in the light of each dataset alone.
For checking dataset consistency then the quantity we should calculate is the ratio of probabilities that each model is correct, given the data: The calculable part of Equation 2 is the evidence ratio where in the second line we have assumed that the individual datasets d i under analysis are independent. (The evidence integral factors out since the independent likelihoods do, and also because each likelihood depends only on its own subset of parameters.) Interpretation of this evidence ratio is aided by Equation 2: for statement H 0 to be more likely to be true than statement H 1 , the product of R and the prior probability ratio must be greater than one. Suppose that an evidence ratio R of 0.1 were found: the dataset combination (H 0 ) can still be justified, but only if you are willing to take odds of ten to one on there being no significant systematic errors in the system. Blindly multiplying N likelihoods together results, in general and approximately, in factors of improvement in precision of √ N : the evidence ratio gives an indication of whether or not this improvement is justified, in the form of an odds ratio (which enforces honesty through the threat of bankruptcy).
Other criteria besides evidence have been used to compare different models. Recently [12] have proposed the Akaike and Bayesian information criteria to carry out cosmological model selection. These criteria are approximations to the full Bayesian evidence under rather restrictive assumptions and thus fall under the same framework. The posterior Bayes factors proposed by [13] and also discussed in [14] can be used as an alternative to evidence. This quantity is the Bayesian evidence with the prior set to the posterior and can be readily estimated as an average likelihood of the Markov Chain Monte Carlo chains. It has some desirable properties, such as no prior dependence in the limit of prior enclosing the entire volume of posterior. However, it has no simple interpretation within Bayesian framework and will thus not be discussed in this paper. The use of the evidence itself as a model selection tool has been growing in cosmology [see e.g. 15,16,17,18]. Using evidence to check dataset consistency has received much less attention. Application to a particular problem of CMB map contamination can be found in [16]. In this work we construct a much more general approach that can be applied to any setting in which a given model is tested against more than one dataset. The price one has to pay for this generality is that we are relatively insensitive to any particular inconsistency. We also aim to provide a short tutorial, establishing the connection with the more conventional χ 2 statistics, followed by a simple analysis of current stateof-the-art experiments.

II. CONNECTION TO χ 2 ANALYSIS
Consider a general likelihood function of some model parameter vector x, which can be (for reasons that will become apparent in a moment) rewritten as where L max is the likelihood at the most likely point in the parameter space and the dimensionless functionL contains all the likelihood shape information. Assuming a uniform prior spanning between −p and p in each direction, where p is large enough to encompass all region of high likelihood, gives the approximate evidencẽ where M is the number of parameters in the model. If we identify the numerator of the above fraction with the volume associated with the likelihood V L , and the denominator with the available prior volume V π , we have All the details of the overlap between prior and likelihood is contained with in the volume ratio, whereas the maximum likelihood value specifies the goodness-of-fit. Except when the posterior pdf's take simple analytic forms, this volume factor must be calculated numerically and of course takes up much of the effort in the evidence calculation.
In the case where the measurement errors are Gaussian, we can write the evidence ratio used in this work in terms of the best-fit chi-squared values that may be calculated during an analysis. It can be shown that where ∆χ 2 =χ 2 12 − (χ 2 1 +χ 2 2 ). Defined this way, ∆χ 2 is always positive (the goodness-of-fit cannot decrease with the addition of the extra parameters) and we see that the borderline case of log R = 0 corresponds to the difference in chi-squared between the two individual analyses and the joint fit being equal to an effective number of parameters (difference in number of degrees of freedom) given by the logarithm of the volume factor.
Returning to the general case, if we retain the assumption of a broad uniform prior, and if the likelihoods are well approximated by multivariate Gaussians, then the volume factor can be calculated analytically: in this case the i th likelihood can be written as where F i is the Fisher matrix. This gives, for the likelihood volumes, In the joint analysis, combining two Gaussian likelihoods results in a new Gaussian, centred at a correctly weighted mean of positions, but whose shape is given simply bŷ and therefore Note that in this case, due to the high symmetry of the Gaussian approximation, the overlap integral V 12 is independent of the distance between best fitting points. Therefore using ∆χ 2 as a proxy for the Bayesian evidence change is valid when the Gaussian approximation to the posterior is a good one. In the simple case where F 1 = F 2 (a parallel degeneracy) and V π = (2p) M again, the log evidence becomes: The log term is typically of the order of unity: |F | 1/M is the geometrical average of the principal variances and hence p 2 |F | −1/M is the square of the ratio of the prior width to the characteristic likelihood width. Hence we recover the frequentist rule of thumb that the increase in χ 2 is justified if the number of parameters drops by roughly the same number. However the evidence considerations above allow this rule to be calibrated to take into account both the prior information supplied and the (potentially complex) shape of the likelihoods; in general, V 12 is not independent of the individual peak positions, and so the simple ∆χ 2 procedure does not propagate all the information contained within the likelihood functions. We use a version of the CosmoMC software package [14], modified to calculate evidence by the thermodynamic integration method. We obtain consistent results using two different methods to calculate the evidence reliably: the error on the log evidence differences is conservatively estimated to be of the order of unity. The details of the evidence calculation method is presented elsewhere [19].
We have chosen three datasets for comparison: • CMB: We use the "standard" selection of CMB experiments: the WMAP data [20] together with latest VSA [21], CBI [3] and ACBAR data [22]. We also used a modified version of the likelihood code that correctly accounts for the largest WMAP scales [23] • SN: We use the Riess et al. (2004) SN data. We use both "gold" and "silver" datasets. We implemented our likelihood code and checked that it gives results consistent with Riess et al.
• SDSS: Finally we use large scale power spectrum measurements from the SDSS experiment [24,25,26]. We used the likelihood code by Tegmark [5] adapted for CosmoMC by Samuel Leach (private communication).
We investigate a 7-parameter cosmological model. In Table I we show the uniform priors assumed for the parameters of our model. We take our priors to be comparatively broad to approximate the state of ignorance we may have been in before any of the three experiments were performed. This has the effect of giving the data as much "freedom" as possible, and correspondingly making the evidence test somewhat conservative.

IV. RESULTS AND DISCUSSION
In Table II we give the values of R for various combinations of datasets under discussion. We do not detect any discrepancy between datasets: all combinations of the datasets weakly favour H 0 . In the last line of the table II we report on the value of R for all experiments combined. In principle, it is possible to have three experiments be pair-wise consistent with each other, but not when all combined together (imagine, for example three degeneracy lines forming a triangle). Comfortingly enough, the three-way evidence test also abrogates H 1 and due to a large number of extra parameters (i.e. twice as many as in other datasets) it has also a more positive detection of concordance.
We have illustrated our methodology with application to real cosmological data. As expected, the data are concordant: any obvious conflict in the data would likely have been noticed using the "chi by eye" methods employed to date. However, should such discrepancies occur in the future it is imperative to have a method to quantify these discrepancies in the most general settings where Gaussianity cannot be assumed and ever more complex parameter spaces are to be dealt with.
A value of R less than unity (log R < 0) is a sign that we should investigate the mismatch between datasets further. This can be done by exploring more focussed models, either with new cosmological parameters (if the experiments are reckoned to be well-understood), or with additional nuisance parameters that quantify the possible systematic errors in the data. Disentangling the degeneracy between new physics and systematic error can only be done if the additional parameters come with fresh information encoded in their prior pdf: this information is then folded into the evidence ratio, providing the crucial difference between this methodology and any method relying on goodness-of-fit alone.