Andrew Reid PhD

ABOUT CV PUBLICATIONS RESEARCH SOFTWARE CONTACT BLOG CODE

Blog posts

Intro
Search
Learning about EEG (part 1)
Published on 2026-09-09
by Andrew Reid
#22

Electroencephalography (EEG) has been around for about 100 years 1. In that time, while it has evolved, the basic approach has not substantially changed: apply an electrode to the scalp and record the electrical potential at that electrode over time. This potential is related to electrical currents produced by neuronal synapses, which reflect the degree of activity in the underlying brain tissue. However, how the spatiotemporal EEG pattern relates to localized brain activity remains a difficult and intensively researched problem 2.

In this teaching-oriented post, I will take you through some of the fundamental concepts that allow us to interpret and analyze the EEG signal (and to some extent, its magnetic counterpart, the magnetoencephalogram or MEG). I will attempt to give an intuitive explanation of how spatially coherent cortical pyramidal cells can give rise to electromagnetic fields due to the cumulative effects of current dipoles produced by postsynaptic potentials, how these fields map onto EEG electrodes, and why this mapping makes it so difficult to accurately disentangle and localize sources 3.

Postsynaptic currents give rise to dipoles

We'll start by considering how neurons give rise to electrical fields. This assumes some basic knowledge of how neurons work (for a primer, see here).

Consider this pyramidal neuron 4:

We know that postsynaptic potentials (PSPs) are generated in the apical dendrites of this neuron, and these potentials integrate over space and time, converging on the axon hillock, where they can generate action potentials.

Synapses in apical dendrites are predominantly excitatory; in rat somatosensory cortex, for instance, around 90% of synapses are glutamatergic 5. These synapses contain AMPA receptors and, when bound to glutamate, permit the influx of sodium ions (Na+). This decreases the net charge of the extracellular fluid around the synapse, creating a current sink.

The existence of a current sink outside the apical dendrites sets up an electrical circuit. Positive charge (or depolarization) is conducted intracellularly along the dendrites towards the soma, which increases the electrochemical gradient in the basal dendrites, causing the passive outflux of current via non-gated potassium (K+) leak channels 6. This creates a extracellular current source around the soma.

The distance between apical and basal synapses can vary, but ranges between 500 and 1200 𝜇m 7. This spatial separation between current source and sink means that the neuron can be modelled as an electric current dipole. This is advantageous, because this physical system is well characterized and allows us to estimate the electromagnetic field that is generated by an active pyramidal cell, without having to account for its full complexity.

In the above diagram, the generation of a current dipole by glutamatergic excitatory postsynaptic potentials is shown, relative to the same pyramidal neuron (a). A simplified equivalent circuit diagram is shown in (b), where \(E_{syn}\) is the voltage inserted by Na+ influx, \(R_{syn}\) is the synaptic resistance, \(R_i\) is the (axial) resistance of the intracellular fluid, \(R_m\) is the membrane resistance in the soma and basal dendrites to passive K+ leak current, and \(R_e\) is the resistance of the extracellular fluid. The current dipole itself is depicted in (c).

Some physics: the current dipole

An electric current dipole can be conceptualized as finite length of "wire" conducting current 8. The displacement vector \(\mathbf{d}\) from the negative to positive end of this wire (representing current sink and source, respectively; see c above), with a magnitude multiplied by that of the current \(I\), is called the current dipole moment 9, \(\mathbf{p}\).

As an equation:

$$ \mathbf{p} = I\mathbf{d} $$

The field potential corresponding to a current dipole moment at a position \(\mathbf{r}\) is given by:

$$ V(\mathbf{p},\mathbf{r}) = \frac{1}{4\pi\sigma} \frac{\mathbf{p} \cdot \mathbf{\hat{r}}}{r^2} $$

where \(r\) is the distance given by \(|\mathbf{r}|\), \(\mathbf{\hat{r}}\) is the unit vector given by \(\mathbf{r}/r\), and \(\sigma\) is the conductivity of the (homogeneous) medium 10.

Here is a 2D visualization of what this potential looks like across the electrical field:

The figure is interactive: you can adjust the angle of the dipole \(\theta\), its length \(|\mathbf{d}|\), and the current \(I\).

A few observations are pertinent:

  • The potential is not just a function of distance to the sample point, but also the direction of the dipole moment relative to it.
  • The field is divided into two equivalent halves: one inducing negative potentials (blue) and one inducing positive (red).
  • Both the displacement of the poles \(|\mathbf{d}|\) and the magnitude of the current \(I\) scale linearly with the field potential \(V\).

Some more physics: multiple dipoles

A given volume of cortical tissue is comprised of many, many pyramidal neurons, each of which can be modelled as a distinct electric dipole. Conveniently, due to the superposition principle and Gauss's law, to get the potential resulting from \(n\) distinct dipoles at some position \(\mathbf{r}\), we can simply add them:

$$ \begin{align} V(\mathbf{P},\mathbf{r}) &= \sum^{n}_{i=1}{V(\mathbf{p}_i,\mathbf{r})} \\ &= \sum^{n}_{i=1} {\frac{1}{4\pi\sigma} \frac{\mathbf{p}_i \cdot \mathbf{\hat{r}}}{{r}^2}} \\ &= \frac{1}{4\pi\sigma r^2} \sum^{n}_{i=1}{\mathbf{p}_i \cdot \mathbf{\hat{r}}} \end{align} $$

