Perfect foresight simulation through exogenous variable sequence

Hello everyone,

I encountered an issue while conducting a perfect foresight simulation of the RBC model. I have a sequence of an exogenous variable, TFP, and I want to simulate the changes in other endogenous variables.

Does anyone have a corresponding code to achieve this?

What is the error you are getting?

Hello Professor jpfeifer,

I haven’t encountered any programming errors, but I don’t know how to input the sequence of exogenous variables when conducting a perfect foresight simulation.

I have checked the manual but couldn’t find relevant instructions. I appreciate your help.

is an example.

Thank you for your help.

In the example you provided, x takes values only in specific periods. However, I would like to know how to run the simulation if I have a full sequence of x.

Defining x for each period using shocks seems a bit cumbersome. Is there a more efficient way ?

From the manual:

xx = [1.2; 1.3; 1];
shocks;
var e;
periods 1:3;
values (xx);
end;

In xx you could have a vector you loaded.

1 Like

Thank you very much!