MCPcopy
hub / github.com/mne-tools/mne-python / gamma_map

Function gamma_map

mne/inverse_sparse/_gamma_map.py:181–341  ·  view source on GitHub ↗

Hierarchical Bayes (Gamma-MAP) sparse source localization method. Models each source time course using a zero-mean Gaussian prior with an unknown variance (gamma) parameter. During estimation, most gammas are driven to zero, resulting in a sparse source estimate, as in :footcite:`Wi

(
    evoked,
    forward,
    noise_cov,
    alpha,
    loose="auto",
    depth=0.8,
    xyz_same_gamma=True,
    maxit=10000,
    tol=1e-6,
    update_mode=1,
    gammas=None,
    pca=True,
    return_residual=False,
    return_as_dipoles=False,
    rank=None,
    pick_ori=None,
    verbose=None,
)

Source from the content-addressed store, hash-verified

179
180@verbose
181def gamma_map(
182 evoked,
183 forward,
184 noise_cov,
185 alpha,
186 loose="auto",
187 depth=0.8,
188 xyz_same_gamma=True,
189 maxit=10000,
190 tol=1e-6,
191 update_mode=1,
192 gammas=None,
193 pca=True,
194 return_residual=False,
195 return_as_dipoles=False,
196 rank=None,
197 pick_ori=None,
198 verbose=None,
199):
200 """Hierarchical Bayes (Gamma-MAP) sparse source localization method.
201
202 Models each source time course using a zero-mean Gaussian prior with an
203 unknown variance (gamma) parameter. During estimation, most gammas are
204 driven to zero, resulting in a sparse source estimate, as in
205 :footcite:`WipfEtAl2007` and :footcite:`WipfNagarajan2009`.
206
207 For fixed-orientation forward operators, a separate gamma is used for each
208 source time course, while for free-orientation forward operators, the same
209 gamma is used for the three source time courses at each source space point
210 (separate gammas can be used in this case by using xyz_same_gamma=False).
211
212 Parameters
213 ----------
214 evoked : instance of Evoked
215 Evoked data to invert.
216 forward : dict
217 Forward operator.
218 noise_cov : instance of Covariance
219 Noise covariance to compute whitener.
220 alpha : float
221 Regularization parameter (noise variance).
222 %(loose)s
223 %(depth)s
224 xyz_same_gamma : bool
225 Use same gamma for xyz current components at each source space point.
226 Recommended for free-orientation forward solutions.
227 maxit : int
228 Maximum number of iterations.
229 tol : float
230 Tolerance parameter for convergence.
231 update_mode : int
232 Update mode, 1: MacKay update (default), 2: Modified MacKay update.
233 gammas : array, shape=(n_sources,)
234 Initial values for posterior variances (gammas). If None, a
235 variance of 1.0 is used.
236 pca : bool
237 If True the rank of the data is reduced to the true dimension.
238 return_residual : bool

Callers 3

test_gamma_map_standardFunction · 0.90

Calls 12

_check_referenceFunction · 0.85
_prepare_gainFunction · 0.85
is_fixed_orientFunction · 0.85
_gamma_map_optFunction · 0.85
_compute_residualFunction · 0.85
_reshape_viewFunction · 0.85
_make_dipoles_sparseFunction · 0.85
_make_sparse_stcFunction · 0.85
_log_exp_varFunction · 0.85
infoMethod · 0.80
_check_oriFunction · 0.70

Tested by 2

test_gamma_map_standardFunction · 0.72