[074d3d]: / doc / _includes / inverse.rst

Download this file

608 lines (446 with data), 26.2 kB

The minimum-norm current estimates

This section describes the mathematical details of the calculation of minimum-norm estimates. In Bayesian sense, the ensuing current distribution is the maximum a posteriori (MAP) estimate under the following assumptions:

  • The viable locations of the currents are constrained to the cortex. Optionally, the current orientations can be fixed to be normal to the cortical mantle.
  • The amplitudes of the currents have a Gaussian prior distribution with a known source covariance matrix.
  • The measured data contain additive noise with a Gaussian distribution with a known covariance matrix. The noise is not correlated over time.

Computing the inverse operator is accomplished using :func:`mne.minimum_norm.make_inverse_operator` and :func:`mne.minimum_norm.apply_inverse`. The use of these functions is presented in the tutorial :ref:`tut-inverse-methods`.

The linear inverse operator

The measured data in the source estimation procedure consists of MEG and EEG data, recorded on a total of N channels. The task is to estimate a total of Q strengths of sources located on the cortical mantle. If the number of source locations is P, Q = P for fixed-orientation sources and Q = 3P if the source orientations are unconstrained. The regularized linear inverse operator following from regularized maximal likelihood of the above probabilistic model is given by the Q×N matrix

M = RG(GRG + C) − 1 , 

where G is the gain matrix relating the source strengths to the measured MEG/EEG data, C is the data noise-covariance matrix and R is the source covariance matrix. The dimensions of these matrices are N×Q, N×N, and Q×Q, respectively. The Q×1 source-strength vector is obtained by multiplying the Q×1 data vector by Q.

The expected value of the current amplitudes at time t is then given by ĵ(t) = Mx(t), where x(t) is a vector containing the measured MEG and EEG data values at time t.

For computational convenience, the linear inverse operator is not computed explicitly. See :ref:`mne_solution` for mathematical details, and :ref:`CIHCFJEI` for a detailed example.

Regularization

The a priori variance of the currents is, in practice, unknown. We can express this by writing R’ = R ⁄ λ2 = Rλ − 2, which yields the inverse operator

M  = RG(GRG + C) − 1  = Rλ − 2G(GRλ − 2G + C) − 1  = Rλ − 2Gλ2(GRG + λ2C) − 1  = RG(GRG + λ2C) − 1 , 

where the unknown current amplitude is now interpreted in terms of the regularization parameter λ2. Larger λ2 values correspond to spatially smoother and weaker current amplitudes, whereas smaller λ2 values lead to the opposite.

We can arrive at the regularized linear inverse operator also by minimizing a cost function S with respect to the estimated current ĵ (given the measurement vector x at any given time t) as

minĵ{S}  = minĵ{ + λ2ĵR − 1ĵ}  = minĵ{(x − Gĵ)C − 1(x − Gĵ) + λ2ĵR − 1ĵ}

where the first term consists of the difference between the whitened measured data (see :ref:`whitening_and_scaling`) and those predicted by the model while the second term is a weighted-norm of the current estimate. It is seen that, with increasing λ2, the source term receive more weight and larger discrepancy between the measured and predicted data is tolerable.

Whitening and scaling

The MNE software employs data whitening so that a 'whitened' inverse operator assumes the form

 = MC1 ⁄ 2 = R(R + λ2I) − 1 , 

where

 = C − 1 ⁄ 2G

is the spatially whitened gain matrix. We arrive at the whitened inverse operator equation :eq:`inv_m_tilde` by making the substitution for G from :eq:`inv_g_tilde` in :eq:`inv_m` as

 = MC1 ⁄ 2  = RG(GRG + λ2C) − 1C1 ⁄ 2  = RC1 ⁄ 2(C1 ⁄ 2RC1 ⁄ 2 + λ2C) − 1C1 ⁄ 2  = RC1 ⁄ 2(C1 ⁄ 2(R + λ2I)C1 ⁄ 2) − 1C1 ⁄ 2  = RC1 ⁄ 2C − 1 ⁄ 2(R + λ2I) − 1C − 1 ⁄ 2C1 ⁄ 2  = R(R + λ2I) − 1 .

