Cholesky factorisation of a covariance or correlation matrix into its lower triangular factor
chol(A) = L
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.
Three-parameter Cholesky factor from covariance entries by the column algorithm
l_11 = sqrt(a_11); l_21 = a_21 / l_11; l_31 = a_31 / l_11; l_22 = sqrt(a_22 - l_21^2); l_32 = (a_32 - l_31 * l_21) / l_22; l_33 = sqrt(a_33 - l_31^2 - l_32^2)
Pivot test and valid range for a pairwise-assembled three-parameter correlation matrix
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)
Spherical Cholesky factor giving a valid three-outcome correlation matrix from free angles
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
Neine and Curran transform of correlated normal draws into a beta and a gamma PSA input
x_2 = rho * z_1 + sqrt(1 - rho^2) * z_2; y_1 = 1 - (1 - Phi_1)^(1 / b_1); y_2 = -theta_2 * log(1 - Phi_2)
