simpeg.maps.ComboMap.deriv#

ComboMap.deriv(m, v=None)[source]#

Derivative of the mapping with respect to the input parameters.

Any time that you create your own combination mapping, be sure to test that the derivative is correct.

Parameters:
m(nP) numpy.ndarray

A vector representing a set of model parameters

v(nP) numpy.ndarray

If not None, the method returns the derivative times the vector v

Returns:
scipy.sparse.csr_matrix

Derivative of the mapping with respect to the model parameters. If the input argument v is not None, the method returns the derivative times the vector v.

Notes

Let \(\mathbf{m}\) be a set of model parameters and let [\(\mathbf{f}_n,...,\mathbf{f}_1\)] be the list of SimPEG mappings joined to create a combination mapping. Recall that the list of mappings is ordered from last applied to first applied.

Where the combination mapping acting on the model parameters can be expressed as:

\[\mathbf{u}(\mathbf{m}) = f_n(f_{n-1}(\cdots f_1(f_0(\mathbf{m}))))\]

The deriv method returns the derivative of \(\mathbf{u}\) with respect to the model parameters. To do this, we use the chain rule, i.e.:

\[\frac{\partial \mathbf{u}}{\partial \mathbf{m}} = \frac{\partial \mathbf{f_n}}{\partial \mathbf{f_{n-1}}} \cdots \frac{\partial \mathbf{f_2}}{\partial \mathbf{f_{1}}} \frac{\partial \mathbf{f_1}}{\partial \mathbf{m}}\]