How to find average of future expected consumptions?

Dear DSGE experts,

Below is my simple dynare code for RBC.


I’d like to add some lines to calculate average of today and future path of consumptions (4 horizon). In other words, I’d like to calculate

1/4*E_t(c_t + c_t+1 + c_t+2 + c_t+3) for all t (given realized innovation at t).

Since solving DSGE model actually means deciding sequence of today and future variables given today’s information, I thought I would easily find how to do this. So I did check dynare user guide and reference, but couldn’t find how to do that, even though it looks quite simple.

Is there any one who can teach me how to do this?


Why can’t you use a new variable


Dear Jpfeifer,

Thank you very much. Actually I’d like to average +1 to +40, so I’m wondering whether I may use a loop in the model section as follows.

for i=1:40 tv_c = tv_c + c(+i); end av_c = tv_c/40;


Yong O Kwon

You need to use the macro-language to program such a loop. See the bkk.mod for an example. It should be something along the lines of

tv_c=c @# for lead in 1:39 +c@(+@{lead}) @# endfor ; av_c = tv_c/40;