# Pearson correlation of neural responses with it's linear estimation

I am trying to understand the following fact from this article (page 13): How can single neurons predict behaviour

Suppose I have a linear estimation of a stimulus: $\hat{s} = \mathbf{w}^T(\mathbf{r} - \mathbf{f}(s_0)) + s_0$

where $\mathbf{w}$ is a vector of weights, $\mathbf{r}$ is a vector of responses of two neurons to a stimulus, $\mathbf{f}$ is the vector of average neural responses to the stimulus, and the stimuli (angels between $-\pi$ to $\pi$) are symetric (amount and location) around $s_0 = 0$.

Can anyone see why the following is true for the Pearson correlation (where $\Sigma$ is the covariance matrix of $\mathbf{r}$):

$$Corr(\hat{s},r_k) = \frac{\langle \hat{s}r_k \rangle - \langle \hat{s} \rangle \langle r_k \rangle}{\sqrt{( \langle \hat{s}^2 \rangle - \langle \hat{s} \rangle^2) }\sqrt{( \langle r_k^2 \rangle - \langle r_k \rangle^2) }} = \frac{(\Sigma \mathbf{w})_k}{\sqrt{(\Sigma_{kk}\mathbf{w}^T \Sigma \mathbf{w})}}$$

Thanks!

• Please specify your question! State the meaning of all variables (most of them are specified, but for example, what does $k$ mean? The $k$-th entry of the vector r? Certainly not. The $k$-th entry of $(\Sigma w)_k$... yes, maybe). What is $s_0$? What does $f(s_0)$ mean? Is f a function of $s_0$ or is $s_0$ more a kind of an index here? – M529 Mar 11 '16 at 17:09
• On a second look, what you have there is pretty much just another definition of the correlation coefficient. You have $\Sigma_{kk} \equiv \textrm{Cov(r_k, r_k)} \equiv \textrm{Var(r_k, r_k)}$, and the same can certainly be shown for the remaining terms, if the meaning of your variables is more clear. – M529 Mar 11 '16 at 17:28
• $k$ is the k'th neuron. What do you mean by $\Sigma_{kk} \equiv \textrm{Cov(r_k, r_k)} \equiv \textrm{Var(r_k, r_k)}$? Could you please specify? this will help me a lot. I have a lot of background in mathematics but not in statistics or probebillity. If you would specify the equasions it would help me a lot. Thanks!!! – user135172 Mar 12 '16 at 7:56
• If $\Sigma$ is the Variance-Covariance-Matrix of different signals $r_k$, then each element $\Sigma_{ij}$ is given by the covariance of $r_i$ and $r_j$. In the special case $i=j$, the matrix element is the covariance of $r_i$ with itself, which by definition is the variance of $r_i$. This is what I meant. Apparently, the mathematics mode somehow messed up the indices, hence r_k means r with index k. – M529 Mar 12 '16 at 8:32
• What I ment with "can be shown for the remaining terms": What you have is a definition of the Pearson correlation coefficient (middle term of your equation with the $<>$ brackets. On the right side, apparently the averaging etc. is replaced by some matrix/vector notation, e.g. if $\boldsymbol{r}$ is a matrix holding all vectors $r_k$, then $\Sigma = \boldsymbol{r}^T \boldsymbol{r}$. You can certainly show that $w^T \Sigma w$ is the variance of $\hat{s}$. However I can't, since I do not fully understand your equation/notation as stated in the first comment. – M529 Mar 12 '16 at 8:40