where \(\mathbf{P}\) is a set of \(n\) dipoles 11.

Below is the same interactive figure with a second dipole included.

Here, the \(\Delta\theta\) slider controls the angular offset of \(\mathbf{d}_2\) from \(\mathbf{d}_1\). The point \(\mathbf{r}\) can be dragged to any position, and the plot below the field diagram tracks the field potential \(V(\mathbf{p},\mathbf{r})\) at that position as \(\Delta\theta\) is swept across its full range; the dashed vertical line marks where \(\mathbf{d}_2\) currently sits along that sweep.

Importantly, this demonstrates that coherently oriented dipoles maximize the (absolute magnitude of the) field potential, while deviations from coherence reduce it. Plotting the field potential \(V(\mathbf{p},\mathbf{r})\) versus the angle \(\Delta\theta\) between \(\mathbf{d}_1\) and \(\mathbf{d}_2\), for the position \(\mathbf{r}\) shown above (by default, along the axis formed by \(\mathbf{d}_1\)), shows this relationship 12.

Note that, no matter where you place \(\mathbf{r}\), the field potential will always be 0 at \(\Delta\theta=\pi\). This can also be shown directly from the equations above. Suppose we have two dipole moment vectors \(\mathbf{p}_1\) and \(\mathbf{p}_2\), having identical dendritic currents \(I\), and direction vectors \(\mathbf{d}_1\) and \(\mathbf{d}_2\), respectively. If we set \(\mathbf{d}_2=-\mathbf{d}_1\), we have two dipoles that are equal in magnitude and position, but opposite in direction (\(\Delta\theta=\pi\)).

From the equations above, if we set \(c=\frac{1}{4\pi\sigma r^2}\) we have:

$$ \begin{align} V(\mathbf{P}) &= V(\mathbf{p}_1) + V(\mathbf{p}_2) \\ &= c (\mathbf{p}_1 + \mathbf{p}_2) \cdot \mathbf{\hat{r}} \\ &= cI (\mathbf{d}_1 - \mathbf{d}_1) \cdot \mathbf{\hat{r}} \\ &= cI (\mathbf{0}) \cdot \mathbf{\hat{r}} \\ &= 0 \end{align} $$

for any position \(\mathbf{r}\). Note that \(\mathbf{0}\) denotes the null vector \([0,0,0]\), and the dot product of any vector with the null vector is zero. This shows that, for any point in the field, these two vectors completely cancel each other out.

The importance of this for the scalp EEG signal will be explored further below.

The scalp potential

The field potential generated by a single neuron at the position of a scalp electrode is fairly negligible, relative to ambient electromagnetic noise at that sensor (the so-called noise floor). In order to amplify the signal, it is critical that these neurons are oriented coherently; otherwise, their dipoles will cancel each other out.

Fortuitously, the cortex is comprised of smooth gyri whose tissue is laminated and whose principal neurons are oriented radially along them. This can be seen in Brodmann's original histological sections (areas 4 and 6) 13:

More schematically:

Here, I'm depicting an EEG electrode situated at position \(\mathbf{r}\) on scalp tissue, with periosteum, skull, and dura mater underlying it. Below that (not to scale) is the cortical sheet, with two gyral crests and a sulcus. Each \(i\)th pyramidal cell populating the cortical sheet is colour-mapped by the approximate contribution \(\mathbf{p}_i\) it makes (positive or negative) to the electric field \(V\) at the electrode 14.

The neocortex is characterized by this sulcal/gyral morphology, meaning that only in some places (gyral crests near the skull) do we see coherent organization of principal neurons that are oriented towards the scalp electrode. Within sulci, however, we often see that the cortical sheet is perpendicular or even oriented away from this electrode. The dipoles generated in these parts of cortex will produce a field that is minimal at the overlying electrode and maximal at other parts of the scalp, often at such a distance that their signal is lost.

The mapping from sensor to source is by no means trivial. As seen in the above illustration, signal at this electrode also includes contributions (red) from the neighbouring gyral crest and the innermost part of the sulcus. Other parts of the sulcus give rise to destructive interference (blue). On the other hand, where gyral crests do lie directly beneath electrodes, the constructive interference of coherently oriented neurons along this crest are likely to give rise to a strong local signal in that electrode when they are activated.

The considerations above point to three main factors influencing the neural contribution to the EEG signal:

  • Spatial coherence of many neurons (magnitude of current \(I\))
  • Orientation of the dipole moment towards the electrode (displacement vector \(\mathbf{d}\))
  • Proximity to the electrode (relative position \(\mathbf{r}\))

Postsynaptic potentials, not spikes

Also evident from the above discussion is that PSPs generated in dendrites are what give rise to the current dipoles that are observed in the scalp potential. The traditional view is that action potentials do not contribute substantially to this signal 15. While they do produce large transmembrane currents, these are very brief (around 2 ms in duration compared to 10-20 ms for PSPs) and very focal, occurring at the axon hillock and along white matter tracts at nodes of Ranvier (whose spacing varies from 30 to 150 µm 16). The brevity of action potential currents means they have little time to synchronize over many neurons. The focality of the current means they produce very small dipoles (or even quadrupoles) whose fields are relatively local, i.e., decay at \(1/r^3\) rather than \(1/r^2\).

