Abstract
Magneto-encephalography (
Introduction
Magneto-encephalography (

The upper plots show the topography of four idealized dipoles with different locations and/or orientations. These correspond to active neuronal sources in the motor cortex (panels a and b) and the visual cortex (panels c and d), which are located in the parietal and occipital lobes respectively. The middle left hand plot gives a further synthetic example with the sensors activated by the two halves of the dipole indicated as dark and light points. The temporal oscillations observed at these sensors are displayed in the middle right hand plot. The lower plots show real single-trial data during the pre-stimulus period, with the topography (left, at a single time snapshot) and quasi-periodic temporal oscillation (right) of a dipole.
However, the isolation of particular features such as frequency may lose valuable information in its simplification of a complex spatiotemporal pattern, and the use of averaging also risks the danger of blurring the within-trial variation of spatial features. In contrast, there is particular interest in the alertness status which the brain retains when it is attending to visual stimuli, as described by Van Dijk et al. (2008) and Thut et al. (2006) and a number of studies, such as those described by Liu and Ioannides (1996) and Mustaffa et al. (2010), have provided evidence that variations in the state of the brain at stimulus presentation may influence some of the signal components of the response. In other words, some of the variation across trials in the
A focus on single trial data introduces several issues. The first is the substantial noise inherent in single replicates. Smoothing techniques can ameliorate this, as discussed by Ventrucci et al. (2011). A second issue is that inspection of single trial data suggests that, while the spatial location of a dipole is likely to be reasonably constant for each trial, there is clear evidence of changes in dipole frequency over time. This may be indicative of changes in brain activity which are of interest and a model which can accommodate changes of this type is therefore necessary. This is illustrated on real data (described in Section 2) in the lower panels of Figure 1. The spatial characteristics of a dipole are evident in the lower left panel and its oscillations tracked in the lower right panel. From the latter plot, it is clear that the description of dipole behaviour over time needs to allow quasi-periodic rather than strictly periodic patterns. A third issue is that modelling at the single trial level then allows variability across trials to be investigated. Insights of this type are not available from standard methods of averaging based on an assumption of stationarity.
These considerations require a model for the occurrence of dipoles over the pre-stimulus period at the single trial level. The
The purpose of the experiment discussed here was to study information transfer from visual to motor areas and to investigate to what extent reaction time is determined by the brain state prior to stimulus presentation. A stimulus in the form of a light appearing on a screen was used to prompt activation in the visual cortex of the brain.
Nineteen participants were asked to focus on a fixation cross presented in the centre of the screen. An arrowhead pointing to the left or right was added to the fixation cross and participants could be asked to respond with either a left or right index finger button-press, giving a combination of four experimental conditions. Perception of the light stimulus is associated with activation of the visual cortex while finger movement is associated with activation of the motor cortex. As is common in this type of experimental protocol, around one hundred replicates (or trials) were undertaken for each experimental condition. The order of presentation of the experimental conditions was randomized across the full sequence of trials in order to avoid bias due to learning effects.
In a single trial of this experiment, the
Spatiotemporal smooth dipole model
When a neuronal source located inside the brain is active we expect
When a dipole is present, the mean brain map m(x, y, t) over spatial locations x, y and time t can be described as the sum of two spatiotemporal smooth functions, one for each pole. Under the reasonable assumption that the location and orientation of the dipole is fixed for a particular trial, this can be structured as:
where the smooth functions
Figure 1 shows that idealized dipoles exhibit relatively simple, smooth shapes. Interest lies in the key characteristics of location, orientation and size and not in the very detailed features of the dipole topography. From this perspective, and supported by inspection of observed dipole patterns, a very simple but effective model for dipole topography is proposed by giving each pole the shape of a (scaled) bivariate normal density function:
with location determined by
The relationship between the two parts of the dipole can be expressed in polar co-ordinates by defining the individual locations as:
where (μx, μy) denotes the centre of the dipole, θ denotes its orientation and r denotes the separation distance of the two poles. This assumes that the two poles have the same shape and the same size h. In order to avoid excessive overlap and thereby maintain a suitable dipole pattern, r should not exceed 2h.
The general form of the dipole model in (3.1) modifies the fixed spatial patterns for the two poles, φ1 and φ2, by temporal weight functions γ1(t) and γ2(t). These are smooth functions of time which allow the size of each pole to vary and can therefore, in particular, characterize the oscillation of the dipole.
In practice, brain signals exhibit quasi-periodic rather than periodic oscillations, as illustrated in the real data displayed in Figure 1. Here, in order to display the underlying signal more clearly, the data have been smoothed in a similar manner to that described by Ventrucci et al. (2011), using 50 ‘effective degrees of freedom’ for space and 40 for time. The left hand plot shows a brain map with two sets of sensors highlighted, while the right hand plot shows the
The signals at each pole do not have constant frequency. The behaviour is therefore quasi-periodic rather than perfectly periodic.
The signals from the two poles are not out-of-phase for the whole timescale, as the phase shift changes with time. This is a common feature of dipoles which is due to their transient nature.
The amplitude of the oscillations changes over time, both within and between the two poles.
These features require a strong degree of flexibility in the temporal weight functions γ1 and γ2. In addition to accommodating these features within the model, the aim is to quantify effects such as changes in amplitude and phase, so that the trial-to-trial variation in the behaviour of dipoles can be identified and characterized.
Eilers (2010) proposed a model for the smooth complex logarithm of an observed signal which is assumed to be the composition of two smooth functions over time. This approach can be adapted to the dipole setting by expressing the weight functions as:
where α(t) denotes amplitude on a log scale and ϕ(t) denotes phase. There are two steps in avoiding identifiability issues in model (3.3). The first is to express the amplitude curves as exp(αi(t)), so that they capture the size of the quasi-periodic signal in absolute terms. The second is to use the time points at which the temporal weight functions pass through 0 (‘zero-crossings’) to provide the crucial information on the phase ϕi(t) of the quasi-periodic cycles, as discussed by Eilers (2010). The phase functions must also be non-decreasing. These issues will be revisited in the context of estimation, discussed in Section 4 below.
Finally, (3.3) is extended to the model:
by the introduction of a smooth intercept term di(t). This allows possible shifts in the mean level of the signal, due to artifacts and noise, to be tracked. The issues involved in estimating the intercept function and the other terms of the model are discussed in Section 4 below.
The process of model fitting is most easily approached in two stages. The first stage involves estimation of the two-dimensional spatial location, orientation and size of the dipole, as well as the temporal weight functions γ1 and γ2. The second stage uses
Estimation of the spatial parameters and temporal weights
The first stage involves estimation of the four spatial parameters defining the centre (μx, μy), orientation θ, radial size h and separation distance r, as well as the temporal weight functions γ1 and γ2, using the notation introduced in Section 3.1. Minimization of the sum-of-squares
If the
where
A simple linear model could be fitted to the data from each separate time point. However, the spatiotemporal model (4.1) allows the estimation of γ to be improved by exploiting the assumption of smooth evolution of the underlying dipole over time. A simple strategy is to add to the sum-of-squares function
Note that this makes the reasonable assumption of a common penalty parameter λ for each half of the dipole. The formation of
The choice of smoothing parameter λ is an important issue. It is more convenient to address this on the more interpretable scale of the ‘effective degrees of freedom’ (edf) of the smoothing operation. This is easily calculated as the trace of the hat matrix
The first stage of estimation can then be completed by minimizing the sum-of-squares from the penalized regression over the spatial parameters (μx, μy), θ, r and h. With non-linear optimization, starting values for the parameters can be very important. A very good preliminary estimate can be obtained by minimizing over discrete sets of parameter values which cover the full range of interest. Specifically, (μx, μy) ranged over a systematically placed subset of half of the sensor locations, θ over the values
Although the location and size of the dipole is of interest, there is particular value in characterizing dipole behaviour through the decomposition of the temporal weight function described in model (3.4), expressed in intercept δi(t), amplitude αi(t) and phase ϕi(t) curves over time. The quasi-periodic behaviour which dipoles exhibit requires flexible descriptions of each of these components and smoothing techniques such as p-splines, described by Eilers and Marx (1996) and many other authors, again provide suitable modelling tools. Specifically, a basis of regression functions is constructed from a set of overlapping B-spline functions, expressed in linear model form as
The intercepts
The starting point for estimation of the phase and amplitude curves, ai(t) and zi(t), is the intercept-adjusted pole signal
Here, the derivatives were estimated very effectively by simple differencing although the piecewise polynomial algebra of B-splines provide a relatively straightforward alternative, as discussed by Boor (1978).
In a similar manner, again following Eilers (2010), a parsimonious expression of amplitude information is available through the logarithm of the intercept-adjusted pole signal pi(t) at the time points which lie mid-way between the zero-crossings. If these vectors are denoted by
Since the estimates
For the degree of smoothing, 3 edf were used for the point-based representations of both phase and amplitude. For phase, an exactly periodic pattern corresponds to linear phase and so an edf of 2. With the α-band signal over 0.5 seconds, we expect around 10 zero-crossings and so we allow a small degree of flexibility beyond linear. The amplitude was also estimated with 3 edf. In both cases we are interested in identifying large-scale changes, not in tracking small scale movement. A sensitivity analysis offers reassurance on the suitability of these choices.
Note that it would in principle be feasible to refine the estimates of phase and amplitude by Gauss-Newton iteration within the non-linear model (3.4), following Eilers (2010). However, in the present setting, where estimation is based on smooth quantities
We have precise information about the nature of the dipole that we want to extract from noisy single trial pre-stimulus data of the experiment under study. The brain activity associated with visual attention (the brain awaiting for a visual stimulus) is a dipole, with a certain unknown location, oscillating over time at a frequency expected to be in the 8–12 Hz range, referred to as the α-band frequency. In the first stage of our model fitting procedure we need to choose a value for the edf which is appropriate to fit this sort of dipole. In Section 4 we argued the choice of 60 degrees of freedom seems reasonable for modelling smooth pole signals of an α-band dipole operating over an interval of half a second, corresponding to the pre-stimulus period. In order to investigate the effectiveness of this choice we conducted a simulation study and evaluated the mean squared error of estimation for both amplitude and frequency curves of an α-band dipole. Four scenarios were considered.
Scenario 1. A single α-band dipole is present, with topography as in panel α of Figure 1. The pole signals have constant amplitude and frequency over time.
Scenario 2: A single α-band dipole is present, with topography as in panel α Figure 1, but the pole signals have amplitudes and frequencies which increase over time.
Scenario 3: One dominant α-band dipole is present as described in Scenario 2, but another α-band dipole of lower amplitude is also present, with topography as in panel γ of Figure 1. The minor dipole has constant amplitude and frequency.
Scenario 4: One dominant α-dipole and one minor α-dipole are present, as described in Scenario 3, but in addition there is a trend in the mean over time, reflecting an artifact.

Simulation summary. The 1st column panels show the simulated pole signals in the four scenarios (Sc. 1: 4). For Sc. 3 and Sc. 4, the pole signals from a minor dipole with smaller amplitude are also shown. In Sc. 4 an artifact is present which cause the pole signals to have a non-constant trend in the mean. The 2nd column panels show one realization of each scenario: simulated data (grey lines) and estimated pole signals from the major dipole using edf = 60 in step 1 of the fitting procedure. The 3rd and 4th column panels show the mean squared error in estimating respectively the amplitude and the frequency of the dominant dipole, using a variety of degrees of freedom for smoothing.
These four scenarios present increasing challenges in estimating the phase and amplitude components of the dominant dipole. Scenarios 3 and 4 are the most challenging because of the presence of a minor dipole which may corrupt estimation of the temporal and spatial pattern of the dominant one. Even worse, the minor dipole oscillates in the same α-band frequency as the dominant one. However, this is a situation that can frequently be met in practice. In Figure 2, the panels in the first column display the true pole signals in each of the four scenarios as grey and black lines. The panels in the second columns show the noisy
Model (3.1) was fitted to each of 500 realizations from each scenario, using several choices of effective degrees of freedom, edf = {30, 45, 60, 75, 90}. Our modelling aim is to identify the dominant dipole source in the data, unaffected by any minor source. In Figure 2, the panels in the third and fourth columns show boxplots of the mean squared errors (MSE) in estimation of the amplitude and frequency curves of the dominant dipole, using a variety of edf values. The level of smoothing, expressed in edf, has a strong impact on amplitude estimation, while frequency estimation is relatively unaffected. For amplitude, in Scenario 3 where a minor dipole is present the use of 60 edf produces a performance which is markedly superior to other degrees of smoothing. This remains the best choice in Scenario 4, while it is close to optimal in Scenarios 2 and 3. For frequency, the results are much less affected by the edf value. These results therefore provide strong empirical evidence of the suitability of 60 edf for identifying the size and nature of the evolution of an α-band dipole. Smaller values of edf are less effective in tracking the temporal pattern while larger values are subject to greater variability and may be more strongly influenced by subsidiary dipoles. The use of 60 edf is seen to provide an effective and stable choice.
Simulation was also used to check the robustness of the choice of edf for the estimation of the intercept, amplitude and phase curves in the second stage of the fitting procedure. In particular, the choice of the degree of smoothness for the intercept curve

Simulation summary on the choice of the effective degrees of freedom for intercept phase and amplitude curves, focusing on scenario 4. Panels from left to right focus on edf = {5, 7, 9} for the smooth intercept
The dipole model and its associated fitting procedure were applied to the pre-stimulus data from the
Analysis of a single-trial
Results from a single trial are displayed in Figure 4. The spatial information in the top left hand panel has identified a dipole on the left side of the motor cortex. The estimates of γ1(t) and γ2(t) in the top right hand panel show the two parts of the dipole to be oscillating strongly out-of-phase, over the initial time period at least. The raw
The four lower panels show the functions derived from γ1(t), γ2(t) which characterize the temporal nature of the dipole. The estimates of the intercept and (log) amplitude curves which are displayed in the first two panels show effectively constant means for each pole and only minor differences in amplitude in the early part of the pre-stimulus period. The second two panels show the information on phase, together with the instantaneous frequency curves. These confirm that we are indeed examining information from the α-band 8–12 Hz range with the two halves of the dipole oscillating at the same rate until a small degree of divergence appears immediately before the stimulus is applied.
The physics of current flow determines that a genuine dipole is present when the two separate poles are completely out-of-phase and so the difference in phase provides the key information to assess this. More precisely, the quantity:
gives a curve which takes values over the interval [0, π] and which takes the value π when the two poles are exactly out-of-phase. With this particular trial, β(t) (not shown) lies close to π for the first 300ms and diminishes thereafter, giving a clear indication of the presence of a transient dipole, indicating the alert state of the brain while a visual stimulus is awaited. The peak of β(t) is identified by the vertical line in the top right panel of Figure 4.
Further work would allow standard errors to be computed for the curves which characterize the behaviour of a dipole, along the lines of the analysis described by Ventrucci et al. (2011). However, the focus of the present article is the variability across trials and so the estimates which have been derived are used to examine and describe the random variation at trial level.

Estimates constructed from single-trial data. The dipolar spatial pattern (a) is shown at the time when its out-of-phase oscillation peaks, indicated by the vertical line in (c). The location of the dipole corresponds to the middle of the short black line, which also indicates the dipole orientation, in the top left panel. The oscillation of the two poles of the dipole is displayed in panel (b), where the signals measured in the light and dark sensors highlighted in panel (a) are shown in corresponding light and dark colours. The dipole oscillation is clearly displayed in panel (c): dashed grey and black lines represent the fitted pole signals
When viewing the results of fitted models for a large number of trials, a more systematic and quantitative method of identifying the presence of a dipole is required. Two conditions must be satisfied, namely that the poles oscillate at the same frequency and that they are fully out-of-phase. A simple empirical rule might identify a dipole if
which decreases from 1 in a smooth manner as

The variability in spatial location (mid-point of each line) and orientation (with current flow perpendicular to each line) for repeated trials with three different subjects. The density of each line is determined by the strength of evidence over time for the presence of a dipole.
Figure 5 shows the spatial distribution of the dipoles detected in all the available trials for each of three subjects involved in the experiment. The lines connect the two poles of the dipole and their mid-points represent the estimated dipole locations. The density of each line is determined by the maximum of the weight function w(t) over time, so that lightly shaded lines indicate weaker evidence for the presence of a dipole. There is a striking dependence between the spatial location and orientation of the dipole in subjects 1 and 2. This is indicative of brain anatomy, as variation in the dipole location is constrained by the topography of the folds in brain tissue. The size of the spatial variation is similar across the subjects, although subject 3 shows a slightly more diffused pattern.

Functional data analysis of the average frequency of the pole signals. The shading indicates the strength of evidence for a dipole. Weighted average curves and their standard errors are superimposed.
Figure 6 plots the frequency information for each trial, averaged over the two parts of the dipole, denoted by

Variability of frequency within trials.
There is particular interest in the size of the variability in the frequency within each trial, and Figure 7 explores this by plotting the standard deviation over time of
Overall, these results demonstrate significant variability of frequency of brain oscillations within and between participants and they question the validity of the conventional averaging approach across trials and participants. Instead, it has been demonstrated that model-based analysis allows single-trial estimation of time-varying amplitude, phase and frequency and makes it possible to relate the trial-by-trial variation of these measures to trial-by-trial variations in behavioural performance, such as perceptual accuracy or reaction time.
Traditionally, oscillations in
The nature of the variation across trials and across individuals provides valuable insight which is not available from analysis based on averaged data. In addition to the direct interpretation about the nature of brain signals, this random variation also provides the building blocks from which random effect models involving the comparison of treatment groups, and more complex designs, may be constructed.
The simulation study showed that estimation of a dominant dipole is not adversely affected by the presence of other minor dipoles. However, there is interest in simultaneously identifying multiple dipoles, especially in the post-stimulus period when there may be multiple simultaneously activated brain areas of interest. In future work, this will be addressed by building in more explicit representations of the mapping from a dipole source at a three-dimensional position within the human brain to the corresponding spatial field pattern on the sensor surface. This mapping can be constructed by considering the underlying physics and it could be the basis of disambiguating contributions from different activated brain areas.
Footnotes
Acknowledgements
This research was funded by an EPSRC grant (reference EP/H024875/1) awarded under a Cross-Disciplinary Feasibility Account on ‘Computational Statistics and Cognitive Neuroscience’.
