I want to make an endogenous variable follow an exogenously set path in my model. For eg.:

E is a variable
P is the parameter
then,
E = P ; This sets E to be P in all time periods but I want to make it as follows:
Suppose the model has 3 period and
E is a variable,
P1, P2, P3 are all parameters.
then,

E(1) = P1; in the first period
E(2) = P2; in the second period
E(3) = P3; in the third period

Looks like it needs a loop. Did anyone face similar problem before? Any idea how I can implement this in dynare?

Could you explain the economic logic behind what you are trying to do? Because you cannot simply choose endogenous variables. What you need would be a sequence of exogenous shocks that make the endogenous variables obey the preset path. But this sequence will not necessarily be unique.

well, i am trying to create an equivalency between quota and taxes in my model. I can do that in the steady state values but my question was can I do that in the transition as well. Now, if I want to have equivalent taxes for a given quota (quantity) such that the path of quantities under the taxes are as they were in the quota under the same exogenous shock then I understand that I need to have shadow values for the quotas each period. Since, these shadow values are endogenous, I need to make them follow a preset path in the model. Not sure if I am correctly understanding how these should work but in a simple way this should be the case!

I have a similar problem as in the old posts. In my DSGE model, x and y are two forward looking endogenous variables, and v is the only shock. Instead of computing IRFs, I’m interested in a simulation, where a series of shock v could generate a certain path for variable y. I want to know how variable x behaves during this simulation. That certain path for variable y will match the features from real life, e.g. if y is inflation, the path could be the inflation goes down by 1%, goes back to steady state for 5 periods, goes up by 2% and then goes back to the usual dynamic rule.

inflation_1 =-0.01;
inflation_2 =0;
inflation_3 =0;
inflation_4 =0;
inflation_5 =0;
inflation_6 =0;
inflation_7 =0.02;
inflation_8 =function of state variables; etc…

I want to see what kinds of series of shock v could generate this path, and more importantly, how the other variables respond.

The model is log linearized, and perfect foresight is assumed. (one side question, if I say the model is log-linearized, does it mean perfect foresight? how about vice versa?) The path I impose won’t be an extreme case. The model could be solved using backward conduction. I wonder whether there’re any commands or any parameter matrices that I can use to compute the size of the shocks in each period. It might be cases that there’re multiple solutions for the shock series.

After I get the shock series, i can use the stimuli_ to generate the path for variable x.

First off: perfect foresight is not the same as log-linearized. the former relates to an information structure (everything is known in advance), while the second one relates to the model structure (linear). In a perfect foresight context, you are not restricted to linearity for example.

You need to think hard about what you want to achieve. In general, you shock path will not be unique if your model is nonlinear. Moreover, in a perfect foresight context, a future shock sequence will mean that you are effectively simulating news shocks. Is that what you want?

If you use a linear model (stoch_simul(order=1)), it seems you are looking for the