Time series simulations


For my thesis I need to perform some volatility analysis for a couple of different models. My goal is to obtain a graph similar to this one:

To do so, I have understood that I need to perform a simulation by randomly picking values of the shocks’ errors, using the randn() function to define a series x = stdev(of the error)*randn(). When I have this series, from the matrix of policy and transition functions I obtain after running stoch_simul, I can retrieve the magnitude of the effect through which x affects the variable for which I want to simulate a time series, for example output or consumption.
My problem is that the models that I need to compare are medium sized, so, endogenous variables are influenced by both exogenous and endogenous variables. With exogenous variables I can easily create the simulated series, because I know their distribution, but I cannot do the same with endogenous variables. To make an example:

Output depends on the shocks and on other variables, such, for example, consumption, so that the series is defined as:

Yt = aCt + bCt-1 + cDt + … + zZt

With a, b, c, …, z parameters from the policy and transitions functions’ matrix, Ct, Ct-1 endogenous variables and Zt the exogenous variable.

Is there an easier way in which I can obtain the simulated series for the endogenous variables of interest? And, if not, how can I overcome the problem created by the dependence of endogenous variables one on another?

I hope I made myself clear enough and that someone can help me solve this problem. Thank you.

I am not sure I am following. The whole thing about solving a DSGE model is about solving out the simultaneous dependence on other other endogenous variables. A policy function represents today’s endogenous variables as purely a function of exogenous and predetermined variables/states.
Also note that Dynare already provides simulations of the model with the periods-option. See e.g. DSGE_mod/Hansen_1985 at master · JohannesPfeifer/DSGE_mod · GitHub

It turns out that I already had what I needed in the oo_.endo_simul matrix that is produced when using stoch_simul with the periods option. Thank you very much Professor!