Tutorials › Multivariate Statistics (Graduate) › Sample-Size and Dimension Diagnostics

Multivariate Dependence Testing · Tutorial 451 of 975

Sample-Size and Dimension Diagnostics

Use distance, bandwidth, and effective-sample-size diagnostics to assess whether a dependence test has enough information and is correctly calibrated.

Advanced 11 min read

What You'll Learn

  • Quantify concentration of Euclidean distances as marginal dimension increases
  • Relate radial-kernel bandwidth to typical pairwise distances
  • Calculate effective sample size under clustered or serial dependence
  • Distinguish power loss from incorrect null calibration
  • Build a diagnostic workflow for dependence-test studies

Why Sample Size and Dimension Must Be Diagnosed Together

A multivariate independence test can be correctly implemented and still have little ability to detect dependence. The problem may be limited sample size, a high-dimensional representation in which informative structure is diluted, or a tuning choice that makes pairwise similarities nearly indistinguishable. A fourth possibility is that the observations are dependent in a way the calibration does not accommodate. These problems can all produce few rejections, but they require different remedies.

The central diagnostic task is therefore not simply to ask whether \(n\) is “large” or whether the dimension is “high.” Instead, examine the geometry of the observed data, the scale used by the statistic, the amount of independent information, and the test’s behavior under the null. The diagnostics below apply to distance-covariance and kernel-based procedures without replacing their specific test statistics or calibration schemes.

Definition: The marginal dimensions are the numbers \(p\) and \(q\) of recorded coordinates in random vectors \(X\in\mathbb{R}^p\) and \(Y\in\mathbb{R}^q\). For a test that rejects when a statistic exceeds a critical value, its power at a specified alternative distribution is the probability of rejection under that distribution. For a composite null hypothesis \(H_0\), the size is the supremum of the rejection probability over all parameter values satisfying \(H_0\). A rejection probability at one particular null configuration is a rejection rate at that configuration, not in general the size.

Distance Concentration as Dimension Grows

In high dimensions, pairwise Euclidean distances can become similar in relative terms. This does not mean every distance is identical, nor does it imply that every distance-based procedure fails. It does mean that a statistic relying on variation among distances may have less geometric contrast to work with, especially when informative coordinates are mixed with many irrelevant ones.

A simple reference calculation uses independent \(X,X'\sim N(0,I_p)\). Their difference has distribution \(X-X'\sim N(0,2I_p)\), so the squared distance is a sum of \(p\) independent squared normal coordinates. Its relative variability decreases with \(p\).

Result: If \(X,X'\) are independent \(N(0,I_p)\), then \(\operatorname{E}\|X-X'\|^2=2p\) and \(\operatorname{Var}(\|X-X'\|^2)=8p\). Consequently, the coefficient of variation of the squared distance is \(\sqrt{2/p}\).

Proof. Write \(X-X'=(Z_1,\ldots,Z_p)\), where the \(Z_j\) are independent \(N(0,2)\) variables. For each coordinate, \(E[Z_j^2]=2\) and \(\operatorname{Var}(Z_j^2)=2(2^2)=8\), using the variance \(2v^2\) of the square of a \(N(0,v)\) variable. Independence gives \[ E\left[\sum_{j=1}^p Z_j^2\right]=2p,\qquad \operatorname{Var}\left(\sum_{j=1}^p Z_j^2\right)=8p. \] The coefficient of variation is the standard deviation divided by the mean, hence \(\sqrt{8p}/(2p)=\sqrt{2/p}\). \(\square\)

This is a diagnostic, not a universal theorem about test power. Scaling coordinates differently, using a non-Euclidean metric, or concentrating dependence in a small subset of coordinates changes the relevant geometry. In practice, inspect pairwise-distance distributions within each margin, their spread relative to their typical scale, and whether a small number of variables dominate the distances.

Worked Example: Quantifying Distance Concentration

Suppose each margin is modeled as a standardized Gaussian vector with \(p=8\) or \(p=200\) coordinates. Under the reference model, the mean squared distance between two independent observations is \(2p\), and its coefficient of variation is \(\sqrt{2/p}\).

At \(p=8\), the mean squared distance is \(16\), and the coefficient of variation is \(\sqrt{2/8}=0.5\). The standard deviation is therefore \(0.5(16)=8\).

At \(p=200\), the mean squared distance is \(400\), and the coefficient of variation is \(\sqrt{2/200}=0.1\). The standard deviation is \(0.1(400)=40\). The absolute spread is larger, but it is smaller relative to the typical squared distance: 10% rather than 50%.

Thus, a plot of raw distances alone could be misleading because their scale changes with dimension. A useful check is to compare relative spread, such as the coefficient of variation, and to inspect whether the observed distances are concentrated around a narrow band.

Kernel Bandwidth and the Scale of Pairwise Distances

For a Gaussian radial kernel, use the convention \(k_{\sigma}(x,x')=\exp\{-\|x-x'\|^2/(2\sigma^2)\}\). If \(\sigma^2\) is very small relative to typical squared distances, most distinct pairs receive similarities near zero. If it is very large, similarities are near one and may vary little across pairs. Either extreme can reduce useful contrast. The relevant scale depends on the data’s units and dimension, so a bandwidth value has no meaning in isolation.

Result: If \(X,X'\) are independent \(N(0,I_p)\), then for the Gaussian radial kernel, \[ E[k_{\sigma}(X,X')]=\left(1+\frac{2}{\sigma^2}\right)^{-p/2}. \]

Derivation. The coordinate differences \(Z_j=X_j-X'_j\) are independent \(N(0,2)\). For \(Z\sim N(0,2)\), direct integration of its density gives \(E[\exp\{-Z^2/(2\sigma^2)\}]=(1+2/\sigma^2)^{-1/2}\). The kernel factorizes across coordinates: \[ k_{\sigma}(X,X')=\prod_{j=1}^p \exp\{-Z_j^2/(2\sigma^2)\}. \] Independence therefore makes the expectation the product of \(p\) identical expectations, giving the stated expression. \(\square\)