This is perhaps counterintuitive, because we tend to interpret EEG signals as indexing neuronal activity. What these theoretical considerations imply is that the scalp EEG reflects net input to neurons, rather than spikes. There will, of course, be a strong correlation between these, as PSPs integrate across dendrites to generate spikes, and spikes can induce PSPs both in neighbouring neurons and the same neuron, via backpropagation.

This causal relationship actually makes the theory difficult to test empirically. However, using realistic neuronal simulations, Brake & Khadra 17 demonstrate that the contribution of spikes to EEG signals is indeed negligible, although at higher gamma frequencies, they can generate detectable fluctuations in narrowband power. A separate simulation study, however, indicates that action potentials — and their longer-duration hyperpolarization periods — can indeed contribute up to 20% of the current dipole for a single layer 5 pyramidal neuron 18, lending nuance to what was once dogma 19.

Visualizing the 3D field potential induced by dipoles

You can get a more intuitive understanding of how dipoles generate electric fields using the interactive figure below (note, this is optimized for a desktop browser). This is a dipole whose field is projected onto a sphere centered on it.

Initially, there is only one dipole, called Dipole 1. You can use the slider to control its strength (length \(d\) times current \(I\)), and the mouse/trackpad/finger to rotate the view, depending on your device. More interestingly, if you hold Ctrl (on a desktop keyboard), you can manipulate the orientation (left button drag) and the position (right button drag) of the dipole.

There is a second dipole, but its strength is initally zero. Under Manipulate, select Dipole 2. Use the slider to increase its strength. Now you can also manipulate this second dipole.

Try to experiment with the following:

  • What happens to the field when the dipole is moved closer to the sphere?
  • What happens when it is rotated to be (1) radial to, and (2) tangential to the sphere?
  • What happens when the two dipoles are rotated to have the same orientation?
  • How about if they have opposite directions?

Volume conduction of the electric field

The electric field equations above depend on the assumption that current is conducted in an infinite medium with homogeneous conductivity \(\sigma\). This is not a realistic representation of the human head, which contains tissue volumes (neuropil, myelin, cerebrospinal fluid, meninges, skull, scalp) with variable conductivities 20. Below, you can see just how variable these are, both in comparison with each other and across many studies attempting to estimate them 21:

Notably, skull tissue has a much lower conductivity than the other tissue classes. The estimated "brain-to-skull conductivity ratio" (BSCR, shown at right) varies across an order of magnitude from about 18:1 to 215:1, with the median being 40:1. This is due to variability across estimation methods and in skull morphology both within an individual and across individuals. However, even when the skull is divided into its hard inner and outer bony parts and the interior spongiform marrow layer, estimates vary (particularly across the latter).

This variability of conductivity across tissue classes (regardless of the specific estimates used) complicates the estimation of dipole-generated field potentials at EEG electrodes. As we can see from the equation for a homogeneous medium:

$$ V(\mathbf{p},\mathbf{r}) = \frac{1}{4\pi\sigma} \frac{\mathbf{p} \cdot \mathbf{\hat{r}}}{r^2} $$

...increasing \(\sigma\) decreases the potential \(V\) 22.

The behaviour of a current dipole field across media is called volume conduction, and volume conduction models are necessary to realistically simulate EEG signals generated by dipole sources (the forward problem), as well as estimating the positions and currents of dipole sources generating observed EEG signals (the inverse problem, or source localization).

Solving both the forward and inverse problems of volume conduction is a topic for another day. However, we can get an intuitive understanding of how the size and conductivity of adjacent tissue compartments influence the scalp signal by modelling the system as a set of concentric spheres, centered on the dipole with moment \(p\). Each sphere represents a tissue boundary, with three tissue classes: brain (\(\sigma_{brain}=0.33\)), skull (\(\sigma_{skull}=0.0042\)), and scalp (\(\sigma_{scalp}=0.33\)).

This idealized system allows us to simplify things. We can represent the position \(\mathbf{r}\) relative to the dipole in spherical coordinates:

This allows us to specify a position \(\mathbf{r}\) in terms of polar angle \(\theta\) and azimuthal angle \(\varphi\). And, if we set the z-axis parallel to the dipole moment axis (green arrow above), the field potential \(V\) is actually constant across the range of \(\varphi\) for a given \(\theta\). You can use the interactive 3D dipole figure we played with earlier to ascertain this: with one dipole, centered on the sphere and oriented along the z-axis, the equipotential lines are parallel with the x-y plane. In other words, regardless of the angle \(\varphi\), the position \(\mathbf{r}\) will always lie on the uppermost circle in the above diagram.

This means that our potential field can be represented on the sphere using \(\theta\) and radius \(r\) alone. For an infinite homogeneous medium, this looks like:

$$ V(\mathbf{p},\mathbf{r}) = \frac{|\mathbf{p}| \cdot \cos\theta}{4\pi\sigma r^2} $$

