Signature
p_2 = 1 - r_21^2; q_31 = 1 - r_31^2; c_32 = r_32 - r_31 * r_21; p_3 = q_31 - c_32^2 / p_2; det_R = p_2 * p_3; r_L = r_31 * r_21 - sqrt(p_2 * q_31); r_U = r_31 * r_21 + sqrt(p_2 * q_31); valid = (p_2 > 0) and (p_3 > 0)
| Inputs | Definition | Unit |
|---|---|---|
r_21 | Correlation of the second parameter with the first, above minus 1 and below 1 | dimensionless |
r_31 | Correlation of the third parameter with the first, above minus 1 and below 1 | dimensionless |
r_32 | Correlation of the third parameter with the second, at least minus 1 and at most 1 | dimensionless |
p_2 | Argument of the second square root in the column algorithm on a unit diagonal | dimensionless |
|---|---|---|
q_31 | One minus the square of r_31 | dimensionless |
c_32 | r_32 less the part already carried by the first column | dimensionless |
p_3 | Argument of the third square root in the column algorithm on a unit diagonal, negative or zero when the matrix is not positive definite | dimensionless |
det_R | Determinant of the matrix, equal to p_2 times p_3 | dimensionless |
r_L | Value of r_32 below which the matrix stops being valid at the given r_21 and r_31 | dimensionless |
r_U | Value of r_32 above which the matrix stops being valid at the given r_21 and r_31 | dimensionless |
valid | 1 when both pivots are above zero, otherwise 0 | logical |
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
Pivot test and valid range from named correlation cells
With the correlations in CorrSecondFirst, CorrThirdFirst and CorrThirdSecond, the formulas in order return the cells named PivotSecond, RemainderThirdFirst, CrossThirdSecond, PivotThird, DetCorr, RangeLower, RangeUpper and MatrixValid. MatrixValid shows TRUE or FALSE where the calculator shows 1 or 0.
=1-CorrSecondFirst^2; =1-CorrThirdFirst^2; =CorrThirdSecond-CorrThirdFirst*CorrSecondFirst; =RemainderThirdFirst-CrossThirdSecond^2/PivotSecond; =PivotSecond*PivotThird; =CorrThirdFirst*CorrSecondFirst-SQRT(PivotSecond*RemainderThirdFirst); =CorrThirdFirst*CorrSecondFirst+SQRT(PivotSecond*RemainderThirdFirst); =AND(PivotSecond>0,PivotThird>0)
Assumptions
Unit diagonal and correlations of one pair each in the pivot test
The matrix has a unit diagonal and one entry per pair. Higham defines a correlation matrix as symmetric positive semidefinite with unit diagonal. The test asks for more, a positive definite matrix, because the factorisation needs it.
Pivot test limited to r_21 and r_31 strictly inside minus 1 and 1
r_21 and r_31 are above minus 1 and below 1. At r_21 of 1 or minus 1, p_2 is zero and p_3 divides by zero, so Excel shows #DIV/0!. In that case the second parameter is an exact linear function of the first and no positive definite matrix exists.
Semidefinite boundary of the valid third correlation
At r_32 equal to r_L or r_U the third pivot is zero and the matrix is positive semidefinite, a correlation matrix under Higham's definition that still fails the test. The R documentation says chol gives an error for such a matrix unless pivoting is requested. Floating-point rounding can put a computed p_3 on either side of zero at that point, so a value exactly on a limit is treated as failing. The limits hold with the other two correlations fixed and do not say which of the three judgements was wrong.
Repair of a failed correlation matrix sits outside the pivot test
The test reports a failure and does not repair it. Higham 2002 gives a nearest correlation matrix method for a matrix built from inconsistent data, and the article notes that revisiting the elicitation or evidence is often the better response.
Worked examples
Article's correlations of 0.9, 0.9 and 0 failing the pivot test
The article's illustration has a second pivot argument of 0.19, a third of about minus 3.263 and a determinant of minus 0.62, so no factor exists. Given two correlations of 0.9, the third has to be above 0.62 (derived). Two parameters that each move closely with a third cannot be uncorrelated with each other.
r_21 = 0.9; r_31 = 0.9; r_32 = 0; p_2 = 0.19; q_31 = 0.19; c_32 = -0.81; p_3 = -3.2631579; det_R = -0.62; r_L = 0.62; r_U = 1; valid = 0
Neine and Curran's correlations of 0.5 passing the pivot test
With all three correlations 0.5 the pivots are 0.75 and about 0.6667, the squares of the entries 0.866 and 0.8165 Neine and Curran print, the determinant is 0.5, and the third correlation could lie anywhere above minus 0.5 and below 1 (derived).
r_21 = 0.5; r_31 = 0.5; r_32 = 0.5; p_2 = 0.75; q_31 = 0.75; c_32 = 0.25; p_3 = 0.6666667; det_R = 0.5; r_L = -0.5; r_U = 1; valid = 1
Third correlation moved inside the valid range of the article's matrix
All numbers are illustrative. Keeping the two correlations of 0.9 and raising the third to 0.7 puts it inside the range of 0.62 and 1, and the third pivot becomes about 0.1263 with a determinant of 0.024.
r_21 = 0.9; r_31 = 0.9; r_32 = 0.7; p_2 = 0.19; q_31 = 0.19; c_32 = -0.11; p_3 = 0.1263158; det_R = 0.024; r_L = 0.62; r_U = 1; valid = 1
Common errors
Checking each correlation on its own and not the matrix as a whole
Each of the article's correlations of 0.9, 0.9 and 0 lies inside minus 1 and 1, yet the third pivot is about minus 3.263. A range check on each cell therefore passes a matrix that cannot be factorised. TSD 20 makes the same point for priors, where restricting each correlation is enough for two outcomes and the whole matrix must be handled in the general case.
Blank correlation cell read as a correlation of zero
Excel arithmetic treats a blank cell as 0, so a blank CorrThirdSecond beside two correlations of 0.9 returns a pivot of about minus 3.263 and FALSE with no error showing. The blank means no judgement was made, and the rejection reflects a value nobody entered. A blank is filled with a judgement before the verdict is read, or the verdict is guarded with ISNUMBER.
Correlations rounded for publication pushing a matrix outside the valid range
All numbers are illustrative. Correlations of 0.876, 0.956 and 0.704 give a determinant of about 0.0022 and a positive definite matrix. Rounded to two decimals, as 0.88, 0.96 and 0.70, they give a determinant of about minus 0.0033 and a third pivot of about minus 0.0145, so the factorisation fails although the original did not (derived). The article gives the same warning for a covariance matrix copied with few decimal places.
Sources
Higham on running the factorisation as a test of positive definiteness
Higham NJ. Cholesky factorization. MIMS EPrint 2008.116, Manchester Institute for Mathematical Sciences, University of Manchester; 2008 (the version read). Published as WIREs Computational Statistics. 2009;1(2):251-254 (not seen). Section Semidefinite Matrices states that the test is to run the Cholesky algorithm and declare the matrix positive definite if the algorithm completes without encountering any negative or zero pivots and not positive definite otherwise, and that this is much faster than computing all the eigenvalues. The pivot formula on a unit diagonal, the determinant identity and the range limits are derived here from that algorithm.
Higham's definition of a correlation matrix and the nearest correlation matrix problem
Higham NJ. Computing the nearest correlation matrix: a problem from finance. MIMS EPrint 2006.70, University of Manchester (the version read), of IMA Journal of Numerical Analysis. 2002;22(3):329-343. Section 1, Introduction, states that a correlation matrix is a symmetric positive semidefinite matrix with unit diagonal, and describes a matrix built from inconsistent data sets as only approximate, for which the nearest correlation matrix is wanted.
TSD 20 on restricting each element for two outcomes and the whole matrix in the general case
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). Section 4.1.1, Prior distribution on the between-studies covariance matrix, states that in the bivariate case it is sufficient to restrict each element to possible values, that in the general case a prior has to be placed on the whole matrix, and that independent priors on the elements may give sampled values amounting to a covariance matrix that is not positive semi-definite.
R documentation on chol errors for matrices that are not positive definite
R Core Team. The Cholesky decomposition, chol, package base. R documentation, accessed 7 November 2026. Section Details states that with pivot = FALSE an error occurs if x is not non-negative definite, and that an error also occurs if x is positive semi-definite, as a numerical tolerance is used. Section Source states that the function is an interface to the LAPACK routines DPOTRF and DPSTRF.
LAPACK DPOTRF on the leading minor that stops a factorisation
LAPACK. DPOTRF, reference Fortran source, accessed 7 November 2026. The description of the INFO argument states that INFO = i means the leading minor of order i is not positive definite and the factorisation could not be completed.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0
