asheshrambachan / HonestDiD

Robust inference in difference-in-differences and event study designs
Other
175 stars 45 forks source link

Warning for sigma that is not positive semi-definite #36

Closed jonathandroth closed 1 year ago

jonathandroth commented 1 year ago

@mcaceresb when you have RA time in the fall, can you add a check for whether sigma is positive semi-definite and if not, throw a warning?

Providing HonestDID with a non-semi-definite Sigma led to some weird error messages, per the email we received from a student.

mcaceresb commented 1 year ago

@jonathandroth Sigma is also symmetric so I can just check the eigenvalues, right? The simple version is fairly quick to code. See PR #37.

jonathandroth commented 1 year ago

Well, it should be symmetric but I guess we can check that too.

If the smallest eigenvalue is very small (e.g. from numerical precision errors), then things might run okay since we only run into problems if gamma' Sigma gamma <= 0. So maybe a warning is okay? Don't have a strong opinion.

On the topic of checks, do we currently check that betahat, sigma, and l_vec all have conformable dimensions?

On Thu, Jul 27, 2023, 2:41 PM Mauricio Caceres Bravo < @.***> wrote:

Closed #36 https://github.com/asheshrambachan/HonestDiD/issues/36 as completed.

— Reply to this email directly, view it on GitHub https://github.com/asheshrambachan/HonestDiD/issues/36#event-9939444269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6EXFDPGPRNZ6PMVQEBVUTXSKY67ANCNFSM6AAAAAA22ORF4U . You are receiving this because you were mentioned.Message ID: @.***>

mcaceresb commented 1 year ago

@jonathandroth

Well, it should be symmetric but I guess we can check that too. If the smallest eigenvalue is very small (e.g. from numerical precision errors), then things might run okay since we only run into problems if gamma' Sigma gamma <= 0. So maybe a warning is okay? Don't have a strong opinion.

How about

On the topic of checks, do we currently check that betahat, sigma, and l_vec all have conformable dimensions?

Not sure; will have a look.

mcaceresb commented 1 year ago

@jonathandroth Added in #39