Since \(|\mathbf{p}|=Id\), for a fixed dipole current 23 we can represent this relationship with a constant \(k=Id / 4\pi\sigma\):

$$ V = k \cdot \frac{\cos\theta}{r^2} $$

(dropping the function notation).

We need to consider a number of things when moving to multiple spheres 24.

Critically, because we have only one source of current in our model, we can say that the rest of the field potential, except at the boundaries, is smooth and contains no local extrema. More formally, it satisfies Laplace's equation:

$$ \nabla^2 V = 0 $$

This gives us a basis for estimating the field within each boundary.

Moving to multiple spheres representing tissue compartments, with each \(i\)th compartment having conductivity \(\sigma_i\), the field potential for compartment \(i\) is given by:

$$ V_i = \left( \alpha_i r + \frac{\beta_i}{r^2} \right) \cos\theta $$

where \(\alpha_i\) and \(\beta_i\) are coefficients that we need to determine. \(\beta_1\) (for the brain compartment containing the dipole) is equal to the constant \(k\) from the equation above. The \(\alpha_i\) term is new. Where \(\sigma_i\) differs from \(\sigma_{i+1}\) across a boundary, charge accumulates at the boundary, which induces a secondary field, superimposed on the primary dipole field.

We can solve for all \(\alpha_i\) and \(\beta_i\) by treating this system of equations as a boundary value problem. That is, we can use what we know about the dipole and boundaries between tissue compartments to set constraints that allow us to determine these values.

Firstly, at each boundary, \(V\) must be continuous across it. Secondly, the radial current density (current flowing across the boundary along the radius) \(\sigma \frac{\partial V}{\partial r}\) must also be continuous, because charge is conserved. Thirdly, at the outermost surface the scalp meets air, which does not conduct at all, so \(\sigma \frac{\partial V}{\partial r} = 0\) there.

The major lesson here is that you cannot estimate the field potential with multiple heterogeneous tissue compartments by simply plugging in their respective \(\sigma_i\) values. This is because the additional compartments alter the field on both sides of their boundaries. In other words, the boundary conditions above cannot be satisfied by the \(\beta_i\) terms alone; the \(\alpha_i\) terms are also required.

The figure below solves this system and plots \(V\) as a function of the distance \(r\) from the dipole, sampled along the dipole moment axis (the direction in which the potential is greatest). Note that the vertical axis is logarithmic, spanning more than two orders of magnitude, and that each compartment is shaded:

You can set the conductivity \(\sigma\) and the thickness of each compartment with the sliders. Use these to get a better appreciation for how these properties alter the field potential. For example:

  • Set all the \(\sigma_i\) values to the same value. This gives us the smooth dipole field we saw above.
  • Play with the skull conductivity: this property is both the most critical for determining scalp potential and one with the most uncertainty in the literature (see above).
  • What happens to the field potential on both sides of the skull compartment, when its \(\sigma\) value is changed?
  • Note what happens to the scalp potential when the skull thickness is changed. This emphasizes the importance of modelling skull morphology in source localization approaches.

Magnetoencephalography (MEG)

Every current produces a magnetic field. The relationship between the electric field \(\mathbf{E}\) and magnetic field \(\mathbf{B}\) produced by a current dipole \(\mathbf{p}=I\mathbf{d}\) is illustrated below:

This shows a number of things. Firstly, while \(\mathbf{E}\) lines project in-plane along the dipole, \(\mathbf{B}\) actually circles out-of-plane around its axis. The two fields are perpendicular to each other in this case. Secondly, the strength of \(\mathbf{B}\) is shown as the thickness of the lines. This is stronger towards the middle of the dipole, falls off with distance, and is zero along the axis itself.

Following from the Biot–Savart law, the equation for the magnetic field (in an infinite, homogeneous medium) looks a lot like the one for the electric field:

$$ \mathbf{B}(\mathbf{p},\mathbf{r}) = \frac{\mu_0}{4\pi}\,\frac{\mathbf{p}\times\mathbf{\hat{r}}}{r^2} $$

...compared to:

$$ V(\mathbf{p},\mathbf{r}) = \frac{1}{4\pi\sigma}\,\frac{\mathbf{p}\cdot\mathbf{\hat{r}}}{r^2} $$

The two differences are: (1) the dot-product is replaced by a cross-product, and (2) the conductivity \(\sigma\) is replaced by the magnetic constant \(\mu_0\).

The two equations reveal similar properties: both fall off as \(1/r^2\) and both show linear superposition, meaning the fields produced by multiple dipoles can be summed:

$$ \mathbf{B}(\mathbf{P},\mathbf{r}) = \frac{\mu_0}{4\pi r^2}\left(\sum_{i=1}^{n}\mathbf{p}_i\right)\times\mathbf{\hat{r}} $$

The consequence of this is that, just like for the electric field, two opposing dipoles will cancel each other out; and therefore, the coherence of principal neurons is important in order to amplify the signal such that it can be detected by magnetometers.

It is also notable that \(\mathbf{B}\) is shown here as a vector, while \(V\) is a scalar. This reflects how these properties are measured: potential \(V\) (measured in volts) is a scalar quantity measured with respect to some reference, regardless of the \(\mathbf{E}\)-field orientation, while magnetic flux density \(\mathbf{B}\) (measured in tesla) is recorded relative to the orientation of the magnetometer.

