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

Function _compose_linear_fitting_data

mne/bem.py:751–762  ·  view source on GitHub ↗

Get the linear fitting data.

(mu, u)

Source from the content-addressed store, hash-verified

749
750
751def _compose_linear_fitting_data(mu, u):
752 """Get the linear fitting data."""
753 k1 = np.arange(1, u["nterms"])
754 mu1ns = mu[0] ** k1
755 # data to be fitted
756 y = u["w"][:-1] * (u["fn"][1:] - mu1ns * u["fn"][0])
757 # model matrix
758 M = u["w"][:-1, np.newaxis] * (mu[1:] ** k1[:, np.newaxis] - mu1ns[:, np.newaxis])
759 uu, sing, vv = _safe_svd(M, full_matrices=False)
760 ncomp = u["nfit"] - 1
761 uu, sing, vv = uu[:, :ncomp], sing[:ncomp], vv[:ncomp]
762 return y, uu, sing, vv
763
764
765def _compute_linear_parameters(mu, u):

Callers 2

_one_stepFunction · 0.85

Calls 1

_safe_svdFunction · 0.85

Tested by

no test coverage detected