This question is not about Dynare issue but the concept of output gap in RBC theory. I am working with the paper**“Bayesian estimation of an Open economy DSGE model**(Adolfson et al. 2007)”. Thay said that the output gap is measured as the deviation form the trend value of output in the economy.
For the further information,
/////// Non-stationary production function/////////
Y(t)=z(t)^(1-alpha)*e(t)K(t)^alphaH(t)^(1-alpha)-z(t)*Fixed cost

where
H(t) is working hour that is detrended by its linear trend to eliminate population growth(this is stationary variable)
e(t) is a covariance stationary technology shock
K(t) is a capital service stock(this is non-stationary variable growing with z(t-1))
Y(t) is a real GDP(this is non-stationary variable growing with z(t))
z(t) is a permanent technology shock (this is non-stationary variable)

/////// Stationary production function/////////
y(t)=mu_z(t)^(-alpha)*e(t)k(t)^alphaH(t)^(1-alpha)-Fixed cost
where
y(t)=Y(t)/z(t) , k(t)=K(t)/z(t-1) , mu_z(t)=z(t)/z(t-1) ,

According to this work, **can I summarize the y_hat(t)=ln(y(t))-ln(y_ss)=y_gap ? **
And can I summarize the z(t) = output trend = potential output?

Thank you so much for your answer,
Kerkkiat Pommin

After detrending with permanent TFP, the steady state will be the long-run trend/potential output. Thus y in steady state, y_ss, is the potential output and the output gap is
log(y)-log(y_ss).

my question is related to the previous one. We know that the historical estimates of output gap correspond to the smoothed estimates of y_hat. Now I want to plot historical estimates of potential output. Where can I find them?

Depending on whether you use ML or Bayesian estimation (or the calib_smoother) they will be stored in fields of oo_ that start with “Smoothed”, e.g. oo_.SmoothedVariables

Ok, but which variable corresponds to potential output, taking into account:

/////// Stationary production function/////////
y(t)=mu_z(t)^(-alpha)*e(t)k(t)^alphaH(t)^(1-alpha)-Fixed cost
where
y(t)=Y(t)/z(t) , k(t)=K(t)/z(t-1) , mu_z(t)=z(t)/z(t-1) , where mu_z(t) is is the stochastic growth rate of the
unit root technology shock

I know that y_hat(t)=ln(y(t))-ln(y_ss) is output gap.

As I said, I want to plot historical estimates of potential output. Which variable corresponds to potential output?

In the model I use all real variables are scaled with the trend level of technology, i.e. z_t. In the model I have the following variable mu_z(t)=z(t)/z(t-1) which is the stochastic growth rate of the
unit root technology shock. The smoothed estimates of y_hat=ln(y_t)-ln(y_ss), where y=Y/z, corresponds to the trend output gap. But I want to plot historical estimates of potential level of output - trend output. Which variable should I use?