simpeg.electromagnetics.natural_source.Simulation2DElectricField.getJtJdiag#

Simulation2DElectricField.getJtJdiag(m, W=None, f=None)[source]#

Return the diagonal of \(\mathbf{J^T J}\).

Where \(\mathbf{d}\) are the data and \(\mathbf{m}\) are the model parameters, the sensitivity matrix \(\mathbf{J}\) is defined as:

\[\mathbf{J} = \dfrac{\partial \mathbf{d}}{\partial \mathbf{m}}\]

This method returns the diagonals of \(\mathbf{J^T J}\). When the W input argument is used to include a diagonal weighting matrix \(\mathbf{W}\), this method returns the diagonal of \(\mathbf{W^T J^T J W}\).

Parameters:
m(n_param,) numpy.ndarray

The model parameters.

W(n_param, n_param) scipy.sparse.csr_matrix

A diagonal weighting matrix.

ffrequency_domain.fields.FieldsFDEM, optional

Fields solved for all sources.

Returns:
(n_param,) numpy.ndarray

The diagonals.