  We study the rank of the instantaneous or spot covariance matrix
$\Sigma_X(t)$ of a multidimensional continuous semi-martingale $X(t)$. Given
high-frequency observations $X(i/n)$, $i=0,\ldots,n$, we test the null
hypothesis $rank(\Sigma_X(t))\le r$ for all $t$ against local alternatives
where the average $(r+1)$st eigenvalue is larger than some signal detection
rate $v_n$.
  A major problem is that the inherent averaging in local covariance statistics
produces a bias that distorts the rank statistics. We show that the bias
depends on the regularity and a spectral gap of $\Sigma_X(t)$. We establish
explicit matrix perturbation and concentration results that provide
non-asymptotic uniform critical values and optimal signal detection rates
$v_n$. This leads to a rank estimation method via sequential testing. For a
class of stochastic volatility models, we determine data-driven critical values
via normed p-variations of estimated local covariance matrices. The methods are
illustrated by simulations and an application to high-frequency data of U.S.
government bonds.
