|
1 | | -""" |
| 1 | +r""" |
2 | 2 | ================================ |
3 | 3 | Compute the explainable variance |
4 | 4 | ================================ |
|
15 | 15 | are the same for each repetition of the stimulus. Thus, encoding models will |
16 | 16 | predict only the repeatable stimulus-dependent signal. |
17 | 17 |
|
18 | | -The stimulus-dependent signal can be estimated by taking the mean of |
19 | | -brain responses over repeats of the same stimulus or experiment. The variance |
20 | | -of the estimated stimulus-dependent signal, which we call the explainable |
21 | | -variance, is proportional to the maximum prediction accuracy that can be |
22 | | -obtained by a voxelwise encoding model in the test set. |
| 18 | +The stimulus-dependent signal can be estimated by taking the mean of brain |
| 19 | +responses over repeats of the same stimulus or experiment. The variance of the |
| 20 | +estimated stimulus-dependent signal, which we call the explainable variance, is |
| 21 | +proportional to the maximum prediction accuracy that can be obtained by a |
| 22 | +voxelwise encoding model in the test set. |
23 | 23 |
|
24 | | -Mathematically, let :math:`y_i, i = 1 \\dots N` be the measured signal in |
25 | | -a voxel for each of the :math:`N` repetitions of the same stimulus and |
26 | | -:math:`\\bar{y} = \\frac{1}{N}\\sum_{i=1}^Ny_i` the average brain response |
27 | | -across repetitions. For each repeat, we define the residual timeseries |
28 | | -between brain response and average brain response as :math:`r_i = y_i - \\bar{y}`. |
29 | | -The explainable variance (EV) is estimated as |
| 24 | +Mathematically, let :math:`y_i, i = 1 \dots N` be the measured signal in a |
| 25 | +voxel for each of the :math:`N` repetitions of the same stimulus and |
| 26 | +:math:`\bar{y} = \frac{1}{N}\sum_{i=1}^Ny_i` the average brain response |
| 27 | +across repetitions. For each repeat, we define the residual timeseries between |
| 28 | +brain response and average brain response as :math:`r_i = y_i - \bar{y}`. The |
| 29 | +explainable variance (EV) is estimated as |
30 | 30 |
|
31 | 31 | .. math:: |
32 | | - \\text{EV} = \\frac{1}{N}\sum_{i=1}^N\\text{Var}(y_i) - \\frac{N}{N-1}\sum_{i=1}^N\\text{Var}(r_i) |
| 32 | + \text{EV} = \frac{1}{N}\sum_{i=1}^N\text{Var}(y_i) - \frac{N}{N-1}\sum_{i=1}^N\text{Var}(r_i) |
33 | 33 |
|
34 | 34 |
|
35 | | -In the literature, the explainable |
36 | | -variance is also known as the *signal power*. For more information, see these |
37 | | -references [1]_ [2]_ [3]_. |
| 35 | +In the literature, the explainable variance is also known as the *signal |
| 36 | +power*. For more information, see these references [1]_ [2]_ [3]_. |
38 | 37 | """ |
39 | 38 | # sphinx_gallery_thumbnail_number = 1 |
40 | 39 | ############################################################################### |
|
151 | 150 | plt.show() |
152 | 151 |
|
153 | 152 | ############################################################################### |
154 | | -# This figure is a flattened map of the cortical surface. A number of regions of |
155 | | -# interest (ROIs) have been labeled to ease interpretation. If you have |
| 153 | +# This figure is a flattened map of the cortical surface. A number of regions |
| 154 | +# of interest (ROIs) have been labeled to ease interpretation. If you have |
156 | 155 | # never seen such a flatmap, we recommend taking a look at a `pycortex brain |
157 | 156 | # viewer <https://www.gallantlab.org/brainviewer/Deniz2019>`_, which displays |
158 | 157 | # the brain in 3D. In this viewer, press "I" to inflate the brain, "F" to |
|
0 commit comments