Worked Example: Checking Bandwidth at 50 Dimensions

Let \(p=50\), and consider three bandwidth variances, \(\sigma^2=1,100,\) and \(200\). The expected kernel similarity between independent standard Gaussian observations is \((1+2/\sigma^2)^{-25}\).

For \(\sigma^2=1\), this is \(3^{-25}=1/847288609443\approx1.18\times10^{-12}\). The average similarity is effectively zero.

For \(\sigma^2=100\), it is \(1.02^{-25}\approx0.610\). For \(\sigma^2=200\), it is \(1.01^{-25}\approx0.780\). These values show that increasing the bandwidth moves typical similarities toward one. They do not alone determine test power: the distribution of similarities, their dependence across pairs, and the alternative structure also matter.

The typical squared distance in this reference model is \(2p=100\). Bandwidth variances of 100 and 200 are on that scale, whereas 1 is far smaller. This makes the calculation a useful warning about scale mismatch, not a universal bandwidth-selection rule.

A practical bandwidth diagnostic reports the distribution of off-diagonal kernel values, not just the selected bandwidth. If nearly all values are indistinguishable near zero or near one, investigate rescaling, robust bandwidth choices, or a prespecified range of scales. Any tuning performed using the data must also be reflected in the inferential procedure; a calibration that treats a data-selected bandwidth as fixed may not have the claimed null behavior.

Effective Sample Size and Dependence Among Observations

The nominal sample size counts rows; the effective sample size describes how much independent information a particular estimator receives. It depends on the dependence structure and the estimand, so there is no single universally correct replacement for \(n\) in every multivariate test. Two useful calculations are available for common designs.

For \(G\) independent clusters, each containing \(m\) observations, suppose a scalar observation has variance \(\tau^2\), and within each cluster every distinct pair has covariance \(\rho\tau^2\). The variance of the overall sample mean follows directly from summing all variances and covariances.

Result: Under the equal-cluster model just described, with \(n=Gm\), \[ \operatorname{Var}(\bar Z)=\frac{\tau^2}{Gm}\{1+(m-1)\rho\}. \] Relative to \(n\) independent observations of variance \(\tau^2\), the corresponding mean-estimation effective sample size is \(n_{\mathrm{eff}}=n/\{1+(m-1)\rho\}\), when the design effect is positive.

Proof. The variance of the sum within one cluster is \(m\tau^2+m(m-1)\rho\tau^2\): there are \(m\) individual variances and \(m(m-1)\) ordered covariance terms. Independent clusters add their variances, so \[ \operatorname{Var}(\bar Z) =\frac{Gm\tau^2+Gm(m-1)\rho\tau^2}{(Gm)^2} =\frac{\tau^2}{Gm}\{1+(m-1)\rho\}. \] Equating this variance to \(\tau^2/n_{\mathrm{eff}}\) yields the stated effective sample size. \(\square\)

Worked Example: Clustered Measurements

Suppose a study records \(m=5\) measurements in each of \(G=20\) clinics, for \(n=100\) total observations. Assume, for the purpose of a mean-estimation approximation, an intracluster correlation of \(\rho=0.20\).

The design effect is \(1+(5-1)(0.20)=1.8\). Thus \(n_{\mathrm{eff}}=100/1.8\approx55.6\). Equivalently, the variance of the mean is 1.8 times the variance that would be obtained from 100 independent observations with the same marginal variance.

This calculation does not establish that a dependence test can be calibrated as though it had 55.6 independent pairs. It quantifies loss of information for a mean under the specified cluster model. For an independence test, the design and calibration must respect the actual independent units and any exchangeability restrictions.