The expected current values are

ĵ(t)  = Mx(t)  = MC1 ⁄ 2C − 1 ⁄ 2x(t)  = (t)

knowing :eq:`inv_m_tilde` and taking

(t) = C − 1 ⁄ 2x(t)

as the whitened measurement vector at time t. The spatial whitening operator C − 1 ⁄ 2 is obtained with the help of the eigenvalue decomposition C = UCΛ2CUC as C − 1 ⁄ 2 = Λ − 1CUC. In the MNE software the noise-covariance matrix is stored as the one applying to raw data. To reflect the decrease of noise due to averaging, this matrix, C0, is scaled by the number of averages, L, i.e., C = C0 ⁄ L.

Note

When EEG data are included, the gain matrix G needs to be average referenced when computing the linear inverse operator M. This is incorporated during creating the spatial whitening operator C − 1 ⁄ 2, which includes any projectors on the data. EEG data average reference (using a projector) is mandatory for source modeling and is checked when calculating the inverse operator.

As shown above, regularization of the inverse solution is equivalent to a change in the variance of the current amplitudes in the Bayesian a priori distribution.

A convenient choice for the source-covariance matrix R is such that trace(R) ⁄ trace(I) = 1. With this choice we can approximate λ2 ∼ 1 ⁄ \rmSNR2, where SNR is the (amplitude) signal-to-noise ratio of the whitened data.

Note

The definition of the signal to noise-ratio/ λ2 relationship given above works nicely for the whitened forward solution. In the un-whitened case scaling with the trace ratio trace(GRG) ⁄ trace(C) does not make sense, since the diagonal elements summed have, in general, different units of measure. For example, the MEG data are expressed in T or T/m whereas the unit of EEG is Volts.

See :ref:`tut-compute-covariance` for example of noise covariance computation and whitening.

Regularization of the noise-covariance matrix

Since finite amount of data is usually available to compute an estimate of the noise-covariance matrix C, the smallest eigenvalues of its estimate are usually inaccurate and smaller than the true eigenvalues. Depending on the seriousness of this problem, the following quantities can be affected:

  • The model data predicted by the current estimate,
  • Estimates of signal-to-noise ratios, which lead to estimates of the required regularization, see :ref:`mne_regularization`,
  • The estimated current values, and
  • The noise-normalized estimates, see :ref:`noise_normalization`.

Fortunately, the latter two are least likely to be affected due to regularization of the estimates. However, in some cases especially the EEG part of the noise-covariance matrix estimate can be deficient, i.e., it may possess very small eigenvalues and thus regularization of the noise-covariance matrix is advisable.

Historically, the MNE software accomplishes the regularization by replacing a noise-covariance matrix estimate C with

C’ = C + kεkσk2I(k) , 

where the index k goes across the different channel groups (MEG planar gradiometers, MEG axial gradiometers and magnetometers, and EEG), εk are the corresponding regularization factors, σk are the average variances across the channel groups, and I(k) are diagonal matrices containing ones at the positions corresponding to the channels contained in each channel group.

See :ref:`plot_compute_covariance_howto` for details on computing and regularizing the channel covariance matrix.

Computation of the solution

The most straightforward approach to calculate the MNE is to employ the expression of the original or whitened inverse operator directly. However, for computational convenience we prefer to take another route, which employs the singular-value decomposition (SVD) of the matrix

A  = R1 ⁄ 2  = UΛV

where the superscript 1 ⁄ 2 indicates a square root of R. For a diagonal matrix, one simply takes the square root of R while in the more general case one can use the Cholesky factorization R = RCRC and thus R1 ⁄ 2 = RC.

Combining the SVD from :eq:`inv_a` with the inverse equation :eq:`inv_m` it is easy to show that

 = R(R + λ2I) − 1  = R1 ⁄ 2A(AA + λ2I) − 1  = R1 ⁄ 2VΛU(UΛVVΛU + λ2I) − 1  = R1 ⁄ 2VΛU(U2 + λ2I)U) − 1  = R1 ⁄ 2VΛUU2 + λ2I) − 1U  = R1 ⁄ 2VΛ(Λ2 + λ2I) − 1U  = R1 ⁄ 2VΓU

