I have chosen “uncategorized” as the topic - apologies if this is ex-post incorrect.
I believe my question may be remotely related to the topic covered in this thread:
Essentially:
I have a linear New Keynesian model
There are three exogenous variables: productivity, government expenditure, loan delinquencies.
I have the actual, empirical data for these exogenous variables.
I’d like to feed these actual, empirical data into my linear model and be able to extract the implied values for my endogenous variables.
So, I’m guessing something along the lines of replacing the regular “shock” block with a series of commands which load a data file (similar to how we do this with estimation). But, I have never done something like this before.
where I assume “mymatrix” would be a matrix containing the actual values for the exogenous variables I would like to feed into my model.
So, do I simply create such a file in the folder and then copy and paste the empirical values into the matrix in some specific arrangement? Then run the above commands and the .mod file will automatically know to look up and utilize those exogenous values?
Well, I managed to get it to work. It is definitely not pretty, but it does what I needed. Here is the code for the shocks block that I appended from a normal stochastic simulation:
shocks;
var z;
periods 0 1 … 23;
values
-0.01377,
-0.02987,
.
.
.
0.01014;
var gam;
periods 0 1… 23;
values
-0.08538,
0.2584956,
.
.
.
0.003420;
var delL;
periods 0 1… 23;
values
0.0002229,
0.0016440,
.
.
.
0.000889400000000;
end;
perfect_foresight_setup(periods=23);
perfect_foresight_solver;
I basically had to hard code the shock values into the shocks block. There were 24 of these, so I abbreviated them with (…). The periods also had to be listed out individually. I can imagine this getting out of hand if I had lets say 100 shock values I wanted to feed into the model. In any case, if someone can come up with a cleaner way to do this, let me know.
Can you provide me with the codes (via PM if necessary). Also, do you want the shocks to be anticipated or surprise shocks? If the latter, you can easily do this with the simult_ command.