When measuring the neuron that we've described, you were able to do a remarkable job at decoding the rat's location when you did measure a spike from the neuron. Let's make the mind reading a little more difficult by introducing some error into the measurement of the spikes. One approach to measure a neuron's spikes is to insert an electrode into the brain and try to get the electrode close to one neuron to isolate its signal. Nonetheless, the signal the electrode picks up is noisy and includes effects from other neurons' spikes. It's a challenge to isolate the neuron's spikes from that signal, and algorithms to determine the spikes might miss some of the neuron's spikes or misidentify other neurons' spikes as coming from the neuron being recorded.
Let's imagine that, due to being conservative about classifying the signal as a spike, one misses half of the spikes of the neuron. We'll assume there is no relationship between the missed spikes and the location of the rat. Therefore, as far as the measurement is concerned, the neuron spikes only in 5 percent of the ms windows when the rat is in room A, and it spikes in only 1 percent of the ms windows when the rat is in room B. In other words, given that the event $R=1$ corresponds to measuring a spike, the conditional probabilities have dropped to
$P(R=1 \,|\, A) = $ ,
$P(R=1 \,|\, B) = $ .

With this measurement error, the overall spiking probability becomes $P(R=1)= $ .

How does this measurement error, and consequent reduced spiking probability, affect the ability to decode the rat's position from the measurement of a spike? With the error, the probability distribution of the rat's position conditioned on measuring a spike becomes
$P(A \,|\, R=1) = $ ,
$P(B \,|\, R=1) = $ .

Does the effect of the error on your ability to decode surprise you? yes no Mathematically, any mystery can be explained by Bayes' theorem for $P(A \,|\, R=1)$. The factor $P(R=1 \,|\, A)$ in the numerator was cut in half doubled stayed the same , and the denominator $P(R=1)$ stayed the same was cut in half doubled , so that the ratio stayed the same was cut in half doubled .

Surely, this conservative approach where one misses half the spikes must affect the decoding in some way. Indeed, the difference is that, due to the decrease increase in $P(R=1)$, the probability of actually measuring a spike (or having a “successful” experiment) stayed the same was cut in half doubled . If one becomes too conservative and drops $P(R=1)$ a whole lot, then it might take an unreasonably long time to successfully decode the rat's location. But, even so, at least the quality of the decoding would be enhanced degraded unchanged .

What happens if, on the other hand, one is too liberal in attempting to detect the neuron's spikes and ends up including additional spikes from other neurons. We wouldn't expect these extraneous spikes to be related to the rat's location in the same way as the target neuron's spikes, so let's imagine that these extra spikes increase the probability of measuring $R=1$ by 0.05 regardless of whether the rat is in room A or room B. The measurement error due to the liberal spike detection algorithm has increased the conditional probabilities of measuring a spike to
$P(R=1 \,|\, A) = $ ,
$P(R=1 \,|\, B) = $ .

With this measurement error, the overall spiking probability becomes $P(R=1)= $ .

How does this measurement error, and consequent increased spiking probability, affect the ability to decode the rat's position from the measurement of a spike? With the error, the probability distribution of the rat's position conditioned on measuring a spike becomes
$P(A \,|\, R=1) = $ ,
$P(B \,|\, R=1) = $ .

With the measurement error, the quality of the decoding was unchanged enhanced degraded . This result can be seen through Bayes' theorem for $P(A \,|\, R=1)$. Although both $P(R=1 \,|\, A)$ in the numerator and $P(R=1)$ in the denominator increased by the same amount , $P(R=1 \,|\, A)$ increased by a smaller larger fraction. Thus the ratio of $P(R=1 \,|\, A)/P(R=1)$ decreased increased after the introduction of the measurement error due to the liberal spike detection algorithm.

In general, decoding the rat's position from the spike of one neuron will work the best when $P(A \,|\, R=1)$ is neither small nor larger very large very small or very large very small , as that indicates we've determined that the rat is highly likely to be in one room or the other.

Given that we are viewing $P(A)$ and $P(B)$ as fixed (we aren't changing the rat's behavior), Bayes' theorem indicates that the decoding will work best when the ratio $P(R=1 \,|\, A)/P(R=1)$ is very large very small or very large very small neither small nor larger .

It shouldn't be surprising that this ratio indicates good decoding when the neuron is much more likely to fire in one room than in the other, i.e., when the neuron's response is strongly selective to the rat's location. (You can try calculating the ratio for a few example neurons to convince yourself it is true. For example, compare the non-selective case where $P(R=1 \,|\, A)=0.2$ and $P(R=1 \,|\, B)=0.1$ to the selective case where $P(R=1 \,|\, A)=0.2$ and $P(R=1 \,|\, B)=0.01$.)