Introducing time (simulation periods) as a variable

Hi everyone,
How can I introduce simulation periods as a variable?
Thank you

Hi Ani,
I’m afraid you need to provide more details about your question and be more specific about what you are trying to do.

Do you want to simulate a calibrated model for a given time period and then use this simulation for estimation? Or do you want to add an observable variable that gives you the time period, like a deterministic trend?

Hi,thank you for answering,
I will try to describe my problem.

I have a dsge model which is working in ramsey policy framework.
I want to fix interest rate values for some simulation periods (let’s say R=2 for 4 periods).
Thus I want to generate a variable which will indicate my simulation periods (named for example T) and then write an m. file, in which I can put a condition that,

if T <=4
interest rate ==2
generate simulation results for interest rate

I see.
Is variable R your instrument in the Ramsey problem?
If yes, I don’t know how to do what you want. Someone else in the forum may help to answer.
If no, I think you can set initial conditions and the path of R by playing around with initval and shocks block (calibrate the shocks so that you get the desired path for R). Se the example in the manual: 4. The model file — Dynare 5.1 documentation

sadly R is my instrument, and is included in loss function along with inflation deviation and output gap but thank you anyway

What exactly are you trying to do? Pegging the interest rate is the opposite of Ramsey policy.

I’m sorry for late reply. I am trying to fix the interest rate for some initial periods then make it endogenous.

That most probably would only work with sequence of perfect foresight problems.

yes I actually did, thank you for the answer !!