We can represent the magnetic field using spherical coordinates, just as for the electric field. Recall that:

$$ V = \frac{1}{4\pi\sigma r^2} \cdot |\mathbf{p}| \cdot \cos\theta $$

For the magnetic field, this relationship looks like:

$$ |\mathbf{B}| = \frac{\mu_0}{4\pi r^2} \cdot |\mathbf{p}| \cdot \sin\theta $$

where \(|\mathbf{B}|\) is the magnitude of the field vector at position \(\mathbf{r}\).

This shows that the two fields are exactly complementary; or in other words, they are rotated by \(\pi/2\) relative to each other. As a consequence, where the potential field is strongest along the dipole axis, the magnetic field is zero along this axis, and vice versa. This is best observed interactively:

The added colour plot shows \(\mathbf{B}_z\), i.e., its (signed) z-component, since the field crosses the plane at \(\pi/2\) (refer to the circular field lines in the previous figure). This is negative (blue) where the lines go down into the plane, and positive (red) when they come up out of it. The line plot shows both variables across the range of angular offsets between the two dipole vectors.

In terms of brain activity, this implies that EEG records complementary information to MEG. Whereas EEG senses signals most strongly from coherently oriented neurons in gyral crests (and sometimes the bottom of sulci), MEG senses most effectively from neurons oriented parallel to the scalp, such as inside sulcal walls 25 26.

Finally, the lack of \(\sigma\) in the equation for magnetic field strength above indicates that it is unaffected by tissue conductivities, and thus volume conduction. This is true of an infinite homogeneous (and non-magnetic) medium, but not so of real brain tissue, where volume conduction also adds a component to the \(\mathbf{B}\) field. Nonetheless, MEG signals are not largely influenced by intervening tissue, making the task of source localization a bit easier.

Final notes

That's a lot to sift through. And we've only scratched the surface. As mentioned, a more thorough discussion of volume conduction (the forward model) and source localization (the inverse model) will have to wait for a future blog post.

We also haven't touched at all upon how M/EEG data are analyzed, including event-related potentials and spectral analysis. Stay tuned for further posts on these topics.

