src/estimagic/sensitivity/msm_sensitivity.py
def calculate_sensitivity_to_bias(jac, weights):
    """calculate the sensitivity to bias.

    The sensitivity measure is calculated for each parameter wrt each moment.

    It answers the following question: How strongly would the parameter estimates be
        biased if the kth moment was misspecified, i.e not zero in expectation?

    Args:
        jac (np.ndarray or pandas.DataFrame): The jacobian of simulate_moments with
            respect to params, evaluated at the  point estimates.
        weights (np.ndarray or pandas.DataFrame): The weighting matrix used for
            msm estimation.

    Returns:
        np.ndarray or pd.DataFrame: Sensitivity measure with shape (n_params, n_moments)

    """
    _jac, _weights, names = process_pandas_arguments(jac=jac, weights=weights)
    gwg = _sandwich(_jac, _weights)
    gwg_inverse = robust_inverse(gwg, INVALID_SENSITIVITY_MSG)
    m1 = -gwg_inverse @ _jac.T @ _weights

    if names:
        m1 = pd.DataFrame(m1, index=names.get("params"), columns=names.get("moments"))

    return m1
calculate the sensitivity to bias.

    The sensitivity measure is calculated for each parameter wrt each moment.

    It answers the following question: How strongly would the parameter estimates be
        biased if the kth moment was misspecified, i.e not zero in expectation?

    Args:
        jac (np.ndarray or pandas.DataFrame): The jacobian of simulate_moments with
            respect to params, evaluated at the  point estimates.
        weights (np.ndarray or pandas.DataFrame): The weighting matrix used for
            msm estimation.

    Returns:
        np.ndarray or pd.DataFrame: Sensitivity measure with shape (n_params, n_moments)

    
calculate the sensitivity to bias.
The sensitivity measure is calculated for each parameter wrt each moment.


calculate the sensitivity to bias . The sensitivity measure is calculated for each parameter wrt each moment .
def calculate_sensitivity_to_bias(jac, weights):
    _jac, _weights, names = process_pandas_arguments(jac=jac, weights=weights)
    gwg = _sandwich(_jac, _weights)
    gwg_inverse = robust_inverse(gwg, INVALID_SENSITIVITY_MSG)
    m1 = -gwg_inverse @ _jac.T @ _weights
    if names:
        m1 = pd.DataFrame(m1, index=names.get("params"), columns=names.get("moments"))
    return m1
def calculate_sensitivity_to_bias ( jac , weights ) : _jac , _weights , names = process_pandas_arguments ( jac = jac , weights = weights ) gwg = _sandwich ( _jac , _weights ) gwg_inverse = robust_inverse ( gwg , INVALID_SENSITIVITY_MSG ) m1 = - gwg_inverse @ _jac . T @ _weights if names : m1 = pd . DataFrame ( m1 , index = names . get ( "params" ) , columns = names . get ( "moments" ) ) return m1
calculate the sensitivity to bias.
calculate the sensitivity to bias .
"""calculate the sensitivity to bias.

    The sensitivity measure is calculated for each parameter wrt each moment.

    It answers the following question: How strongly would the parameter estimates be
        biased if the kth moment was misspecified, i.e not zero in expectation?

    Args:
        jac (np.ndarray or pandas.DataFrame): The jacobian of simulate_moments with
            respect to params, evaluated at the  point estimates.
        weights (np.ndarray or pandas.DataFrame): The weighting matrix used for
            msm estimation.

    Returns:
        np.ndarray or pd.DataFrame: Sensitivity measure with shape (n_params, n_moments)

    """
np.ndarray or pd.DataFrame: Sensitivity measure with shape (n_params, n_moments)
np . ndarray or pd . DataFrame : Sensitivity measure with shape ( n_params n_moments )
jac
The jacobian of simulate_moments with
respect to params, evaluated at the  point estimates.
The jacobian of simulate_moments with respect to params evaluated at the point estimates .
weights
The weighting matrix used for
msm estimation.
The weighting matrix used for msm estimation .