Abstract
Pearson's correlation is one of the most common measures of linear dependence. Recently, Bernardo (11th International Workshop on Objective Bayes Methodology, 2015) introduced a flexible class of priors to study this measure in a Bayesian setting. For this large class of priors, we show that the (marginal) posterior for Pearson's correlation coefficient and all of the posterior moments are analytic. Our results are available in the open‐source software package JASP.
Keywords: bivariate normal distribution, hypergeometric functions, reference priors
1. Introduction
Pearson's product–moment correlation coefficient ρ is a measure of the linear dependency between two random variables. Its sampled version, commonly denoted by r, has been well studied by the founders of modern statistics such as Galton, Pearson, and Fisher. Based on geometrical insights, fisher (1915, 1921) was able to derive the exact sampling distribution of r and established that this sampling distribution converges to a normal distribution as the sample size increases. Fisher's study of the correlation has led to the discovery of variance‐stabilizing transformations, sufficiency (FISHER, 1920), and, arguably, the maximum likelihood estimator (FISHER, 1922; STIGLER, 2007). Similar efforts were made in Bayesian statistics, which focus on inferring the unknown ρ from the data that were actually observed. This type of analysis requires the statistician to (i) choose a prior on the parameters, thus, also on ρ, and to (ii) calculate the posterior. Here we derive analytic posteriors for ρ given a large class of priors that include the recommendations of JEFFREYS (1961), LINDLEY (1965), BAYARRI (1981), and, more recently, BERGER and SUN (2008) and BERGER et al. (2015). Jeffreys's work on the correlation coefficient can also be found in the second edition of his book (JEFFREYS, 1961), originally published in 1948; see ROBERT et al. (2009) for a modern re‐read of Jeffreys's work. An earlier attempt at a Bayesian analysis of the correlation coefficient can be found in JEFFREYS (1935). Before presenting the results, we first discuss some notations and recall the likelihood for the problem at hand.
2. Notation and result
Let (X 1,X 2)′ have a bivariate normal distribution with mean and covariance matrix
where and are the population variances of X 1 and X 2, and where ρ is
(1) |
Pearson's correlation coefficient ρ measures the linear association between X 1 and X 2. In brief, the model is parametrized by the five unknowns θ=(μ 1,μ 2,σ 1,σ 2,ρ).
Bivariate normal data consisting of n pairs of observations can be sufficiently summarized as , where
is the sample correlation coefficient, the sample mean, and the average sums of squares. The bivariate normal model implies that the observations y are functionally related to the parameters by the following likelihood function:
(2) |
For inference we use the following class of priors:
(3) |
where η denotes the hyperparameters, that is, η=(α,β,γ,δ). This class of priors is inspired by the one that José Bernardo (2015) used in his talk on reference priors for the bivariate normal distribution at the ‘11th International Workshop on Objective Bayes Methodology in honor of Susie Bayarri’. This class of priors contains certain recommended priors as special cases.
If we set α=1,β=γ=δ=0 in Equation (3), we retrieve the prior that Jeffreys recommended for both estimation and testing (JEFFREYS, 1961, pp. 174–179 and 289–292). This recommendation is not the prior derived from Jeffreys's rule based on the Fisher information (e.g., ly et al., 2017), as discussed in BERGER and SUN (2008). With α=1,β=γ=δ=0, thus, a uniform prior on ρ, Jeffreys showed that the marginal posterior for ρ is approximately proportional to h a(n,r|ρ), where
represents the ρ‐dependent part of the likelihood Equation (2) with θ 0=(μ 1,μ 2,σ 1,σ 2) integrated out. For n large enough, the function h a is a good approximation to the true reduced likelihood h γ,δ given below.
If we set α=β=γ=δ=0 in Equation (3), we retrieve Lindley's reference prior for ρ. lindley (1965, pp. 214–221) established that the posterior of is asymptotically normal with mean and variance n −1, which relates the Bayesian method of inference for ρ to that of Fisher. In Lindley's (1965, p. 216) derivation, it is explicitly stated that the likelihood with θ 0 integrated out cannot be expressed in terms of elementary functions. In his analysis, Lindley approximates the true reduced likelihood h γ,δ with the same h a that Jeffreys used before. BAYARRI (1981) furthermore showed that with the choice γ=δ=0, the marginalization paradox (DAWID et al., 1973) is avoided.
In their overview, BERGER and SUN (2008) showed that for certain a,b with α=b/2−1,β=0,γ=a−2, and δ=b−1, the priors in Equation (3) correspond to a subclass of the generalized Wishart distribution. Furthermore, a right‐Haar prior (e.g., sun and berger, 2007) is retrieved when we set α=β=0,γ=−1,δ=1 in Equation (3). This right‐Haar prior then has a posterior that can be constructed through simulations, that is, by simulating from a standard normal distribution and two chi‐squared distributions (berger and sun, 2008, Table 1). This constructive posterior also corresponds to the fiducial distribution for ρ (e.g., fraser, 1961; hannig et al., 2006). Another interesting case is given by α=0,β=1,γ=δ=0, which corresponds to the one‐at‐a‐time reference prior for σ 1 and σ 2; see also Jeffreys (1961 p. 187).
The analytic posteriors for ρ follow directly from exact knowledge of the reduced likelihood h γ,δ(n,r|ρ), rather than its approximation used in previous work. We give full details, because we did not encounter this derivation in earlier work.
Theorem 1
The reduced likelihood hγ,δ(n,r|ρ) If |r|<1,n>γ+1 , and n>δ+1 , then the likelihood f(y|θ) times the prior Equation (3) with θ 0=(μ 1,μ 2,σ 1,σ 2) integrated out is a function f γ,δ that factors as
(4) The first factor is the marginal likelihood with ρ fixed at zero, which does not depend on r nor on ρ , that is,
(5) where . We refer to the second factor as the reduced likelihood, a function of ρ which is given by a sum of an even function and an odd function, that is, h γ,δ=A γ,δ+B γ,δ , where
(6)
(7) where and where 2 F 1 denotes Gauss' hypergeometric function.
To derive f γ,δ(y|ρ), we have to perform three integrals: (i) with respect to , (ii) , and (iii) .
The integral with respect to yieldswhere we abbreviated . The factor p γ,δ(y 0) follows directly by setting ρ to zero in Equation (8) and two independent gamma integrals with respect to σ 1 and σ 2 resulting in Equation (5). These gamma integrals cannot be used when ρ is not zero. For f γ,δ(y|ρ), which is a function of ρ, we use results from special functions theory.
(8) For the second integral, we collect only that part of Equation (8) that involves σ 1 into a function g, that is,The assumption n>γ+1 and the substitution allow us to solve this integral using Lemma A.1, which we distilled from the Bateman manuscript project (ERDéLYI et al., 1954), with and c=n−γ−1. This yields
where
(9)
(10) and where 1 F 1 denotes the confluent hypergeometric function. The functions Å γ and B¨γ are the even and odd solutions of Weber's differential equation in the variable , respectively.
(11) With , we see that f γ,δ(y|ρ) follows from integrating σ 2 out of the following expression:where
Hence, the last integral with respect to σ 2 only involves the functions k and l in Equation (12). The assumption n>δ+1 and the substitution , thus, allow us to solve this integral using Equation (7.621.4) from gradshteyn and ryzhik (2007, p. 822) with . This yields
(12) After we combine the results, we see that , where
Hence, f γ,δ(y|ρ) is of the asserted form. Note that is even, while is an odd function of ρ.
□
This main theorem confirms Lindley's insights; h γ,δ(n,r|ρ) is indeed not expressible in terms of elementary functions, and the prior on ρ is updated by the data only through its sampled version r and the sample size n. As a result, the marginal likelihood for data y then factors into p η(y)=p γ,δ(y 0)p α,β(n,r;γ,δ), where is the normalizing constant of the marginal posterior of ρ. More importantly, the fact that the reduced likelihood is the sum of an even function and an odd function allows us to fully characterize the posterior distribution of ρ for the priors Equation (3) in terms of its moments. These moments are easily computed, as the prior π α,β(ρ) itself is symmetric around zero. Furthermore, the prior π α,β(ρ) can be normalized as
(13) |
where denotes the beta function. The case with β=0 is also known as the (symmetric) stretched beta distribution on (−1,1) and leads to Lindley's reference prior when we ignore the normalization constant, that is, , and, subsequently, let .
Corollary 1
Characterization of the marginal posteriors of ρ If n>γ+δ−2α+1 , then the main theorem implies that the marginal likelihood with all the parameters integrated out factors as p η(y)=p γ,δ(y 0)p α,β(n,r;γ,δ) where
(14) defines the normalizing constant of the marginal posterior for ρ . Observe that the integral involving B γ,δ is zero, because B γ,δ is odd on (−1,1) . More generally, the k th posterior moment of ρ is
(15) These posterior moments define the series
(16) where is the normalization constant of the prior Equation (13) , W γ,δ(n) is the ratios of gamma functions as defined under Equation (7) , and refers to the Pochhammer symbol for rising factorials. The terms a k,m and b k,m are
The series defined in Equation (16) are hypergeometric when β is a non‐negative integer.
The series E(ρ k|n,r) result from term‐wise integration of the hypergeometric functions in A γ,δ and B γ,δ. The assumption n>γ+δ−2α+1 and the substitution x=ρ 2 allow us to solve these integrals using Equation (3.197.8) in gradshteyn and ryzhik (2007, p. 317) with their and when k is even, while we use when k is odd. A direct application of the ratio test shows that the series converge when |r|<1.
□
3. Analytic posteriors for the case β=0
For most of the priors discussed earlier, we have β=0, which leads to the following simplification of the posterior.
Corollary 1
(Characterization of the marginal posteriors of ρ, when β=0) If n>γ+δ−2α+1 and |r|<1 , then the marginal posterior for ρ is
(17) where p α(n,r;γ,δ) refers to the normalizing constant of the (marginal) posterior of ρ , which is given by
More generally, when β=0 , the k th posterior moment is
when k is even, and
when k is odd.
The assumption n>γ+δ−2α+1 and the substitution x=ρ 2 allow us to use Equation (7.513.12) in gradshteyn and ryzhik (2007, p. 814) with and when k is even, while we use when k is odd. The normalizing constant of the posterior p α(n,r;γ,δ) is a special case with k=0.
□
The marginal posterior for ρ updated from the generalized Wishart prior, the right‐Haar prior, and Jeffreys's recommendation then follow from a direct substitution of the values for α,γ, and δ as discussed under Equation (3). Lindley's reference posterior for ρ is given by
which follows from Equation (17) by setting γ=δ=0 and, subsequently, letting .
Lastly, for those who wish to sample from the posterior distribution, we suggest the use of an independence‐chain Metropolis algorithm (tierney, 1994) using Lindley's normal approximation of the posterior of as the proposal. This method could be used when Pearson's correlation is embedded within a hierarchical model, as the posterior for ρ will then be a full conditional distribution within a Gibbs sampler. For α=1,β=γ=δ=0,n=10 observations and r=0.6, the acceptance rate of the independence‐chain Metropolis algorithm was already well above 75%, suggesting a fast convergence of the Markov chain. For n larger, the acceptance rate further increases. The R code for the independence‐chain Metropolis algorithm can be found on the first author's home page. In addition, this analysis is also implemented in the open‐source software package jasp (https://jasp-stats.org/).
Acknowledgements
This work was supported by the starting grant ‘Bayes or Bust’ awarded by the European Research Council (grant number 283876). The authors thank Christian Robert, Fabian Dablander, Tom Koornwinder, and an anonymous reviewer for helpful comments that improved an earlier version of this manuscript.
Appendix A. A Lemma distilled from the Bateman project
A.1.
A.1.1.
Lemma A.1
For a,c>0, the following equality holds:
(A.1) that is, the integral is solved by the functions
(A.2) which define the even and odd solutions to Weber's differential equation in the variable , respectively.
By erdélyi et al. (1954, p 313, Equation (13)), we note that
(A.3) where D λ(z) is whittaker's (1902) parabolic cylinder function (ABRAMOWITZ and STEGUN, 1992). By virtue of Equation (4) on p. 117 of ERDéLYI et al. (1981), we can decompose D λ(z) into a sum of an even function and an odd function. Replacing this decomposition for D λ(z) in Equation (A.3) and an application of the duplication formula of the gamma function yields the statement.
□
Ly, A. , Marsman, M. , and Wagenmakers, E.‐J. (2018) Analytic posteriors for Pearson's correlation coefficient. Statistica Neerlandica, 72: 4–13. doi: 10.1111/stan.12111.
Footnotes
We thank an anonymous reviewer for clarifying how Jeffreys derived this approximation.
References
- Abramowitz, M. and Stegun I. A. (eds) (1992), Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, Dover Publications, Inc., New York. Reprint of the 1972 edition. MR1225604 (94b:00012). [Google Scholar]
- Bayarri, M. J. (1981), Bayesian inference on the correlation coefficient of a bivariate normal population, Trabajos de Estadística y de Investigación Operativa 32, 18–31, MR697200 (84i:62047). [Google Scholar]
- Berger, J. O. , Bernardo J. M. and Sun D (2015), Overall objective priors, Bayesian Analysis 10, 189–221. [Google Scholar]
- Berger, J. O. and Sun D. (2008), Objective priors for the bivariate normal model, The Annals of Statistics 36, 963–982, MR2396821 (2009b:62058). [Google Scholar]
- Bernardo, J. M. (2015), An overall prior for the five‐parameter normal distribution., 11th International Workshop on Objective Bayes Methodology dedicated to Susie Bayarri; Valencia. [Google Scholar]
- Dawid, A. P. , Stone M. and Zidek J. V. (1973), Marginalization paradoxes in Bayesian and structural inference, Journal of the Royal Statistical Society. Series B. Methodological 35, 189–233, With discussion by D. J. Bartholomew, A. D. McLaren, D. V. Lindley, Bradley Efron, J. Dickey, G. N. Wilkinson, A. P.Dempster, D. V. Hinkley, M. R. Novick, Seymour Geisser, D. A. S. Fraser and A. Zellner, and a reply by A. P. Dawid, M. Stone, and J. V. Zidek. MR 0365805 (51 #2057). [Google Scholar]
- Erdélyi, A. , Magnus W., Oberhettinger F. and Tricomi F. G. (1954), Tables of Integral Transforms, vol. I, McGraw‐Hill Book Company, Inc., New York‐Toronto‐London. Based, in part, on notes left by Harry Bateman. MR0061695 (15,868a). [Google Scholar]
- Erdélyi, A. , Magnus W., Oberhettinger F. and Tricomi F. G. (1981), Higher Transcendental Functions, vol. I, Robert E. Krieger Publishing Co., Inc., Melbourne, Fla.Based on notes left by Harry Bateman, Reprint of the 1953 original. MR698779 (84h:33001a). [Google Scholar]
- Fisher, R. A. (1915), Frequency distribution of the values of the correlation coefficient in samples from an indefinitely large population, Biometrika 10, 507–521. [Google Scholar]
- Fisher, R. A. (1920), A mathematical examination of the methods of determining the accuracy of an observation by the mean error, and by the mean square error, Monthly Notices of the Royal Astronomical Society 80, 758–770. [Google Scholar]
- Fisher, R. A. (1921), On the “probable error" of a coefficient of correlation deduced from a small sample., Metron 1, 3–32. [Google Scholar]
- Fisher, R. A. (1922), On the mathematical foundations of theoretical statistics, Philosophical Transactions of the Royal Society A 222, 309–368. [Google Scholar]
- Fraser, D. A. S. (1961), On fiducial inference, Annals of Mathematical Statistics 32, 661–676, MR0130755 (24 ##A614). [Google Scholar]
- Gradshteyn, I. S. and Ryzhik I. M. (2007), Table of Integrals, Series, and Products Seventh, Elsevier/Academic Press, Amsterdam. Translated from the Russian, Translation edited and with a preface by Alan Jeffrey and Daniel Zwillinger, With one CD‐ROM (Windows, Macintosh and UNIX). MR2360010 (2008g:00005). [Google Scholar]
- Hannig, J. , Iyer H. and Patterson P. (2006), Fiducial generalized confidence intervals, Journal of the American Statistical Association 101, 254–269. [Google Scholar]
- Jeffreys, H. (1935), Some tests of significance, treated by the theory of probability, Proceedings of the Cambridge Philosophical Society 31, 203–222. [Google Scholar]
- Jeffreys, H. (1961), Theory of Probability Third, Oxford Science Publications, The Clarendon Press, Oxford University Press, New York. MR745621 (85f:60005). [Google Scholar]
- Lindley, D. V. (1965), Introduction to Probability and Statistics From a Bayesian Viewpoint. Part II: Inference, Cambridge University Press, New York. MR0168084 (29 #5349). [Google Scholar]
- Ly, A. , Marsman M., Verhagen A. J., Grasman R. P. P. P. and Wa‐genmakers E. J. (2017), A tutorial on Fisher information, arXiv preprint arXiv:1705.01064. [Google Scholar]
- Robert, C. P. , Chopin N. and Rousseau J. (2009), Harold Jeffreys's theory of probability revisited, Statistical Science. A Review Journal of the Institute of Mathematical Statistics 24, 141–172, MR2655841 (2011c:62002). [Google Scholar]
- Stigler, S. M. (2007), The epic story of maximum likelihood, Statistical Science. A Review Journal of the Institute of Mathematical Statistics 22, 598–620. MR2410255 [Google Scholar]
- Sun, D. and Berger J. O. (2007), Objective Bayesian analysis for the multivariate normal model, Oxford Sci. Publ., Bayesian Statistics 8, Oxford, Oxford Univ. Press, 525–562. MR2433206 (2009m:62019) [Google Scholar]
- Tierney, L. (1994), Markov chains for exploring posterior distributions, The Annals of Statistics 22, 1701–1762, With discussion and a rejoinder by the author. MR1329166 (96m:60150). [Google Scholar]
- Whittaker, E. T. (1902), On the functions associated with the parabolic cylinder in harmonic analysis, Proceedings of the London Mathematical Society 1, 417–427. [Google Scholar]