For a stationary scalar sequence with variance \(\tau^2\) and autocorrelation \(\rho_k\) at lag \(k\), direct expansion gives \(\operatorname{Var}(\bar Z)=\tau^2 n^{-1}[1+2\sum_{k=1}^{n-1}(1-k/n)\rho_k]\). When the autocorrelations are summable and \(n\) is sufficiently large, this motivates the approximation \(n_{\mathrm{eff}}\approx n/[1+2\sum_{k\ge1}\rho_k]\). It is an approximation for the mean under those dependence conditions, not a generic effective sample size for every multivariate statistic.

Separate Weak Signal From Poor Calibration

A low rejection rate under an alternative can reflect low power, but first establish that the null calibration is trustworthy. For a composite null, size is the worst-case rejection probability across null parameter values. In a simulation at one chosen null configuration, report the rejection rate there and its Monte Carlo uncertainty; do not label it the size unless the relevant supremum has been controlled.

For \(B\) independent simulation replicates at a fixed configuration, if \(R\) replicates reject, the estimated rejection rate is \(\hat r=R/B\). Its Monte Carlo standard error is approximately \(\sqrt{\hat r(1-\hat r)/B}\), from the binomial variance. A rate near the target level at selected null configurations is evidence about calibration, but does not prove uniform size control. For permutation procedures, verify that the permutations preserve the design’s exchangeability structure; unrestricted permutation of clustered or serially dependent observations may invalidate the reference distribution.

Worked Example: Interpreting a Low Rejection Rate

A study evaluates a test at nominal level 0.05. In \(B=1000\) replicates under one null configuration, it rejects 62 times. The null rejection rate is \(62/1000=0.062\). Its approximate Monte Carlo standard error is \(\sqrt{0.062(0.938)/1000}\approx0.0076\).

The observed rate is about 1.6 standard errors above 0.05, so this result alone is not decisive evidence of miscalibration; it does justify checking the procedure across more null configurations or with additional replicates. It is not a proof that the composite-null size is 0.062, nor that size is controlled at 0.05.

Now suppose the same study reports 180 rejections in 1000 replicates under a specified alternative. Its estimated power there is 0.18, with approximate Monte Carlo standard error \(\sqrt{0.18(0.82)/1000}\approx0.012\). If null behavior is satisfactory under the intended design, the low alternative rejection rate points toward limited power for that alternative. It does not by itself identify whether the cause is weak dependence, high dimension, bandwidth, or limited effective information.

A disciplined investigation changes one feature at a time where possible. Compare power across sample sizes while holding the alternative and analysis fixed; inspect distances and kernel values as dimension changes; evaluate more than one scientifically reasonable bandwidth; and repeat null calibration under the actual sampling design. This separates a test with little sensitivity to a particular signal from a test whose rejection threshold is not behaving as intended.

1
Check the sampling units.
Identify independent units, clusters, repeated measures, or serial structure. Match calibration to the design rather than substituting a heuristic effective sample size.
2
Inspect geometry and kernel scale.
Summarize relative distance spread and off-diagonal kernel similarities for each margin. Look for distance concentration or similarities crowded near zero or one.
3
Assess null behavior.
Estimate rejection rates under relevant null configurations and report Monte Carlo uncertainty. Investigate calibration before interpreting low power.
4
Assess power conditionally on calibration.
Report power for explicitly specified alternatives, dimensions, sample sizes, and tuning choices. Treat conclusions as specific to those conditions.

Common Pitfall and Practical Interpretation

A common mistake is to see few rejections in a high-dimensional study and conclude immediately that the variables are nearly independent. The reasoning is incomplete: weak dependence is one possibility, but concentrated distances, a poorly scaled bandwidth, correlated observations, or a miscalibrated reference distribution can lead to the same pattern. The correction is to diagnose geometry, tuning, independent information, and null behavior separately before interpreting power.

These checks matter because a dependence test’s result is conditional on how the data were represented, how its scale was chosen, and how its reference distribution was obtained. Reporting those details makes a negative result interpretable: readers can see whether the study had a meaningful chance to detect the dependence pattern of interest, rather than treating nonrejection as evidence that dependence is absent.

Key takeaway: Dimension, sample size, bandwidth, and calibration interact. Quantify distance and kernel scales, account for dependence in the sampling design, and establish null behavior before attributing low rejection rates to weak signal.

Check Your Understanding

Use the definitions and calculations above to answer these questions.

  1. For independent \(N(0,I_p)\) observations, how does the coefficient of variation of squared pairwise distance change when \(p\) increases?
  2. Why can a Gaussian kernel produce nearly constant similarities when its bandwidth is much too small or much too large relative to the data scale?
  3. In a clustered design, what assumptions make the design-effect effective sample size calculation meaningful, and why is it not automatically the effective sample size for a dependence test?
  4. A test has a low rejection rate under an alternative. Name two diagnostics needed before concluding that the signal is weak.
  5. For a composite null, distinguish size from a rejection rate computed at one particular null configuration.
Clinical Biostats