Signature
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)
| Inputs | Definition | Unit |
|---|---|---|
rho | Correlation specified between the standard normal values, above minus 1 and below 1 | dimensionless |
z_1 | First independent standard normal value | dimensionless |
z_2 | Second independent standard normal value | dimensionless |
Phi_1 | Standard normal cumulative probability at z_1, entered from NORM.S.DIST, above 0 and below 1 | probability |
b_1 | Second shape of the beta input, whose first shape is 1, above zero | dimensionless |
theta_2 | Scale of the gamma input with shape 1, its mean, above zero | units of the second input, for example GBP |
Phi_2 | Standard normal cumulative probability at x_2, entered from NORM.S.DIST, above 0 and below 1 | probability |
x_2 | Standard normal value correlated with z_1 | dimensionless |
|---|---|---|
y_1 | Sampled value of the beta input | probability |
y_2 | Sampled value of the gamma input | units of the second input, for example GBP |
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.
Computational function
Computational function for Neine and Curran's correlated non-normal inputs with an equal correlation
Runs Neine and Curran's steps for N parameters with one correlation between every pair. It builds the Cholesky factor of the equal correlation matrix, multiplies independent standard normal values by it, takes each value's normal probability and passes that through the inverse distribution function of each input. With unit variances and equal correlation the column algorithm of HE-FM-CHOD-001 gives l_32 as rho times one minus rho, divided by l_22 (derived). Such a matrix is positive definite only for rho below 1 and above minus 1 divided by one less than N (derived), which is minus 0.5 at N = 3. The Math / Code line writes out three parameters at the closed-form shapes of HE-FM-CHOD-004; the R and Python versions take any N and any quantile functions.
Inputs and outputs:
rhois the correlation on the normal scale;z_1toz_3are independent standard normal values;Phi_1toPhi_3are the normal probabilities ofz_1,x_2andx_3, entered from NORM.S.DIST because the calculator has no normal distribution function;b_1is the second beta shape;theta_2is the gamma scale with shape 1, in currency. The outputs are the factor entriesl_22,l_32andl_33, the correlated normal valuesx_2andx_3, a beta inputy_1as a probability and gamma inputsy_2andy_3in currency.Assumption: The correlation is equal across pairs and fixed across iterations, each iteration uses fresh independent standard normal values, and each quantile function is that of the target marginal distribution. Gamma distributions for costs and beta distributions for the other inputs follow Neine and Curran's model. All inputs below are illustrative.
Worked example (Correlation of 0.5): The entries are Neine and Curran's 0.866, 0.2887 and 0.8165. Standard normal values of 0.8, minus 0.4 and 1.1 give a beta input of about 0.1584 and gamma costs of about GBP 736.8 and GBP 2,133.1.
rho = 0.5; z_1 = 0.8; z_2 = -0.4; z_3 = 1.1; Phi_1 = 0.7881446; Phi_2 = 0.521369; Phi_3 = 0.8815312; b_1 = 9; theta_2 = 1000; l_22 = 0.8660254; l_32 = 0.2886751; l_33 = 0.8164966; x_2 = 0.0535898; x_3 = 1.1826762; y_1 = 0.1584; y_2 = 736.8253; y_3 = 2133.1056Worked example (Correlation of 0.9): The same standard normal values move the two costs closer together, at about GBP 1,228.8 and GBP 1,933.5, with the beta input unchanged.
rho = 0.9; z_1 = 0.8; z_2 = -0.4; z_3 = 1.1; Phi_1 = 0.7881446; Phi_2 = 0.7073447; Phi_3 = 0.855356; b_1 = 9; theta_2 = 1000; l_22 = 0.4358899; l_32 = 0.2064742; l_33 = 0.3838859; x_2 = 0.545644; x_3 = 1.0596849; y_1 = 0.1584; y_2 = 1228.7598; y_3 = 1933.4797Excel: With frozen standard normal values in columns A, B and C and the equal correlation in CorrEqual,
=SQRT(1-CorrEqual^2),=CorrEqual*(1-CorrEqual)/CholEqualSecondand=SQRT(1-CorrEqual^2-CholEqualThirdSecond^2)give CholEqualSecond, CholEqualThirdSecond and CholEqualThird.=CorrEqual*A2+CholEqualSecond*B2and=CorrEqual*A2+CholEqualThirdSecond*B2+CholEqualThird*C2filled down give columns D and E, named NormalColSecond and NormalColThird.=BETA.INV(NORM.S.DIST(A2,TRUE),BetaShapeFirst,BetaShapeSecond),=GAMMA.INV(NORM.S.DIST(D2,TRUE),GammaShape,GammaScale)and=GAMMA.INV(NORM.S.DIST(E2,TRUE),GammaShape,GammaScale)filled down give the inputs.R:
nc_draw <- function(rho, Z, q) { N <- ncol(Z); C <- matrix(rho, N, N); diag(C) <- 1; U <- pnorm(Z %*% chol(C)); sapply(seq_len(N), function(i) q[[i]](U[, i])) }Hereqis a list of quantile functions. Forq <- list(function(u) qbeta(u, 20, 80), function(u) qgamma(u, 4, scale = 250), function(u) qgamma(u, 4, scale = 250)),set.seed(2026)andZ <- matrix(rnorm(3e5), ncol = 3),nc_draw(0.5, Z, q)returns 100,000 rows with sample correlations of 0.4906, 0.4914 and 0.4882 and means of about 0.2001, 1001.1 and 1003.1. A one-rowZreturns a plain vector, a single parameter returns its own quantile, and arhoof minus 0.5 at N = 3 stops with the error that the leading minor of order 3 is not positive.Python:
def nc_draw(rho, Z, q): import numpy as np; from scipy.stats import norm; Z = np.atleast_2d(Z); N = Z.shape[1]; C = np.full((N, N), float(rho))+(1-rho)*np.eye(N); L = np.linalg.cholesky(C); U = norm.cdf(Z@L.T); return np.column_stack([q[i](U[:, i]) for i in range(N)])For the same inputs withscipy.statsquantiles andnp.random.default_rng(2026).standard_normal((100000, 3))it returns sample correlations of 0.4895, 0.4938 and 0.4903 and means of about 0.1999, 1002.7 and 1000.4. Arhoof minus 0.5 or below at N = 3 raisesLinAlgError, and a single parameter returns its own quantile.Test (Fixed table with exact normal correlation): With the four frozen rows (1, 1, 1), (1, -1, -1), (-1, 1, -1) and (-1, -1, 1), whose columns have mean 0, population variance 1 and no covariance, the two correlated columns have a population variance of 1 and a correlation of exactly CorrEqual with each other and with column A. Expected result TRUE. FALSE shows the cross-product left out of CholEqualThirdSecond, which at 0.5 gives a correlation of 0.75 between the two columns, or that entry doubled or halved, or either column doubled or halved, which only the variance checks detect because CORREL ignores scale. Excel check
=AND(ABS(CORREL(NormalColSecond,NormalColThird)-CorrEqual)<1E-9,ABS(CORREL($A$2:$A$5,NormalColThird)-CorrEqual)<1E-9,ABS(VAR.P(NormalColSecond)-1)<1E-9,ABS(VAR.P(NormalColThird)-1)<1E-9)Test (Neine and Curran's entries): With CorrEqual at 0.5 the factor cells round to 0.866, 0.2887 and 0.8165. Expected result TRUE. FALSE shows the cross-product left out, which gives 0.5774 and 0.6455, or any of the cells doubled or halved. Excel check
=AND(ROUND(CholEqualSecond,3)=0.866,ROUND(CholEqualThirdSecond,4)=0.2887,ROUND(CholEqualThird,4)=0.8165)Common error (Cholesky factor applied directly to beta or gamma draws): The factor is applied to the normal values before the transform, never to the sampled inputs. Multiplying two independent beta draws with mean 0.1 by the second row of the factor at 0.5 gives a value with mean about 0.1366 (derived, 0.5 x 0.1 + 0.866 x 0.1), which is no longer the target distribution.
Source: Neine M, Curran D. An algorithm to generate correlated input-parameters to be used in probabilistic sensitivity analyses. Journal of Market Access & Health Policy. 2021;9(1):1857052. Methods, sections Correlation of parameters and Sampling algorithm, and Results, section Simulation results.
l_22 = sqrt(1 - rho^2); l_32 = rho * (1 - rho) / l_22; l_33 = sqrt(1 - rho^2 - l_32^2); x_2 = rho * z_1 + l_22 * z_2; x_3 = rho * z_1 + l_32 * z_2 + l_33 * z_3; y_1 = 1 - (1 - Phi_1)^(1 / b_1); y_2 = -theta_2 * log(1 - Phi_2); y_3 = -theta_2 * log(1 - Phi_3)
Try this function
Implementations
Excel
Correlated beta and gamma draws of any shape from named cells
With the correlation in CorrTarget, frozen standard normal values in StdNormalFirst and StdNormalSecond, beta shapes in BetaShapeFirst and BetaShapeSecond, and the gamma shape and scale in GammaShape and GammaScale, the formulas return the cells named CorrNormalSecond, DrawBeta and DrawGamma. The third GAMMA.INV argument is a scale, as HE-ER-BETA-006 warns. BETA.INV returns #NUM! for a zero shape, as HE-SR-BETA-004 records. With shapes 1, 9, 1 and scale 1000 these return the calculator values.
=CorrTarget*StdNormalFirst+SQRT(1-CorrTarget^2)*StdNormalSecond; =BETA.INV(NORM.S.DIST(StdNormalFirst,TRUE),BetaShapeFirst,BetaShapeSecond); =GAMMA.INV(NORM.S.DIST(CorrNormalSecond,TRUE),GammaShape,GammaScale)
Assumptions
Correlation specified on the normal scale in the Neine and Curran transform
rho applies to the normal values, and the correlation between the transformed inputs follows from it and from the two marginal distributions. Neine and Curran report that the correlations obtained were close to those desired under beta and gamma marginals. To simplify, they took the correlation between all N parameters as equal, the case in HE-CF-CHOD-002.
Correlation held fixed across iterations of the Neine and Curran transform
Neine and Curran state that the correlation between input variables is considered a fixed variable in the PSA, and describe their method as intended for situations where several plausible assumptions about it can be explored. Uncertainty about the correlation itself is therefore explored through scenarios.
Closed-form shapes in the calculator line of the Neine and Curran transform
The beta quantile in the line holds only with a first shape of 1 and the gamma quantile only with a shape of 1 (both derived from the distribution functions), and each needs its probability above 0 and below 1. A beta with first shape 1 has mean 1 / (1 + b_1). Other shapes need BETA.INV and GAMMA.INV, as in the Excel row.
Worked examples
Illustrative beta probability and gamma cost at a correlation of 0.5
All numbers are illustrative. With rho of 0.5, standard normal values of 0.8 and minus 0.4 give a correlated value of about 0.0536, and NORM.S.DIST gives probabilities of 0.7881446 and 0.521369. A beta input with shapes 1 and 9, mean 0.1, is drawn at about 0.1584 and a gamma cost with shape 1 and scale GBP 1,000 at about GBP 736.8.
rho = 0.5; z_1 = 0.8; z_2 = -0.4; Phi_1 = 0.7881446; Phi_2 = 0.521369; b_1 = 9; theta_2 = 1000; x_2 = 0.0535898; y_1 = 0.1584; y_2 = 736.8253
Standard normal values of zero returning the two medians
All numbers are illustrative. With both standard normal values at 0, both probabilities are 0.5 and each input takes its median, about 0.0741 for the beta with shapes 1 and 9 and about GBP 693.1 for the gamma, whatever the value of rho.
rho = 0.5; z_1 = 0; z_2 = 0; Phi_1 = 0.5; Phi_2 = 0.5; b_1 = 9; theta_2 = 1000; x_2 = 0; y_1 = 0.0741; y_2 = 693.1472
Zero correlation as the limiting case of the Neine and Curran transform
All numbers are illustrative. With rho of 0 the correlated value is z_2 itself, minus 0.4, with a normal probability of 0.3445783, so the gamma cost depends on z_2 alone and is drawn at about GBP 422.5.
rho = 0; z_1 = 0.8; z_2 = -0.4; Phi_1 = 0.7881446; Phi_2 = 0.3445783; b_1 = 9; theta_2 = 1000; x_2 = -0.4; y_1 = 0.1584; y_2 = 422.4764
Common errors
Target correlation read as the correlation achieved between non-normal inputs
rho is set on the normal scale. Neine and Curran report median correlations of 0.247, 0.496, 0.748 and 0.899 with gamma marginals for targets of 0.25, 0.5, 0.75 and 0.9, close to but below each target. The gap widens with skew and with negative targets. For two inputs with gamma shape 1 a target of 0.5 gives a Pearson correlation of about 0.453, and a target of minus 0.99 gives about minus 0.640, with minus 0.645 the limit as rho approaches minus 1 (all derived by numerical integration, one minus pi squared over 6 for the limit).
Fresh uniform number passed to the inverse distribution function
Passing RAND(), or the normal probability of an independent column, to BETA.INV or GAMMA.INV leaves the marginal distribution correct and removes the correlation, so the inputs look right on their own. In the first example, using z_2 in place of x_2 gives a gamma cost of about GBP 422.5 instead of about GBP 736.8, and the two inputs are then independent whatever the value of rho (derived).
Sources
Neine and Curran's sampling algorithm for correlated non-normal PSA inputs
Neine M, Curran D. An algorithm to generate correlated input-parameters to be used in probabilistic sensitivity analyses. Journal of Market Access & Health Policy. 2021;9(1):1857052. Methods, section Sampling algorithm, gives the steps of simulating uncorrelated standard normal variables, multiplying them by the Cholesky matrix, taking each value's probability from the normal cumulative distribution function and taking the inverse probability under a non-normal distribution such as a beta, gamma or log-normal. It states that to simplify the correlation between N parameters was taken as equal, and that the algorithm was implemented with VBA in Microsoft Excel.
Neine and Curran's achieved correlations and fixed correlation in the PSA
Neine M, Curran D. An algorithm to generate correlated input-parameters to be used in probabilistic sensitivity analyses. Journal of Market Access & Health Policy. 2021;9(1):1857052. Results, section Simulation results, reports median correlations with a gamma distribution of 0.247, 0.496, 0.748 and 0.899, and with a beta distribution of 0.248, 0.494, 0.746 and 0.895, for desired correlations of 0.25, 0.5, 0.75 and 0.9. Section Discussion states that the correlation between input variables is considered as a fixed variable in the PSA and that the method is intended for situations where several plausible assumptions can be explored.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0
