Why Joint Trait Structure Matters
A virtual patient is represented by a collection of traits, not by isolated values. For example, body weight, organ function, and a baseline biomarker may each have a plausible marginal distribution, yet a population assembled by drawing each trait independently can have unrealistic combinations. Encoding dependence lets the joint distribution represent relationships such as heavier patients tending to have a higher value of another trait. The task here is to specify that dependence through a covariance or correlation matrix and verify that the specification is mathematically possible.
The matrix describes second-order structure: trait means, variances, and pairwise covariances. It does not, by itself, uniquely determine every possible joint distribution. A multivariate-normal model is one explicit choice that turns a valid mean vector and covariance matrix into a complete joint distribution. The assumptions behind that choice need to be stated rather than inferred from the matrix.
Covariance and Correlation Matrices
Covariance has units equal to the product of the two traits’ units. For instance, if body weight is measured in kilograms and clearance in litres per hour, their covariance has units kg·L/h. A correlation is unit-free and ranges from \(-1\) to \(1\). A positive correlation indicates that values above a trait’s mean tend to occur with values above the other trait’s mean; a negative correlation indicates an opposite linear tendency. Correlation describes linear association, not a causal effect.
Let \(D=\operatorname{diag}(\sigma_1,\ldots,\sigma_p)\). When all standard deviations are positive, the covariance and correlation matrices are related by
This conversion is useful when marginal standard deviations and correlations are easier to specify than covariances. It also makes the units transparent: the diagonal scaling restores each covariance entry to the product of the corresponding trait units.
Conditions for a Valid Matrix
Every covariance matrix must be symmetric and positive semidefinite. Symmetry follows because \(\operatorname{Cov}(X_i,X_j)=\operatorname{Cov}(X_j,X_i)\). Positive semidefiniteness means that for every real vector \(\mathbf{a}\), \(\mathbf{a}^T\Sigma\mathbf{a}\geq 0\). This condition is necessary because
Consequently, each diagonal variance must be nonnegative. If all variances are strictly positive, the correlation matrix is also symmetric and positive semidefinite, with diagonal entries equal to one. Checking that every proposed pairwise correlation lies between \(-1\) and \(1\) is necessary, but not sufficient: the correlations must be jointly compatible.
A matrix is positive definite if \(\mathbf{a}^T\Sigma\mathbf{a}>0\) for every nonzero \(\mathbf{a}\). Positive definiteness means the traits have no exact linear combination with zero variance. Positive semidefinite matrices that are not positive definite are singular; they can still describe valid distributions, but those distributions occupy a lower-dimensional subset of the full trait space. A zero-variance trait is constant with probability one, and its correlations with other traits are undefined because the correlation denominator includes its zero standard deviation.
Worked Example: Constructing Covariance From Standard Deviations and Correlations
Suppose three hypothetical continuous traits have standard deviations 10 kg, 0.20 units of a biomarker, and 5 L/h. Their specified pairwise correlations are \(R_{12}=0.60\), \(R_{13}=-0.20\), and \(R_{23}=0.10\). First form
The covariance entries are \(\Sigma_{ij}=\sigma_i R_{ij}\sigma_j\). Thus \(\Sigma_{12}=10(0.60)(0.20)=1.20\) kg·biomarker units, \(\Sigma_{13}=10(-0.20)(5)=-10.0\) kg·L/h, and \(\Sigma_{23}=0.20(0.10)(5)=0.100\) biomarker units·L/h. The diagonal entries are the variances \(100\) kg², \(0.0400\) biomarker-units², and \(25.0\) (L/h)². Therefore,
To check joint validity, \(R\) is symmetric with unit diagonal. Its two-by-two principal minors are \(1-0.60^2=0.640\), \(1-(-0.20)^2=0.960\), and \(1-0.10^2=0.990\). Its determinant is \(1+2(0.60)(-0.20)(0.10)-0.60^2-(-0.20)^2-0.10^2=0.566\). These are positive, so this three-trait correlation matrix is positive definite. Since \(D\) has positive diagonal entries, \(\Sigma=DRD\) is positive definite as well. The proposed joint structure is valid.
From a Valid Matrix to a Joint Distribution
To generate patient traits using the multivariate-normal model, specify a mean vector \(\boldsymbol{\mu}\) and a valid covariance matrix \(\Sigma\), and assume \(\mathbf{X}\sim N_p(\boldsymbol{\mu},\Sigma)\). This model assumes a joint Gaussian distribution; each trait is normally distributed marginally, and the specified matrix gives all pairwise covariances. If \(\Sigma\) is positive definite, the joint distribution has a density over the full \(p\)-dimensional space. A positive-semidefinite singular \(\Sigma\) instead defines a degenerate multivariate normal concentrated on a lower-dimensional set.
For a positive-definite covariance matrix, Cholesky factorization gives a lower-triangular matrix \(L\) such that \(\Sigma=LL^T\). If \(\mathbf{Z}\) has independent standard-normal components, then \(\mathbf{X}=\boldsymbol{\mu}+L\mathbf{Z}\) has the desired mean and covariance. The justification is short but fundamental:
For a positive-semidefinite matrix that is not positive definite, an eigenvalue factorization can be used instead. Write \(\Sigma=Q\Lambda Q^T\), where \(Q\) is orthogonal and \(\Lambda\) is diagonal with nonnegative eigenvalues. Then \(A=Q\Lambda^{1/2}\) satisfies \(AA^T=\Sigma\), and \(\boldsymbol{\mu}+A\mathbf{Z}\) has the target mean and covariance. Zero eigenvalues produce exact linear constraints among the generated traits.
Worked Example: Generating Two Correlated Traits
Consider hypothetical body weight \(X_1\), with mean 70 kg and standard deviation 12 kg, and a continuous clearance trait \(X_2\), with mean 5 L/h and standard deviation 3 L/h. Suppose their correlation is \(0.50\). The covariance is \(0.50(12)(3)=18\) kg·L/h, so
The matrix is symmetric; its diagonal entries are positive, and its determinant is \(144(9)-18^2=972>0\), so it is positive definite. A Cholesky factor is
For the illustrative standard-normal draw \(\mathbf{Z}=(0.80,-0.50)^T\), the generated traits are
This is one draw, not a claim that the two values must rise together for every patient. Across repeated draws, the marginal standard deviations are 12 kg and 3 L/h, and the Pearson correlation is 0.50 by construction.
Worked Example: Pairwise-Valid Correlations That Cannot Coexist
Suppose three hypothetical traits are assigned correlations \(R_{12}=0.90\), \(R_{13}=0.90\), and \(R_{23}=-0.90\). Each entry individually lies within the allowable correlation range, but the assembled matrix is
Its determinant is \(1+2(0.90)(0.90)(-0.90)-0.90^2-0.90^2-(-0.90)^2=1-1.458-2.430=-2.888\). A positive-semidefinite matrix cannot have a negative determinant, so this is not a valid correlation matrix. No joint distribution can have all three specified correlations simultaneously. The issue is not any one pair in isolation; the three pairwise relationships conflict when required to hold for the same joint population. The entries must be revised using a joint validity check, not merely clipped to the interval \([-1,1]\).
Worked Example: A Trait With Zero Variance
Suppose a hypothetical two-trait population has a biomarker that is exactly constant at 4 units, while a second trait has mean 10 units and variance 9 units². The covariance matrix
is positive semidefinite: its eigenvalues are 0 and 9. It represents \(X_1=4\) with probability one and a varying \(X_2\). The covariance is zero because \(X_1-\mu_1=0\) always. However, the correlation \(R_{12}\) is undefined: its formula would divide by \(\sigma_1\sigma_2=0(3)=0\). It would be incorrect to report this correlation as zero. In this case, report the variance-covariance structure and explicitly state that the constant trait has no defined correlation with the other trait.
Diagnostics, Interpretation, and Limitations
A practical validation sequence is to check dimensions and units, symmetry, diagonal entries, and positive semidefiniteness before attempting factorization. For a correlation matrix, also check that every diagonal is one and every entry is between \(-1\) and \(1\). Eigenvalues provide a general positive-semidefiniteness check: all must be nonnegative, up to a stated numerical tolerance. A noticeably negative eigenvalue indicates an invalid matrix; a tiny negative value can arise from rounding or numerical computation and should be investigated rather than silently ignored. Cholesky failure is a useful warning of non-positive-definiteness, but it does not by itself establish that a matrix is invalid, because a valid singular matrix also fails ordinary positive-definite Cholesky factorization.
The multivariate-normal model has important limits. It places symmetric, bell-shaped marginal distributions on the traits and uses a covariance matrix to capture linear association. A valid covariance matrix alone does not require normality and does not reveal nonlinear dependence or unusual tail relationships. Also, a normal distribution is unbounded: it can generate values outside physically or clinically admissible ranges. The earlier material on defining admissible parameter ranges motivates checking whether a chosen distribution is compatible with those ranges; the matrix itself does not enforce them.
Independently drawing each trait is a simpler alternative, but it imposes zero covariance between traits and may create unrealistic combinations when real traits are associated. Specifying a covariance matrix directly is convenient when covariances and their units are meaningful. Specifying standard deviations and a correlation matrix separates marginal scales from dimensionless association, but requires positive standard deviations to define every correlation. A multivariate-normal construction is appropriate when its distributional assumptions are defensible; if dependence or marginal shapes are non-Gaussian, a different joint-distribution construction is needed rather than assuming that a covariance matrix fully describes the population.
Common Mistakes
- Checking only pairwise ranges. Correlations within \([-1,1]\) can still form a non-positive-semidefinite matrix. Check the whole matrix.
- Confusing correlation and covariance. Covariance has product units; correlation is dimensionless. Use \(DRD\) to convert with the stated standard deviations.
- Assigning a correlation to a constant trait. A zero standard deviation makes the correlation formula undefined, not zero.
- Assuming a covariance matrix specifies every feature of dependence. It specifies second moments. A complete joint model requires further assumptions, such as multivariate normality.
- Treating a singular matrix as necessarily invalid. Positive semidefinite singular matrices are valid covariance matrices, though they imply exact constraints and no full-dimensional density.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A patient trait has standard deviation 4 units and a second trait has standard deviation 2 mg/L. Their correlation is \(-0.25\). What is their covariance, including units?
- Why is checking that every entry of a proposed correlation matrix lies between \(-1\) and \(1\) not enough to establish validity?
- For a positive-definite covariance matrix, explain why multiplying a standard-normal vector by a Cholesky factor gives the target covariance.
- One trait is constant across the population. Is its correlation with a varying trait zero, or undefined? Explain.
Solutions. (1) The covariance is \((-0.25)(4)(2)=-2.00\) unit·mg/L. (2) The entries must be jointly compatible; the whole matrix must be positive semidefinite, not just pairwise within range. (3) If \(\mathbf{X}=\boldsymbol{\mu}+L\mathbf{Z}\), with \(\operatorname{Cov}(\mathbf{Z})=I\) and \(LL^T=\Sigma\), then \(\operatorname{Cov}(\mathbf{X})=LIL^T=\Sigma\). (4) It is undefined because the constant trait has standard deviation zero, making the correlation denominator zero; its covariance with any trait is zero, but that does not define a correlation.