synth-inference / synthdid

Synthetic difference in differences
https://synth-inference.github.io/synthdid
BSD 3-Clause "New" or "Revised" License
262 stars 98 forks source link

The coefficient for the regularization term #81

Open roy1312 opened 2 years ago

roy1312 commented 2 years ago

Hi, thanks for the interesting paper!

In line 43 of solver.R, eta is defined as N0 Re(zeta^2). If I understand correctly, this corresponds to the coefficient of the regularization term in Equation (4) of the paper, which says that eta = T0 zeta^2.

Do I miss something or is it a typo? And if possible, could you please provide some intuition about the choice on this coefficient? (I guess it is based on the asymptotic results reported in Equation 24) Thanks!

davidahirshberg commented 2 years ago

It’s correct as written but a bit confusing given the names.  What’s happening is that we’re reusing the same code for estimating the unit weights omega and the time weights lambda, and the variable names we use in that part of the code correspond to the case that we’re estimating lambda. For omega, the roles of T0 and N0 should be flipped relative to the names in the code, and they are: in likes 32-33 of solver.R we read N0,T0 from the dimensions of the matrix Y, which we pass in transposed when estimating omega.  Does that make sense to you?  Sorry it’s a bit confusing—we should perhaps rethink our variable names. On Feb 15, 2022, 3:23 AM -0500, Shangguan Ruo @.***>, wrote:

Hi, thanks for the interesting paper! In line 43 of solver.R, eta is defined as N0 Re(zeta^2). If I understand correctly, this corresponds to the coefficient f the regularization term in Equation (4) of the paper, which says that eta = T0 zeta^2. Do I miss something or is it a typo? Thanks! — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.Message ID: @.***>

roy1312 commented 2 years ago

Oh, I see, and for lambda, Y is not transposed. Perhaps you should at least add a line of comment explaining this. Thanks for the explanation!