Actual behavior: The variance-covariance matrix computed in reghdfe_solve_ols may not be symmetric (I get this error under some circumstances with reghdfe_vce_cluster specifically, but I imagine it might be generic). This causes EreturnPost/ereturn pots to give a warning: warning: variance matrix is nonsymmetric or highly singular and instead of the vcov matrix it posts a matrix that is all 0s, resulting in missing SEs. The matrix is approximately symmetric, so it's a numerical precision issue.
Steps to reproduce the problem
Unfortunately I am unable to provide a MWE. This is a numerical precision issue that arises when using reghdfe with administrative individual-level data I cannot share and have not reproduced with basic simulations. However, I can show the output from the HDFE object saved by my regression:
. mata issymmetric(HDFE.solution.V)
0
. mata max(reldif(lowertriangle(HDFE.solution.V), uppertriangle(HDFE.solution.V)'))
4.74795e-09
I propose forcing symmetry at the end of reghdfe_solve_ols, which solves it for me; e.g.
Bug report
Please complete the following information:
which reghdfe
givesversion 6.12.4 12sep2023
Behavior
reghdfe_solve_ols
may not be symmetric (I get this error under some circumstances withreghdfe_vce_cluster
specifically, but I imagine it might be generic). This causesEreturnPost
/ereturn pots
to give a warning:warning: variance matrix is nonsymmetric or highly singular
and instead of the vcov matrix it posts a matrix that is all 0s, resulting in missing SEs. The matrix is approximately symmetric, so it's a numerical precision issue.Steps to reproduce the problem
Unfortunately I am unable to provide a MWE. This is a numerical precision issue that arises when using
reghdfe
with administrative individual-level data I cannot share and have not reproduced with basic simulations. However, I can show the output from theHDFE
object saved by my regression:I propose forcing symmetry at the end of
reghdfe_solve_ols
, which solves it for me; e.g.