where the elements of the diagonal matrix Γ are simply

γk = (λk)/(λ2k + λ2) .

From our expected current equation :eq:`inv_j_hat_t` and our whitened measurement equation :eq:`inv_tilde_x_t`, if we take

w(t)  = U(t)  = UC − 1 ⁄ 2x(t) , 

we can see that the expression for the expected current is just

ĵ(t)  = R1 ⁄ 2VΓw(t)  = kvkγkwk(t) , 

where vk = R1 ⁄ 2vk, with vk being the k th column of V. It is thus seen that the current estimate is a weighted sum of the "weighted" eigenleads vk.

It is easy to see that w(t) ∝ (L). To maintain the relation (R) ⁄ trace(I) = 1 when L changes we must have R ∝ 1 ⁄ L. With this approach, λk is independent of L and, for fixed λ, we see directly that j(t) is independent of L.

The minimum-norm estimate is computed using this procedure in :func:`mne.minimum_norm.make_inverse_operator`, and its usage is illustrated in :ref:`CIHCFJEI`.

Noise normalization

Noise normalization serves three purposes:

  • It converts the expected current value into a dimensionless statistical test variable. Thus the resulting time and location dependent values are often referred to as dynamic statistical parameter maps (dSPM).
  • It reduces the location bias of the estimates. In particular, the tendency of the MNE to prefer superficial currents is eliminated.
  • The width of the point-spread function becomes less dependent on the source location on the cortical mantle. The point-spread is defined as the MNE resulting from the signals coming from a point current source (a current dipole) located at a certain point on the cortex.

In practice, noise normalization is implemented as a division by the square root of the estimated variance of each voxel. In computing these noise normalization factors, it's convenient to reuse our "weighted eigenleads" definition from equation :eq:`inv_j_hat_t` in matrix form as

V = R1 ⁄ 2V .

dSPM

Noise-normalized linear estimates introduced by Dale et al. :footcite:`DaleEtAl1999` require division of the expected current amplitude by its variance. In practice, this requires the computation of the diagonal elements of the following matrix, using SVD equation :eq:`inv_m_tilde` and :eq:`inv_eigenleads_weighted`:

MCM  = MC1 ⁄ 2C1 ⁄ 2M  =   = R1 ⁄ 2VΓUUΓVR1 ⁄ 2  = VΓ2V .

Because we only care about the diagonal entries here, we can find the variances for each source as

σ2k = γ2k

Under the conditions expressed at the end of :ref:`mne_solution`, it follows that the t-statistic values associated with fixed-orientation sources) are thus proportional to (L) while the F-statistic employed with free-orientation sources is proportional to L, correspondingly.

Note

The MNE software usually computes the square roots of the F-statistic to be displayed on the inflated cortical surfaces. These are also proportional to (L).

sLORETA

sLORETA :footcite:`Pascual-Marqui2002` estimates the current variances as the diagonal entries of the resolution matrix, which is the product of the inverse and forward operators. In other words, the diagonal entries of (using :eq:`inv_m_tilde_svd`, :eq:`inv_g_tilde`, and :eq:`inv_a`)

MG  = MC1 ⁄ 2C − 1 ⁄ 2G  =   = R1 ⁄ 2VΓUR1 ⁄ 2R − 1 ⁄ 2  = R1 ⁄ 2VΓUUΛVR − 1 ⁄ 2  = R1 ⁄ 2VΓUUΛVR1 ⁄ 2R − 1  = VΓUUΛVR − 1  = VΓΛVR − 1 .

Because R is diagonal and we only care about the diagonal entries, we can find our variance estimates as

