Signature
s_22 = sqrt(1 - c_22^2); s_32 = sqrt(1 - c_32^2); s_33 = sqrt(1 - c_33^2); l_32 = s_32 * c_33; l_33 = s_32 * s_33; r_32 = c_32 * c_22 + l_32 * s_22; u_3 = c_32^2 + l_32^2 + l_33^2
| Inputs | Definition | Unit |
|---|---|---|
c_22 | Cosine of phi_22, equal to the correlation of the second outcome with the first, above minus 1 and below 1 | dimensionless |
c_32 | Cosine of phi_32, equal to the correlation of the third outcome with the first, above minus 1 and below 1 | dimensionless |
c_33 | Cosine of phi_33, above minus 1 and below 1 | dimensionless |
s_22 | Sine of phi_22, the second diagonal entry of the factor | dimensionless |
|---|---|---|
s_32 | Sine of phi_32 | dimensionless |
s_33 | Sine of phi_33 | dimensionless |
l_32 | Row 3, column 2 entry of the factor | dimensionless |
l_33 | Row 3, column 3 entry of the factor | dimensionless |
r_32 | Correlation of the third outcome with the second | dimensionless |
u_3 | Sum of squares of the third row, which equals 1 and so gives the matrix its unit diagonal | dimensionless |
Function
Cholesky factorisation of a covariance or correlation matrix into its lower triangular factor
Maps a symmetric positive definite n by n matrix A, usually the covariance matrix of parameters estimated together, to the lower triangular matrix L with positive diagonal entries for which A equals L times L transposed, or stops at the first zero or negative pivot when no such factor exists. The two-parameter factor and draw x = mu + L z are live as HE-FM-PSA-001 and a whole PSA run on them is HE-CF-PSA-001, so neither is restated here. The upper triangular orientation error is HE-ER-PSA-001 and the cost of drawing jointly estimated parameters as if independent is HE-ER-PSA-002. The logit link that turns a sampled linear predictor into a probability takes the form of HE-FM-BINOM-007, and approximate limits on that predictor take the form of HE-FM-AN-001. This package adds what first appears at three parameters, namely the column algorithm with its cross-product term and the pivot test with a valid range for a correlation matrix assembled pair by pair. It also adds the spherical form that keeps a sampled correlation matrix valid in evidence synthesis, and the transform Neine and Curran use to carry correlated normal draws into beta and gamma inputs. Notation follows the Cholesky Decomposition article.
Try this function
Implementations
Excel
Spherical factor and third correlation from named cosine cells
With the cosines in CosPhiSecond, CosPhiThird and CosPhiLast, each entered directly or as =COS of an angle in radians, the formulas in order return the cells named SinPhiSecond, SinPhiThird, SinPhiLast, SphCholThirdSecond, SphCholThirdThird, SphCorrThirdSecond and SphRowLength.
=SQRT(1-CosPhiSecond^2); =SQRT(1-CosPhiThird^2); =SQRT(1-CosPhiLast^2); =SinPhiThird*CosPhiLast; =SinPhiThird*SinPhiLast; =CosPhiThird*CosPhiSecond+SphCholThirdSecond*SinPhiSecond; =CosPhiThird^2+SphCholThirdSecond^2+SphCholThirdThird^2
Assumptions
Spherical angles restricted above 0 and below pi
TSD 20 restricts each angle above 0 and below pi to make the parameterisation unique, so each cosine is above minus 1 and below 1 and each sine is above zero. In that range the third diagonal entry and the second diagonal entry are both above zero.
Separation of standard deviations from the spherical correlation matrix
TSD 20 writes the between-studies covariance matrix as the diagonal matrix of standard deviations times R times the same diagonal matrix, so that separate priors can be placed on the standard deviations and on R. Each covariance is then s_i times s_j times the correlation, the form checked in HE-VT-PSA-001.
Outcome order affects priors placed through a Cholesky factor
TSD 20 states that with the Cholesky form the resulting prior distributions for the between-studies correlations depend on the ordering of the outcomes and recommends a sensitivity analysis of that ordering. The check of a single matrix here does not depend on order, as the grid for HE-FM-CHOD-002 shows.
Worked examples
Neine and Curran's correlation matrix recovered from spherical cosines
With c_22 and c_32 of 0.5 and c_33 of one third, the factor entries are about 0.2887 and 0.8165 and the third correlation is 0.5, the matrix and entries Neine and Curran print. Here c_33 is typed to seven decimals, as 0.3333333.
c_22 = 0.5; c_32 = 0.5; c_33 = 0.3333333; s_22 = 0.8660254; s_32 = 0.8660254; s_33 = 0.9428091; l_32 = 0.2886751; l_33 = 0.8164966; r_32 = 0.5; u_3 = 1
Article's two correlations of 0.9 with an illustrative third cosine
All numbers are illustrative. With c_22 and c_32 of 0.9, a third cosine of minus 0.9 gives a third correlation of 0.639, just above the lower limit of 0.62 in HE-EX-CHOD-004, so the article's failing value of 0 cannot be reached by any choice of c_33 (derived).
c_22 = 0.9; c_32 = 0.9; c_33 = -0.9; s_22 = 0.4358899; s_32 = 0.4358899; s_33 = 0.4358899; l_32 = -0.3923009; l_33 = 0.19; r_32 = 0.639; u_3 = 1
Common errors
Independent priors placed directly on the elements of a correlation matrix
TSD 20 warns that independent priors on the elements may give a sampled matrix that is not positive semi-definite. With three correlations drawn independently and uniformly over minus 1 and 1, about 38.3% of the triples are not positive definite (derived, one minus pi squared over 16, and 0.3830 on a midpoint grid of 8 million triples). The angles avoid this because each draw gives a valid matrix.
Angle in degrees passed to the Excel cosine
Excel COS takes radians. An angle of 60 degrees entered as =COS(60) returns about minus 0.9524 instead of 0.5, which is still a legal cosine, so the matrix stays valid and the wrong correlation goes unnoticed. =COS(RADIANS(60)) returns 0.5.
Sources
TSD 20 on the spherical and Cholesky separation of a correlation matrix
Bujkiewicz S, Achana F, Papanikos T, Riley RD, Abrams KR. NICE DSU Technical Support Document 20: Multivariate meta-analysis of summary data for combining treatment effects on correlated outcomes and evaluating surrogate endpoints. Report by the Decision Support Unit, 22 October 2019 (the text read; the DSU page lists an update of December 2022). Appendix C.1, Constructing prior distribution for the between-studies covariance matrix, section Separation by spherical decomposition, gives L_11 = 1 and equations 26 to 30 for the entries of row l as products of sines and cosines, restricts each angle above 0 and below pi for uniqueness, and writes each correlation as an inner product. Section Separation by Cholesky decomposition states that the resulting priors on correlations depend on the ordering of outcomes and recommends a sensitivity analysis. The text calls L upper triangular with R = L transposed L but indexes these equations by row l, and the records read them as rows of a lower triangular factor, which returns the same matrix.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0