For further reading on the biophysics of M/EEG, here are good some starting points:

  • Bioelectromagnetism. Jaakko Malmivuo & Robert Plonsey. This is a free, comprehensive e-book on the biophysics underlying electromagnetic fields generated by biological tissue.
  • Brain Signals: EEG & MEG. Nihan Alp, Neuromatch Video Series. A presentation-style overview of EEG and MEG signals and their analysis.
  • Learning EEG: Physiology and Terminology. A tutorial-style website, with test questions, teaching the fundamentals of EEG.

  1. Berger H et al. (1929). Über das Elektrenkephalogramm des Menschen. Arch Psychiatr Nervenkrankh. 87(1). doi: 10.1007/BF01797193 ↩︎

  2. Mushtaq F et al. (2024). One hundred years of EEG for brain and behaviour research. Nat Hum Behav. 8(8). doi: 10.1038/s41562-024-01941-5 ↩︎

  3. A disclaimer of sorts: I experimented here for the first time with Claude Code, as a means of generating the interactive Javascript plots at 10x the rate I would have taken to produce them. Claude AI (Opus 5) was also extremely helpful in talking through some of the physics concepts. ↩︎

  4. This is a layer 2/3 pyramidal neuron, vectorized and simplified from this review paper. ↩︎

  5. Santuy A et al. (2017). Volume electron microscopy of the distribution of synapses in the neuropil of the juvenile rat somatosensory cortex. Brain Struct Funct. 223(1). doi: 10.1007/s00429-017-1470-7 ↩︎

  6. Enyedi P & Czirják G (2010). Molecular Background of Leak K + Currents: Two-Pore Domain Potassium Channels. Physiol Rev. 90(2). doi: 10.1152/physrev.00029.2009 ↩︎

  7. Spruston N et al. (2008). Pyramidal neurons: dendritic structure and synaptic integration. Nat Rev Neurosci. 9(3). doi: 10.1038/nrn2286 ↩︎

  8. See this explanation. ↩︎

  9. Ness T et al. (2020). Computing extracellular electric potentials from neuronal simulations. arXiv. doi: 10.48550/arXiv.2006.16630 ↩︎

  10. There are a number of assumptions required for this relationship to hold true; most importantly, the dipole separation, \(d\), is assumed to be substantially smaller than the distance between the dipole and sample point, \(r\). In the ideal case, the distance \(d\) is considered to be infinitesimal (limit as \(d \rightarrow 0\)). See this Wikipedia entry for details. Another important assumption, for the simple electric fields discussed here, is that the medium in which they are embedded has homogeneous conductivity (σ); see this rather technical explanation. As discussed later in the blog post, this is decidedly not the case for the human head. ↩︎

  11. This formulation assumes the dipoles are all coincident, allowing \({\mathbf{\hat{r}}}\) and \(r\) to be treated as constant across \(i\). This is fine if the distance \(r\) is sufficiently greater than the size of the patch containing the dipoles. Otherwise, the sum should include the dipole position \(\mathbf{s}_i\), such that \(r_i := |\mathbf{r}-\mathbf{s}_i|\) and \({\mathbf{\hat{r}}_i} := (\mathbf{r}-\mathbf{s}_i)/r_i\) ↩︎

  12. Note, the field potential units here are not so meaningful; they could be any range depending on the magnitude of the dipole and the spatial scale. Single neurons produce fields that are more likely on the scale of microvolts ↩︎

  13. Zilles K et al. (2004). Architecture of the Human Cerebral Cortex. Hum Nerv Syst. doi: 10.1016/B978-012547626-3/50028-4 ↩︎

  14. Again, I am wilfully ignoring the drastic effects that skull and scalp tissue have on volume conduction, which attenuate and smear the electric field. This will be the topic of a future blog post on volume conduction. ↩︎

  15. Buzsáki G et al. (2012). The origin of extracellular fields and currents — EEG, ECoG, LFP and spikes. Nat Rev Neurosci. 13(6). doi: 10.1038/nrn3241 ↩︎

  16. Arancibia-Cárcamo I et al. (2017). Node of Ranvier length as a potential regulator of myelinated axon conduction speed. eLife. 6. doi: 10.7554/eLife.23329 ↩︎

  17. Brake N & Khadra A (2025). Contributions of action potentials to scalp EEG: Theory and biophysical simulations. PLOS Comput Biol. 21(2). doi: 10.1371/journal.pcbi.1012794 ↩︎

  18. Thio B & Grill W (2023). Relative contributions of different neural sources to the EEG. NeuroImage. 275. doi: 10.1016/j.neuroimage.2023.120179 ↩︎

  19. A more in-depth discussion of this topic is beyond the scope of this blog post, but check out the references for further details. ↩︎

  20. Mccann H et al. (2019). Variation in Reported Human Head Tissue Electrical Conductivity Values. Brain Topogr. 32(5). doi: 10.1007/s10548-019-00710-2 ↩︎

  21. This is Figure 2 from McCann et al. (2019), reproduced without modification under the CC BY 4.0 license. ↩︎

  22. This may seem counterintuitive, at least it was for me. Why should decreasing the conductivity increase the voltage? This follows from Ohm's law: \(V=IR\), where resistance \(R\) is the inverse of conductance (how well an object with a particular shape and conductivity conducts a current). If we consider \(I\) to be constant, the voltage \(V\) required to produce that current needs to be higher if the resistance is higher. We can consider \(I\) to be constant because, from the dipole diagram above, the resistance \(R_{e}\) of extracellular tissue is orders of magnitude lower than the combined resistances \(R_{syn}\), \(R_{i}\), and \(R_{m}\). Since \(I=E_{syn}/(R_{syn}+R_i+R_m+R_e)\), we can drop the \(R_e\) term and consider \(I\) to be constant. This applies everywhere in the field. ↩︎

  23. We assume a constant \(I\) because the timescale for the capacitance of neural tissue is much faster than that at which neuronal currents are generated. This means that we can consider the system to be quasistatic. ↩︎

  24. Details on this three-sphere model can be found in the original work by Rush & Driscoll (1969). Note, there is a slight discrepency with the current model in that these authors center the sphere on the head rather than a dipole, but the main derivations can be found here. ↩︎

  25. Hillebrand A & Barnes G (2002). A Quantitative Assessment of the Sensitivity of Whole-Head MEG to Activity in the Adult Human Cortex. NeuroImage. 16(3). doi: 10.1006/nimg.2002.1102 ↩︎

  26. Hämäläinen M et al. (1993). Magnetoencephalography—theory, instrumentation, and applications to noninvasive studies of the working human brain. Rev Mod Phys. 65(2). doi: 10.1103/RevModPhys.65.413 ↩︎