σ2k  = γkλkR − 1k, k  = (λk)/((λ2k + λ2))(λk)/(1)(1)/(λ2)  = (λ2k)/((λ2k + λ2)λ2)  = (λ2k)/((λ2k + λ2)2)(λ2 + λ2k)/(λ2)  = (λk)/(λ2k + λ2)21 + (λ2k)/(λ2)  = γ2k1 + (λ2k)/(λ2) .

eLORETA

While dSPM and sLORETA solve for noise normalization weights σ2k that are applied to standard minimum-norm estimates ĵ(t), eLORETA :footcite:`Pascual-Marqui2011` instead solves for a source covariance matrix R that achieves zero localization bias. For fixed-orientation solutions the resulting matrix R will be a diagonal matrix, and for free-orientation solutions it will be a block-diagonal matrix with 3×3 blocks.

In :footcite:`Pascual-Marqui2011` eq. 2.13 states that the following system of equations can be used to find the weights, i ∈ 1, ..., P (note that here we represent the equations from that paper using our notation):

ri = [Gi(GRG + λ2C) − 1Gi] − 1 ⁄ 2

And an iterative algorithm can be used to find the values for the weights ri that satisfy these equations as:

  1. Initialize identity weights.
  2. Compute N = (GRG + λ2C) − 1.
  3. Holding N fixed, compute new weights ri = [GiNGi] − 1 ⁄ 2.
  4. Using new weights, go to step (2) until convergence.

In particular, for step (2) we can use our substitution from :eq:`inv_g_tilde` as:

N  = (GRG + λ2C) − 1  = (C1 ⁄ 2RC1 ⁄ 2 + λ2C) − 1  = (C1 ⁄ 2(R + λ2I)C1 ⁄ 2) − 1  = C − 1 ⁄ 2(R + λ2I) − 1C − 1 ⁄ 2  = C − 1 ⁄ 2(R + λ2I) − 1C − 1 ⁄ 2 .

Then defining Ñ as the whitened version of N, i.e., the regularized pseudoinverse of R, we can compute N as:

N  = C − 1 ⁄ 2(URΛRVR + λ2I) − 1C − 1 ⁄ 2  = C − 1 ⁄ 2(URR + λ2I)VR) − 1C − 1 ⁄ 2  = C − 1 ⁄ 2VRR + λ2I) − 1URC − 1 ⁄ 2  = C − 1 ⁄ 2ÑC − 1 ⁄ 2 .

In step (3) we left and right multiply with subsets of G, but making the substitution :eq:`inv_g_tilde` we see that we equivalently compute:

ri  = [GiNGi] − 1 ⁄ 2  = [(C1 ⁄ 2i)NC1 ⁄ 2i] − 1 ⁄ 2  = [iC1 ⁄ 2NC1 ⁄ 2i] − 1 ⁄ 2  = [iC1 ⁄ 2C − 1 ⁄ 2ÑC − 1 ⁄ 2C1 ⁄ 2i] − 1 ⁄ 2  = [iÑi] − 1 ⁄ 2 .

For convenience, we thus never need to compute N itself but can instead compute the whitened version Ñ.

Predicted data

Under noiseless conditions the SNR is infinite and thus leads to λ2 = 0 and the minimum-norm estimate explains the measured data perfectly. Under realistic conditions, however, λ2 > 0 and there is a misfit between measured data and those predicted by the MNE. Comparison of the predicted data, here denoted by x(t), and measured one can give valuable insight on the correctness of the regularization applied.

In the SVD approach we easily find

(t) = Gĵ(t) = C1 ⁄ 2UΠw(t) , 

where the diagonal matrix Π has elements πk = λkγk The predicted data is thus expressed as the weighted sum of the 'recolored eigenfields' in C1 ⁄ 2U.

Cortical patch statistics

If the add_dists=True option was used in source space creation, the source space file will contain Cortical Patch Statistics (CPS) for each vertex of the cortical surface. The CPS provide information about the source space point closest to it as well as the distance from the vertex to this source space point. The vertices for which a given source space point is the nearest one define the cortical patch associated with with the source space point. Once these data are available, it is straightforward to compute the following cortical patch statistics for each source location d:

  • The average over the normals of at the vertices in a patch, nd,
  • The areas of the patches, Ad, and
  • The average deviation of the vertex normals in a patch from their average, σd, given in degrees.

