rsaggio87 / LeaveOutTwoWay

Bias corrected estimates of variance components in two fixed effects models as described in Kline, Saggio and Sølvsten (2020)
24 stars 11 forks source link

Picking one among many (tied) connected sets #28

Open economoser opened 2 years ago

economoser commented 2 years ago

I noticed that sometimes (at least in small, simulated data) there are multiple connected sets of equal size, which causes an error in the following line of the file pruning_unbalanced_v3.m:

firmlst=find(sindex==idx); %firms in connected set

I believe one (arbitrary) solution is to add the following line just before that quoted above:

idx=idx(1); % pick an arbitrary connected set among all tied largest connected sets

I believe the same issue applies to the connected set computed in connected_set.m.

Thanks again for the excellent work! :)