Comments here
This is a teaching-oriented post about the fundamental concepts underlying electroencephalography (EEG), and to some extent magnetoencephalography (MEG). I explore how electromagnetic fields are generated from neuronal current dipoles, and how the orientation and spatial coherence of these dipoles is critical for detecting brain activity with scalp electrodes or magnetometers. I also introduce the concept of volume conduction, and consider how the distribution of electric currents across multiple tissue types might be simulated — and how cortical morphology complicates efforts to localize M/EEG sources in the human brain.
Tags:EEG · MEG · Neuroscience · Physiology · Biophysics · Teaching
EEG,MEG,neuroscience,physiology,biophysics,Teaching
Causal discovery: An introduction
Published on 2024-09-23
by Andrew Reid
#21
This post continues my exploration of causal inference, focusing on the type of problem an empirical researcher is most familiar with: where the underlying causal model is not known. In this case, the model must be discovered. I use some Python code to introduce the PC algorithm, one of the original and most popular approaches to causal discovery. I also discuss its assumptions and limitations, and briefly outline some more recent approaches. This is part of a line of teaching-oriented posts aimed at explaining fundamental concepts in statistics, neuroscience, and psychology.
Tags:Stats · Causality · Causal inference · Causal discovery · Graph theory · Teaching
stats,causality,causal inference,causal discovery,graph theory,Teaching
Causal inference: An introduction
Published on 2023-07-17
by Andrew Reid
#20
Hammer about to hit a nail, representing a causal event.
In this post, I attempt (as a non-expert enthusiast) to provide a gentle introduction to the central concepts underlying causal inference. What is causal inference and why do we need it? How can we represent our causal reasoning in graphical form, and how does this enable us to apply graph theory to simplify our calculations? How do we deal with unobserved confounders? This is part of a line of teaching-oriented posts aimed at explaining fundamental concepts in statistics, neuroscience, and psychology.
Tags:Stats · Causality · Causal inference · Graph theory · Teaching
stats,causality,causal inference,graph theory,Teaching
Multiple linear regression: short videos
Published on 2022-08-10
by Andrew Reid
#19
In a previous series of posts, I discussed simple and multiple linear regression (MLR) approaches, with the aid of interactive 2D and 3D plots and a bit of math. In this post, I am sharing a series of short videos aimed at psychology undergraduates, each explaining different aspects of MLR in more detail. The goal of these videos (which formed part of my second-year undergraduate module) is to give a little more depth to fundamental concepts that many students struggle with. This is part of a line of teaching-oriented posts aimed at explaining fundamental concepts in statistics, neuroscience, and psychology.
Tags:Stats · Linear regression · Teaching
stats,linear regression,Teaching
Learning about multiple linear regression
Published on 2021-12-30
by Andrew Reid
#18
In this post, I explore multiple linear regression, generalizing from the simple two-variable case to three- and many-variable cases. This includes an interactive 3D plot of a regression plane and a discussion of statistical inference and overfitting. This is part of a line of teaching-oriented posts aimed at explaining fundamental concepts in statistics, neuroscience, and psychology.
Tags:Stats · Linear regression · Teaching
stats,linear regression,Teaching
Learning about fMRI analysis
Published on 2021-06-24
by Andrew Reid
#17
In this post, I focus on the logic underlying statistical inference based on fMRI research designs. This consists of (1) modelling the hemodynamic response; (2) "first-level" within-subject analysis of time series; (3) "second-level" population inferences drawn from a random sample of participants; and (4) dealing with familywise error. This is part of a line of teaching-oriented posts aimed at explaining fundamental concepts in statistics, neuroscience, and psychology.
Tags:Stats · FMRI · Hemodynamic response · Mixed-effects model · Random field theory · False discovery rate · Teaching
stats,fMRI,hemodynamic response,mixed-effects model,random field theory,false discovery rate,Teaching
Learning about simple linear regression
Published on 2021-03-25
by Andrew Reid
#16
In this post, I introduce the concept of simple linear regression, where we are evaluating the how well a linear model approximates a relationship between two variables of interest, and how to perform statistical inference on this model. This is part of a line of teaching-oriented posts aimed at explaining fundamental concepts in statistics, neuroscience, and psychology.
Tags:Stats · Linear regression · F distribution · Teaching
stats,linear regression,F distribution,Teaching
New preprint: Tract-specific statistics from diffusion MRI
Published on 2021-03-05
by Andrew Reid
#15
In our new preprint, we describe a novel methodology for (1) identifying the most probable "core" tract trajectory for two arbitrary brain regions, and (2) estimating tract-specific anisotropy (TSA) at all points along this trajectory. We describe the outcomes of regressing this TSA metric against participants' age and sex. Our hope is that this new method can serve as a complement to the popular TBSS approach, where researchers desire to investigate effects specific to a pre-established set of ROIs.
Tags:Diffusion-weighted imaging · Tractography · Connectivity · MRI · News
diffusion-weighted imaging,tractography,connectivity,MRI,News
Learning about correlation and partial correlation
Published on 2021-02-04
by Andrew Reid
#14
This is the first of a line of teaching-oriented posts aimed at explaining fundamental concepts in statistics, neuroscience, and psychology. In this post, I will try to provide an intuitive explanation of (1) the Pearson correlation coefficient, (2) confounding, and (3) how partial correlations can be used to address confounding.
Tags:Stats · Linear regression · Correlation · Partial correlation · Teaching
stats,linear regression,correlation,partial correlation,Teaching
Linear regression: dealing with skewed data
Published on 2020-11-17
by Andrew Reid
#13
One important caveat when working with large datasets is that you can almost always produce a statistically significant result when performing a null hypothesis test. This is why it is even more critical to evaluate the effect size than the p value in such an analysis. It is equally important to consider the distribution of your data, and its implications for statistical inference. In this blog post, I use simulated data in order to explore this caveat more intuitively, focusing on a pre-print article that was recently featured on BBC.
Tags:Linear regression · Correlation · Skewness · Stats
linear regression,correlation,skewness,Stats
Functional connectivity as a causal concept
Published on 2019-10-14
by Andrew Reid
#12
In neuroscience, the conversation around the term "functional connectivity" can be confusing, largely due to the implicit notion that associations can map directly onto physical connections. In our recent Nature Neuroscience perspective piece, we propose the redefinition of this term as a causal inference, in order to refocus the conversation around how we investigate brain connectivity, and interpret the results of such investigations.
Tags:Connectivity · FMRI · Causality · Neuroscience · Musings
connectivity,FMRI,causality,neuroscience,Musings
Functional connectivity? But...
Published on 2017-07-26
by Andrew Reid
#11
Functional connectivity is a term originally coined to describe statistical dependence relationships between time series. But should such a relationship really be called connectivity? Functional correlations can easily arise from networks in the complete absence of physical connectivity (i.e., the classical axon/synapse projection we know from neurobiology). In this post I elaborate on recent conversations I've had regarding the use of correlations or partial correlations to infer the presence of connections, and their use in constructing graphs for topological analyses.
Tags:Connectivity · FMRI · Graph theory · Partial correlation · Stats
connectivity,fMRI,graph theory,partial correlation,Stats
Driving the Locus Coeruleus: A Presentation to Mobify
Published on 2017-07-17
by Andrew Reid
#10
How do we know when to learn, and when not to? Recently I presented my work to Vancouver-based Mobify, including the use of a driving simulation task to answer this question. They put it up on YouTube, so I thought I'd share.
Tags:Norepinephrine · Pupillometry · Mobify · Learning · Driving simulation · News
norepinephrine,pupillometry,Mobify,learning,driving simulation,News
Limitless: A neuroscientist's film review
Published on 2017-03-29
by Andrew Reid
#9
In the movie Limitless, Bradley Cooper stars as a down-and-out writer who happens across a superdrug that miraculously heightens his cognitive abilities, including memory recall, creativity, language acquisition, and action planning. It apparently also makes his eyes glow with an unnerving and implausible intensity. In this blog entry, I explore this intriguing possibility from a neuroscientific perspective.
Tags:Cognition · Pharmaceuticals · Limitless · Memory · Hippocampus · Musings
cognition,pharmaceuticals,limitless,memory,hippocampus,Musings
The quest for the human connectome: a progress report
Published on 2016-10-29
by Andrew Reid
#8
The term "connectome" was introduced in a seminal 2005 PNAS article, as a sort of analogy to the genome. However, unlike genomics, the methods available to study human connectomics remain poorly defined and difficult to interpret. In particular, the use of diffusion-weighted imaging approaches to estimate physical connectivity is fraught with inherent limitations, which are often overlooked in the quest to publish "connectivity" findings. Here, I provide a brief commentary on these issues, and highlight a number of ways neuroscience can proceed in light of them.
Tags:Connectivity · Diffusion-weighted imaging · Probabilistic tractography · Tract tracing · Musings
connectivity,diffusion-weighted imaging,probabilistic tractography,tract tracing,Musings
New Article: Seed-based multimodal comparison of connectivity estimates
Published on 2016-06-24
by Andrew Reid
#7
Our article proposing a threshold-free method for comparing seed-based connectivity estimates was recently accepted to Brain Structure & Function. We compared two structural covariance approaches (cortical thickness and voxel-based morphometry), and two functional ones (resting-state functional MRI and meta-analytic connectivity mapping, or MACM).
Tags:Multimodal · Connectivity · Structural covariance · Resting state · MACM · News
multimodal,connectivity,structural covariance,resting state,MACM,News
Four New ANIMA Studies
Published on 2016-03-18
by Andrew Reid
#6
Announcing four new submissions to the ANIMA database, which brings us to 30 studies and counting. Check them out if you get the time!
Tags:ANIMA · Neuroscience · Meta-analysis · ALE · News
ANIMA,neuroscience,meta-analysis,ALE,News
Exaptation: how evolution recycles neural mechanisms
Published on 2016-02-27
by Andrew Reid
#5
Exaptation refers to the tendency across evolution to recycle existing mechanisms for new and more complex functions. By analogy, this is likely how episodic memory — and indeed many of our higher level neural processes — evolved from more basic functions such as spatial navigation. Here I explore these ideas in light of the current evidence.
Tags:Hippocampus · Memory · Navigation · Exaptation · Musings
hippocampus,memory,navigation,exaptation,Musings
The business of academic writing
Published on 2016-02-04
by Andrew Reid
#4
Publishers of scientific articles have been slow to adapt their business models to the rapid evolution of scientific communication — mostly because there is profit in dragging their feet. I explore the past, present, and future of this important issue.
Tags:Journals · Articles · Impact factor · Citations · Business · Musings
journals,articles,impact factor,citations,business,Musings
Reflections on multivariate analyses
Published on 2016-01-15
by Andrew Reid
#3
Machine learning approaches to neuroimaging analysis offer promising solutions to research questions in cognitive neuroscience. Here I reflect on recent interactions with the developers of the Nilearn project.
Tags:MVPA · Machine learning · Nilearn · Elastic net · Statistics · Stats
MVPA,machine learning,nilearn,elastic net,statistics,Stats
New ANIMA study: Hu et al. 2015
Published on 2016-01-11
by Andrew Reid
#2
Announcing a new submission to the ANIMA database: Hu et al., Neuroscience & Biobehavioral Reviews, 2015.
Tags:ANIMA · Neuroscience · Meta-analysis · ALE · Self · News
ANIMA,neuroscience,meta-analysis,ALE,self,News
Who Am I?
Published on 2016-01-10
by Andrew Reid
#1
Musings on who I am, where I came from, and where I'm going as a Neuroscientist.
Tags:Labels · Neuroscience · Cognition · Musings
labels,neuroscience,cognition,Musings