use_cps parameter in :func:`mne.convert_forward_solution`, and :func:`mne.minimum_norm.make_inverse_operator` controls whether to use cortical patch statistics (CPS) to define normal orientations or not (see :ref:`CHDBBCEJ`).

Orientation constraints

The principal sources of MEG and EEG signals are generally believed to be postsynaptic currents in the cortical pyramidal neurons. Since the net primary current associated with these microscopic events is oriented normal to the cortical mantle, it is reasonable to use the cortical normal orientation as a constraint in source estimation. In addition to allowing completely free source orientations, the MNE software implements three orientation constraints based of the surface normal data:

  • Source orientation can be rigidly fixed to the surface normal direction by specifying fixed=True in :func:`mne.minimum_norm.make_inverse_operator`. If cortical patch statistics are available the average normal over each patch, nd, are used to define the source orientation. Otherwise, the vertex normal at the source space location is employed.
  • A location independent or fixed loose orientation constraint (fLOC) can be employed by specifying fixed=False and loose=1.0 when calling :func:`mne.minimum_norm.make_inverse_operator` (see :ref:`plot_dipole_orientations_fLOC_orientations`). In this approach, a source coordinate system based on the local surface orientation at the source location is employed. By default, the three columns of the gain matrix G, associated with a given source location, are the fields of unit dipoles pointing to the directions of the x, y, and z axis of the coordinate system employed in the forward calculation (usually the :ref:`MEG head coordinate frame <head_device_coords>`). For LOC the orientation is changed so that the first two source components lie in the plane normal to the surface normal at the source location and the third component is aligned with it. Thereafter, the variance of the source components tangential to the cortical surface are reduced by a factor defined by the --loose option.
  • A variable loose orientation constraint (vLOC) can be employed by specifying fixed=False and loose parameters when calling :func:`mne.minimum_norm.make_inverse_operator` (see :ref:`plot_dipole_orientations_vLOC_orientations`). This is similar to fLOC except that the value given with the loose parameter will be multiplied by σd, defined above.

Depth weighting

The minimum-norm estimates have a bias towards superficial currents. This tendency can be alleviated by adjusting the source covariance matrix R to favor deeper source locations. In the depth weighting scheme employed in MNE analyze, the elements of R corresponding to the p th source location are be scaled by a factor

fp = (g1pg1p + g2pg2p + g3pg3p) − γ , 

where g1p, g2p, and g3p are the three columns of G corresponding to source location p and γ is the order of the depth weighting, which is specified via the depth option in :func:`mne.minimum_norm.make_inverse_operator`.

Effective number of averages

It is often the case that the epoch to be analyzed is a linear combination over conditions rather than one of the original averages computed. As stated above, the noise-covariance matrix computed is originally one corresponding to raw data. Therefore, it has to be scaled correctly to correspond to the actual or effective number of epochs in the condition to be analyzed. In general, we have

C = C0 ⁄ Leff

where Leff is the effective number of averages. To calculate Leff for an arbitrary linear combination of conditions

y(t) = ni = 1wixi(t)

we make use of the the fact that the noise-covariance matrix

Cy = ni = 1w2iCxi = C0ni = 1w2i ⁄ Li

which leads to

1 ⁄ Leff = ni = 1w2i ⁄ Li

An important special case of the above is a weighted average, where

wi = Li ⁄ ni = 1Li

and, therefore

Leff = ni = 1Li

Instead of a weighted average, one often computes a weighted sum, a simplest case being a difference or sum of two categories. For a difference w1 = 1 and w2 =  − 1 and thus

1 ⁄ Leff = 1 ⁄ L1 + 1 ⁄ L2

or

Leff = (L1L2)/(L1 + L2)

Interestingly, the same holds for a sum, where w1 = w2 = 1. Generalizing, for any combination of sums and differences, where wi = 1 or wi =  − 1, i = 1…n, we have

1 ⁄ Leff = ni = 11 ⁄ Li