# similairty metric analysis
## SSM and sparsity
In this section, we investigate how the sparsity of two representations affect their SSM value.
Given representation matrix $X_{n,m}$ where $n$ is number of images and $m$ is number of neurons.
In the SSM analysis, we treat image as random variables and neurons as samples, thus we assume that representation $A$ is drawn from multivariate normal distribution
$X^{A}_n \sim N(0, C_A)$, where $C_A$ is $n\times n$ matrix.
and representation $B$ is drawn from multivariate normal distribution
$X^{B}_n \sim N(0, C_B)$, where $C_B$ is $n\times n$ matrix.
Assume $\mbox{diag}(C_A)=\mbox{diag}(C_B)=I$, Then PCC similairty matrix of representation $A$ is $C_A$ and similairty matrix of representation $B$ is $C_B$ given sufficient neuron samples ($m$ large enough). The SSM between $A$ and $B$ is $spearmanr(C_A, C_B)$.
If we enforce sparsity on the neuron samples, setting a certain number of samples to be zero, then the SSM should remain the same if the remaining neuron samples is still sufficient. An example simulation is as follows:
$X_A,X_B$ are $100\times 1000$ matrices with $1000$ samples of $100$-$d$ normal distribution $N(0,C_A), N(0,C_B)$ with $C_A$ and $C_B$ fixed. Randomly select different number of neuron dimension and set the whole column to be zero in $X_A$ and $X_B$ does not affect SSM for a certain range.
