-
Notifications
You must be signed in to change notification settings - Fork 12
Description
I spoke to @ElenaTuzhilina about her forecasting work and the structures she likes to use in her work. She drew this helpful diagram of a function similar to create_lags_and_leads
that generates model matrices. It also provides an info
matrix that acts as an index for the model matrices. I don't have much experience using the current create_lags_and_leads
, but it doesn't seem too far from what is currently offered. I am labeling this issue as an enhancement from user feedback and would like to open discussion with the rest of the team on whether this is something that would help others too.
If this addition is not too controversial, perhaps we can also discuss refactoring create_lags_and_leads
here. Our last sync meeting had the following points:
- the dplyr transformations are quite complicated and difficult to understand
- consider doing imputation separately and then use dplyr::lag() or dplyr::lead() instead?
- this code may be inevitably complex due to the different edge cases it needs to handle: a) positive/negative lags, b) imputation of missing and NA values (see Logan’s example)
- we should test the speed of the
full_join
, maybe using profvis