src/estimagic/sensitivity/msm_sensitivity.py
def calculate_sensitivity_measures(jac, weights, moments_cov, params_cov):
    """Calculate sensitivity measures for MSM estimates.

    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.
        moments_cov (numpy.ndarray or pandas.DataFrame): The covariance matrix of the
            empirical moments.
        params_cov (numpy.ndarray or pandas.DataFrame): The covariance matrix of the
            parameter estimates.

    Returns:
        dict: Dictionary with six sensitivity measures.


    """
    weights_opt = get_weighting_matrix(moments_cov, "optimal")
    params_cov_opt = cov_optimal(jac, weights_opt)

    m1 = calculate_sensitivity_to_bias(jac=jac, weights=weights)
    e2 = calculate_fundamental_sensitivity_to_noise(
        jac=jac,
        weights=weights_opt,
        moments_cov=moments_cov,
        params_cov_opt=params_cov_opt,
    )
    e3 = calculate_actual_sensitivity_to_noise(
        sensitivity_to_bias=m1,
        weights=weights,
        moments_cov=moments_cov,
        params_cov=params_cov,
    )
    e4 = calculate_actual_sensitivity_to_removal(
        jac=jac,
        weights=weights,
        moments_cov=moments_cov,
        params_cov=params_cov,
    )

    e5 = calculate_fundamental_sensitivity_to_removal(
        jac=jac,
        moments_cov=moments_cov,
        params_cov_opt=params_cov_opt,
    )

    e6 = calculate_sensitivity_to_weighting(
        jac=jac,
        weights=weights,
        moments_cov=moments_cov,
        params_cov=params_cov,
    )

    measures = {
        "sensitivity_to_bias": m1,
        "fundamental_sensitivity_to_noise": e2,
        "actual_sensitivity_to_noise": e3,
        "actual_sensitivity_to_removal": e4,
        "fundamental_sensitivity_to_removal": e5,
        "sensitivity_to_weighting": e6,
    }

    return measures
Calculate sensitivity measures for MSM estimates.

    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.
        moments_cov (numpy.ndarray or pandas.DataFrame): The covariance matrix of the
            empirical moments.
        params_cov (numpy.ndarray or pandas.DataFrame): The covariance matrix of the
            parameter estimates.

    Returns:
        dict: Dictionary with six sensitivity measures.


    
Calculate sensitivity measures for MSM estimates.
Calculate sensitivity measures for MSM estimates .
def calculate_sensitivity_measures(jac, weights, moments_cov, params_cov):
    weights_opt = get_weighting_matrix(moments_cov, "optimal")
    params_cov_opt = cov_optimal(jac, weights_opt)
    m1 = calculate_sensitivity_to_bias(jac=jac, weights=weights)
    e2 = calculate_fundamental_sensitivity_to_noise(
        jac=jac,
        weights=weights_opt,
        moments_cov=moments_cov,
        params_cov_opt=params_cov_opt,
    )
    e3 = calculate_actual_sensitivity_to_noise(
        sensitivity_to_bias=m1,
        weights=weights,
        moments_cov=moments_cov,
        params_cov=params_cov,
    )
    e4 = calculate_actual_sensitivity_to_removal(
        jac=jac,
        weights=weights,
        moments_cov=moments_cov,
        params_cov=params_cov,
    )
    e5 = calculate_fundamental_sensitivity_to_removal(
        jac=jac,
        moments_cov=moments_cov,
        params_cov_opt=params_cov_opt,
    )
    e6 = calculate_sensitivity_to_weighting(
        jac=jac,
        weights=weights,
        moments_cov=moments_cov,
        params_cov=params_cov,
    )
    measures = {
        "sensitivity_to_bias": m1,
        "fundamental_sensitivity_to_noise": e2,
        "actual_sensitivity_to_noise": e3,
        "actual_sensitivity_to_removal": e4,
        "fundamental_sensitivity_to_removal": e5,
        "sensitivity_to_weighting": e6,
    }
    return measures
def calculate_sensitivity_measures ( jac , weights , moments_cov , params_cov ) : weights_opt = get_weighting_matrix ( moments_cov , "optimal" ) params_cov_opt = cov_optimal ( jac , weights_opt ) m1 = calculate_sensitivity_to_bias ( jac = jac , weights = weights ) e2 = calculate_fundamental_sensitivity_to_noise ( jac = jac , weights = weights_opt , moments_cov = moments_cov , params_cov_opt = params_cov_opt , ) e3 = calculate_actual_sensitivity_to_noise ( sensitivity_to_bias = m1 , weights = weights , moments_cov = moments_cov , params_cov = params_cov , ) e4 = calculate_actual_sensitivity_to_removal ( jac = jac , weights = weights , moments_cov = moments_cov , params_cov = params_cov , ) e5 = calculate_fundamental_sensitivity_to_removal ( jac = jac , moments_cov = moments_cov , params_cov_opt = params_cov_opt , ) e6 = calculate_sensitivity_to_weighting ( jac = jac , weights = weights , moments_cov = moments_cov , params_cov = params_cov , ) measures = { "sensitivity_to_bias" : m1 , "fundamental_sensitivity_to_noise" : e2 , "actual_sensitivity_to_noise" : e3 , "actual_sensitivity_to_removal" : e4 , "fundamental_sensitivity_to_removal" : e5 , "sensitivity_to_weighting" : e6 , } return measures
Calculate sensitivity measures for MSM estimates.
Calculate sensitivity measures for MSM estimates .
"""Calculate sensitivity measures for MSM estimates.

    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.
        moments_cov (numpy.ndarray or pandas.DataFrame): The covariance matrix of the
            empirical moments.
        params_cov (numpy.ndarray or pandas.DataFrame): The covariance matrix of the
            parameter estimates.

    Returns:
        dict: Dictionary with six sensitivity measures.


    """
Dictionary with six sensitivity measures.
Dictionary with six sensitivity measures .
dict
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 .
moments_cov
The covariance matrix of the
empirical moments.
The covariance matrix of the empirical moments .
params_cov
The covariance matrix of the
parameter estimates.
The covariance matrix of the parameter estimates .