dake-li / lp_var_simul

Simulation study of Local Projections, VARs, and related estimators
MIT License
30 stars 25 forks source link

Reuse ABCD calculations #5

Closed mikkelpm closed 6 months ago

mikkelpm commented 4 years ago

In the folder DFM/Subroutines, is it possible to use (a modification of) the function ABCD_fun_DFM.m to compute the ABCD representations in the four files compute_*.m? There seems to be some repeated logic going on.

dake-li commented 4 years ago

I guess it is going to somewhat difficult. The function ABCD_funDFM.m just gives users a tool to write DFM as a plain ABCDEF model in the main script. However, all the compute.m files generate quite different ABCD models for the specific usage in each compute_.m function. (Our note illustrates why these ABCD models are quite different.) So we might not be able to use a single ABCD_funDFM.m function to satisfy all the different needs in each compute*.m function.

mikkelpm commented 4 years ago

However, all the compute.m files generate quite different ABCD models for the specific usage in each compute.m function. (Our note illustrates why these ABCD models are quite different.) So we might not be able to use a single ABCD_funDFM.m function to satisfy all the different needs in each compute*.m function.

I think if we give this some extra thought, we'll find a way to fit all the files into one overarching structure. The overall logic is the same in the files, we just need to build the coefficient matrices appropriately. I think there's a clear benefit to modularizing these files, as they are currently very long and the logic can get a bit lost. So let's keep this issue open for now and get back to it later.

dake-li commented 4 years ago

Yes, I understand. If we move all the different ABCD setups into one ABCD_funDFM.m function, and call one part of it every time in compute*.m, it will be feasible but verbose. So the issue now is mainly how to concisely write a chunk of code to generate different ABCD setups. It definitely will take us some time to think about it. I will leave it for now, and come back later when we have time.