Maximum Likelihood

Functions for inferences in maximum likelihood models.

estimagic.inference.likelihood_covs.cov_hessian(hessian)[source]

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

Parameters

hessian (np.array) – 2d array hessian matrix of dimension (nparams, nparams)

Returns

2d array covariance matrix (nparams, nparams)

Return type

hessian_matrix (np.array)

Resources: Marno Verbeek - A guide to modern econometrics [Ver08]

estimagic.inference.likelihood_covs.cov_jacobian(jacobian)[source]

Covariance based on outer product of jacobian of loglikeobs.

Parameters

jacobian (np.array) – 2d array jacobian matrix of dimension (nobs, nparams)

Returns

2d array covariance matrix (nparams, nparams)

Return type

jacobian_matrix (np.array)

Resources: Marno Verbeek - A guide to modern econometrics.

estimagic.inference.likelihood_covs.cov_sandwich(jacobian, hessian)[source]

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.

Parameters
  • jacobian (np.array) – 2d array jacobian matrix of dimension (nobs, nparams)

  • hessian (np.array) – 2d array hessian matrix of dimension (nparams, nparams)

Returns

2d array covariance HJJH matrix (nparams, nparams)

Return type

sandwich_cov (np.array)

Resources:

https://tinyurl.com/yym5d4cw

estimagic.inference.likelihood_covs.se_from_cov(cov)[source]

Standard deviation of parameter estimates based on the function of choice.

Parameters

cov (np.array) – 2d array covariance matrix of dimenstions (nparams, nparams)

Returns

1d array of dimension (nparams) with standard errors

Return type

standard_errors (np.array)

Ver08

M. Verbeek. A Guide to Modern Econometrics. Wiley, 2008. ISBN 9780470517697. URL: https://books.google.com/books?id=uEFm6pAJZhoC.