src/estimagic/inference/ml_covs.py
def cov_robust(jac, hess):
    """Covariance of parameters based on HJJH dot product.

    H stands for Hessian of the log likelihood function and J for Jacobian,
    of the log likelihood per individual.

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


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

    Resources:
        https://tinyurl.com/yym5d4cw

    """
    _jac, _hess, names = process_pandas_arguments(jac=jac, hess=hess)

    info_matrix = np.dot((_jac.T), _jac)
    cov_hes = cov_hessian(_hess)
    cov = np.dot(cov_hes, np.dot(info_matrix, cov_hes))

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

    return cov
Covariance of parameters based on HJJH dot product.

    H stands for Hessian of the log likelihood function and J for Jacobian,
    of the log likelihood per individual.

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


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

    Resources:
        https://tinyurl.com/yym5d4cw

    
Covariance of parameters based on HJJH dot product.
H stands for Hessian of the log likelihood function and J for Jacobian,
of the log likelihood per individual.
Covariance of parameters based on HJJH dot product . H stands for Hessian of the log likelihood function and J for Jacobian of the log likelihood per individual .
def cov_robust(jac, hess):
    _jac, _hess, names = process_pandas_arguments(jac=jac, hess=hess)
    info_matrix = np.dot((_jac.T), _jac)
    cov_hes = cov_hessian(_hess)
    cov = np.dot(cov_hes, np.dot(info_matrix, cov_hes))
    if "params" in names:
        cov = pd.DataFrame(cov, columns=names["params"], index=names["params"])
    return cov
def cov_robust ( jac , hess ) : _jac , _hess , names = process_pandas_arguments ( jac = jac , hess = hess ) info_matrix = np . dot ( ( _jac . T ) , _jac ) cov_hes = cov_hessian ( _hess ) cov = np . dot ( cov_hes , np . dot ( info_matrix , cov_hes ) ) if "params" in names : cov = pd . DataFrame ( cov , columns = names [ "params" ] , index = names [ "params" ] ) return cov
Covariance of parameters based on HJJH dot product.
Covariance of parameters based on HJJH dot product .
"""Covariance of parameters based on HJJH dot product.

    H stands for Hessian of the log likelihood function and J for Jacobian,
    of the log likelihood per individual.

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


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

    Resources:
        https://tinyurl.com/yym5d4cw

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