Generalized covariance measure statistic (source code)

= Generalized covariance measure statistic
{title2=$T$}

To test $X\mathrel{\perp\!\!\!\perp}Y\mid Z$, regress $X$ and $Y$ on $Z$ and average the products of their residuals. Dividing the scaled average by its empirical second moment produces the generalized covariance measure statistic. Small mean-square nuisance-regression errors and a product-rate condition make it asymptotically pivotal.