Open ZeyuJin opened 2 years ago
This might be a late answer, but it could help someone struggling with the same question
It is not possible given the current version of the package (and the literature for that matter it seems), to estimate a model that estimates almost concurrent effects (of T_t on Y_t). Only effects on the final outcome (Y_m) of a treatment in t can be estimated.
As for which algorithm is implemented. All learners depend on the _OrthoLearner class in _ortho_learner.py. The algorithms proposed in Lewis & Syrgkanis (2022) consist of two steps: estimating the nuisances functions and the final model. The nuisances models are constructed for DynamicDML through the method _gen_ortho_learner_model_nuisance which creates an instance of class _DynamicModelNuisanceSelector (line 29 in panel/dml/dml.py). When these are trained use the method .train, for both X and W, only the concurrent features are passed (X_t and W_t for each time t, line 84 in panel/dml/_dml.py) through use of the period_filters[t] that are constructed using _get_groups_period_filter, not the entire histories. This makes the first part of this algorithm in line with algorithm 1 from the original paper (and not algorithm 3, page 19 of the paper states 'Thus the results we presented so far [i.e., algorithm 1] directly extend to the estimation of structural nested mean models [i.e., algorithm 3], with a linear parametrization of the blip functions, simply by using a different definition of the residual variables'. So that is where we can look for the differences.) As for the second part: Given that it is possible to include heterogeneity in the treatment effect, the final model is a linear regression in line with algorithm 4.
Hope this helps!
Hi,
I have a question related to the input of DynamicDML estimation. The comment suggests the input outcome is one-dimensional array with its length = *n_groups n_periods. n_periods** means the length of time series of each entity.
However, when I read the Algorithm 1 (which uses Neyman orthogonal g-estimation) in this reference paper [Lewis2021], the data input only uses the final observed outcome Ym. That is, Y = Ym for each sample. Actually all algorithms in this paper just assume single final outcome Ym (not the whole time series for each entity) as the data input.
I am confused why/how to specify a continuous time-step outcome Yi (i=1, ..., m) for the DynamicDML() input. Moreover, which specific algorithm is implemented in the class DynamicDML?
Thanks,