# Efficient quantity

Dear all
I am new user dynare, and I want to estimate the efficient amount of decision variable, therefore how to write the appropriate code in dynare

You need to provide a lot more detail. What exactly are you trying to do?

Dear professor
I run a DSGE model for Iran and I want to estimate potential output by using estimated parameters, the potential output is the level of output in an environment without nominal rigidities in goods and labor markets and
without shocks to price and wage markups.
in fact how to write the code in dynare
best regard

You can do that with a lot of models. So first you have to choose one model, try to code it in Dynare, and then we can help you when you will have precise issues with your model. You can do that with a Smets and Wouters model for example, but I donâ€™t know which feature you need in your model.

Best,

tanke you so much
dear stephan, i estimated the parameters but i do not know write a code in dynare for estimating the variables such consumption

But if you have estimated your model already, all you need to do is run the Kalman smoother on the model.

tanke you so much professor jpfeifer
how do it in dynare? in fact how simulated potential output after estimated parameters?

As said by Johannes, if you defined the output gap in your model, you just need to add the `smoother` option in the `estimation` command and the name of the output gap variable after the estimation command. Something like:

``````estimation(..., smoother, ...) OutputGap ;
``````

See the estimation section in the reference manual.

Best,

1 Like

Dear stepan
one of the my observed variables are â€śyâ€ť, can I predict â€śyâ€ť by using DSGE? and do predicted of â€śyâ€ť is different from observed â€śyâ€ť?

Sure, it is possible to forecast with a DSGE model, and the forecast will be different from the actual realization of the variable.

• The `forecast` option of the `estimation` triggers the computation of the posterior predictive density of the observed variables after the end of the sample used in estimation.

• The `filtered_vars` or `filter_step_ahead` options of the `estimation` command trigger the computation of the posterior distribution of the one or k step ahead filtered variables, i.e. the expectation of the variables in t+k conditional on the information available at time t.

The first approach provide out of sample forecast, while the second one delivers in sample forecasts. You will find more details in the reference manual.

Best,

Dear Stepan tanks a lot for your contribution
I want to index the horizon axis to year over 1960-2010, and also my graphic at starting point indexed to a number such 100, How do this in dynare?

An example. If you computed the filtered variables (with `filtered_vars` option in the `estimation` command), then you can define a `dseries` object as follows:

``````>> data = dseries(oo_.Filtered_Variables_1_step_ahead.Mean.y, '1980Q1', 'y');
``````

where the string `'1980Q1'` is the initial period, and the last argument the name of the variable. Then you just have to use the overloaded `plot` function:

``````plot(data)
``````

which will produce something like: dseries-plot.pdf (4.6 KB)

Best,

tank a lot for all contribution
Dear Stepan, I want to decompose consumption and production by shocks, how I can to do it?

There is a command called `shock_decomposition` for that. See the reference manual here.

Best,

Dear Stepan
When I use the shock_decomposition after estimation, I see negative contribution of various shocks for endogenous variable, However the contribution of various shock must be positive, therefore my question is why the contribution of shocks are negative? and what is the problem?
best regard
Goli

Hi, you are doing a decomposition of the levels of time series (not of the volatility of the time series). A shock can contribute positively or negatively to the levels. Consider a supply shock (for instance a TFP shock). An increase in productivity will augment the production but lower inflation. There is no theoretical reason to have only positive contributions. Hence, a priori, there is no problem with your results if you are able to interpret them.

Best,