Open itamarcaspi opened 1 week ago
Thanks for pointing this out. Jorda and Taylor, 2024 was not written when I implemented the cumul_mult
option. Unfortunately, I do not have any time to work on the package but pull requests (including tests) are welcome.
As a workaround, and maybe the simpler solution, the user could calculate y(t-1) - y(t-2)
herself and put it into c_exog_data
. This in conjunction with cumul_mult = T
should give the theoretical long difference specification, right? Maybe one could just add this to the documentation as the simplest workaround? This would also avoid having to include and use another option in the functions.
Problem Description
There appears to be an inconsistency between the theoretical specification for long difference local projections (LP) and the current implementation in
lp_lin_iv()
whencumul_mult = TRUE
.The theoretical setup (as described in Jorda and Taylor, 2024) specifies that for long difference LPs, both the LHS and RHS variables should be transformed into differences:
However, the current implementation in
lp_lin_iv()
only transforms the LHS while keeping level lags on the RHS:This can be seen in the code where
cumul_mult = TRUE
only affects the LHS transformation:Suggested Solution
Add a new parameter
rhs_diff = FALSE
(default) to maintain backward compatibilityWhen
cumul_mult = TRUE
andrhs_diff = TRUE
, transform both LHS and RHS variables to differences:y(t+h) - y(t-1)
transformationy(t-1) - y(t-2)
Update documentation to:
Example implementation sketch:
Benefits
Let me know if you would like me to explain any part of this in more detail or provide additional code examples.