src/estimagic/inference/ml_covs.py
def cov_hessian(hess):
    """Covariance based on the negative inverse of the hessian of loglike.

    While this method makes slightly weaker statistical assumptions than a covariance
    estimate based on the outer product of gradients, it is numerically much more
    problematic for the following reasons:

    - It is much more difficult to estimate a hessian numerically or with automatic
      differentiation than it is to estimate the gradient / jacobian
    - The resulting hessian might not be positive definite and thus not invertible.

    Args:
        hess (numpy.ndarray): 2d array hessian matrix of dimension (nparams, nparams)

    Returns:
       numpy.ndarray: covariance matrix (nparams, nparams)


    Resources: Marno Verbeek - A guide to modern econometrics :cite:`Verbeek2008`

    """
    _hess, names = process_pandas_arguments(hess=hess)
    info_matrix = -1 * _hess
    cov = robust_inverse(info_matrix, msg=INVALID_INFERENCE_MSG)

    if "params" in names:
        cov = pd.DataFrame(cov, columns=names["params"], index=names["params"])

    return cov
Covariance based on the negative inverse of the hessian of loglike.

    While this method makes slightly weaker statistical assumptions than a covariance
    estimate based on the outer product of gradients, it is numerically much more
    problematic for the following reasons:

    - It is much more difficult to estimate a hessian numerically or with automatic
      differentiation than it is to estimate the gradient / jacobian
    - The resulting hessian might not be positive definite and thus not invertible.

    Args:
        hess (numpy.ndarray): 2d array hessian matrix of dimension (nparams, nparams)

    Returns:
       numpy.ndarray: covariance matrix (nparams, nparams)


    Resources: Marno Verbeek - A guide to modern econometrics :cite:`Verbeek2008`

    
Covariance based on the negative inverse of the hessian of loglike.
While this method makes slightly weaker statistical assumptions than a covariance
estimate based on the outer product of gradients, it is numerically much more
problematic for the following reasons.

It is much more difficult to estimate a hessian numerically or with automatic
differentiation than it is to estimate the gradient / jacobian
The resulting hessian might not be positive definite and thus not invertible.
Covariance based on the negative inverse of the hessian of loglike . While this method makes slightly weaker statistical assumptions than a covariance estimate based on the outer product of gradients it is numerically much more problematic for the following reasons . It is much more difficult to estimate a hessian numerically or with automatic differentiation than it is to estimate the gradient / jacobian The resulting hessian might not be positive definite and thus not invertible .
def cov_hessian(hess):
    _hess, names = process_pandas_arguments(hess=hess)
    info_matrix = -1 * _hess
    cov = robust_inverse(info_matrix, msg=INVALID_INFERENCE_MSG)
    if "params" in names:
        cov = pd.DataFrame(cov, columns=names["params"], index=names["params"])
    return cov
def cov_hessian ( hess ) : _hess , names = process_pandas_arguments ( hess = hess ) info_matrix = - 1 * _hess cov = robust_inverse ( info_matrix , msg = INVALID_INFERENCE_MSG ) if "params" in names : cov = pd . DataFrame ( cov , columns = names [ "params" ] , index = names [ "params" ] ) return cov
Covariance based on the negative inverse of the hessian of loglike.
Covariance based on the negative inverse of the hessian of loglike .
"""Covariance based on the negative inverse of the hessian of loglike.

    While this method makes slightly weaker statistical assumptions than a covariance
    estimate based on the outer product of gradients, it is numerically much more
    problematic for the following reasons:

    - It is much more difficult to estimate a hessian numerically or with automatic
      differentiation than it is to estimate the gradient / jacobian
    - The resulting hessian might not be positive definite and thus not invertible.

    Args:
        hess (numpy.ndarray): 2d array hessian matrix of dimension (nparams, nparams)

    Returns:
       numpy.ndarray: covariance matrix (nparams, nparams)


    Resources: Marno Verbeek - A guide to modern econometrics :cite:`Verbeek2008`

    """
covariance matrix (nparams, nparams)
covariance matrix ( nparams nparams )
numpy.ndarray
hess
2d array hessian matrix of dimension (nparams, nparams)
2d array hessian matrix of dimension ( nparams nparams )