gragusa / CovarianceMatrices.jl

Heteroskedasticity and Autocorrelation Consistent Covariance Matrix Estimation for Julia.
Other
53 stars 9 forks source link

Integration with Microeconometrics #22

Open lbittarello opened 7 years ago

lbittarello commented 7 years ago

I'm writing the package Microeconometrics, which includes some code to compute covariance matrices. I was wondering if we could merge it into CovarianceMatrices, so that I could focus on point estimation and delegate inference to your package.

Here's my approach. The variance of most estimators take the form inv(H)' S' W S inv(H), where H is average Jacobian of the moment conditions across observations, S is the matrix of moment conditions for each observation and W is a weight matrix. If the data are clustered, for example, entry (i, j) of W is 1 when i and j belong to the same cluster and 0 otherwise. Microeconometrics has the user precompile W and pass it to the covariance estimator. This step saves time when W is expensive to compute and one is estimating several specifications. Internal functions compute H and S, similar to your bread and meat functions.

Other than the possibility / requirement of precompiling W, Microeconometrics can compute covariance matrices for two-step estimators and the Hausman m-statistic (i.e. the difference in coefficients from two specifications).

Do you think we could integrate our packages?

gragusa commented 6 years ago

I am planning to spend some time on the package and generalize the API. Do you have a type from which I can base the extensions?

lbittarello commented 6 years ago

I define the main types here. This file contains the programs to compute the variance matrix of one– and two-stage parametric estimators.