chaosmagpy.model_utils.sensitivity

chaosmagpy.model_utils.sensitivity(coeffs, coeffs_true)[source]

Sensitivity (degree normalized error) of the input coefficients with respect to the target/true coefficients.

Parameters:
coeffs: ndarray, shape (N,)

Input spherical harmonic coefficients.

coeffs_true: ndarray, shape (N,)

Target/true spherical harmonic coefficients.

Returns:
S: ndarray, shape (N,)

Sensitivity of coeffs with respect to coeffs_true.

Examples

>>> import chaosmagpy as cp
>>> import numpy as np
>>> coeffs = np.array([1., 2., 5.])  # estimated degree 1 coefficients
>>> coeffs_true = np.array([1., 2., 3.])  # target degree 1 coefficients
>>> cp.model_utils.sensitivity(coeffs, coeffs_true)
array([0., 0., 0.63245553])