# Recovering dimensionality of shared subspace?

Suppose I have X random variable have form $$\langle x1,0,x2\rangle$$ and Y random variable have form $$\langle y1,y2,0\rangle$$. These variables have 1 dimension in common. Is it possible to determine this fact when a rotation has been applied to the data?

To make this precise: let $$X$$ and $$Y$$ are independent random in $$\mathbb{R}^d$$ with $$E[X]=E[Y]=0$$, and $$\text{rank}E[X'X]=\text{rank}E[Y'Y]=r$$

Let A be $$A$$ a linear transformation $$A$$ such that $$AX$$ and $$AY$$ are non-zero in $$r$$ dimensions $$x_1,\ldots,x_r$$ and $$y_1,\ldots,_r$$ with $$x_1,\ldots,x_i=y_1,\ldots,y_i=1,\ldots,i$$

Let $$A$$ be chosen to maximize $$i$$, how do I compute $$i$$?

In my application $$r\approx 100$$, $$d\approx 1000$$, number of samples $$\approx$$ 1M

• "Have one dimension in common" appears to be a mischaracterization, because it implicitly relies on the primacy of a given basis $\{(1,0,0),(0,1,0),(0,0,1)\}.$ Upon rotation the meaning of that basis disappears. All you really have going on is that $X$ is confined to a 2D subspace and $Y$ is confined to a potentially different 2D subspace. It's a theorem of linear algebra that when both subspaces have full dimension, their intersection has dimension 1: your "one dimension in common." – whuber Sep 16 '19 at 11:35
• @whuber Not sure if a concidence, but in simulations I'm able to recover d from trace(Z)/norm(Z) where Z is a solution to cov(X) Z + Z cov(X) = 2 cov(Y) -- wolframcloud.com/obj/yaroslavvb/newton/lyapunov.nb . IE, I sample random variables of form <x1,...,x{d}, x{d+1}, ..., x{rank-d},0, 0,..., 0> and <y1,...,y{d}, 0, ...., 0, y{d+1}, y{rank-d}> and try to get d – Yaroslav Bulatov Sep 16 '19 at 18:05
• Linear algebra tells us the dimension of the intersection equals $$\operatorname{rank}(X^\prime X) + \operatorname{rank}(Y^\prime Y) - \operatorname{rank}((X+Y)^\prime (X+Y)).$$ – whuber Sep 16 '19 at 18:28