Dynamic stochastic general equilibrium (DSGE) models are used in
macroeconomics to describe the structure of the economy. These
models consist of systems of equations that are derived from
economic theory. In these models, expectations play an important role in
determining the values of variables today. What distinguishes the DSGE
model from other time-series models is its close connection to theory
and the appearance of expectations in the model.

Macroeconomists use DSGEs to evaluate the impact of policy on outcomes such as
output growth, inflation, and interest rates. A DSGE model can nest multiple theories.
Researchers can then use estimated parameter values to determine which theory better fits the data.

Stata's new dsgenl command estimates the parameters of DSGEs that are nonlinear
in both the parameters and variables by using a first-order approximation to the model's
equations at the steady state.

Let's see it work

A DSGE model might propose relationships among economic variables
like inflation, the interest rate, and the output gap. Some of
these variables are observable, such as inflation. Others are not,
such as the output gap.

These variables are linked by a system of equations. Different
theories propose different forms of the equations. Parameter
estimates can help us discriminate among theories.

Some of these equations will feature forward-looking elements so
that expectations of future economic developments will affect
variables in the current period.

Finally, the model will be driven by shocks, and these shocks will
feed into the model through state variables.

Each line except the last defines an equation. In the equations,
names enclosed in braces such as {phi} are parameters to
be estimated. {phi} will turn out to be the price-adjustment
parameter.

The first equation is the relationship between the output gap
x and its determinants, namely

its future value F.x,

the nominal interest rate r,

future inflation F.p,

and a state variable z that captures the remaining
unmodeled factors.

The second equation is the pricing equation. It links inflation to
future inflation and the output gap.

The third equation is the interest-rate equation that links the
interest rate to inflation and other factors u. Think of
u as capturing surprise movements in the interest rate due to
monetary policy.

The first three equations will be recognizable to specialists as
the output gap Euler equation, a version of the New Keynesian
Phillips Curve, and a version of the Taylor rule.

The final two equations specify that the state variables z
and u follow autoregressive processes, albeit in logarithms.

The last line contains the options. We tell dsgenl which roles
each variable plays in the model. The options are
observed(r p), unobserved(x), and
exostate(z u). exostate() stands for exogenous state
variables. endostate() variables are also a possibility, but
this model does not have any.

Parameters beta and phi can be interpreted in terms
of economic theory. Let's start with phi. It is the price
adjustment parameter that is linked to the slope of the Phillips
curve. Some theories predict it will be zero, and others predict
that it will be positive.

Concerning beta, 1/beta is the inflation response
coefficient in the Taylor rule. The point estimate for
1/beta is about 2, in line with results from the literature.

An impulse–response function traces out how shocks to state
variables propagate through the model. We mentioned that
state variable u can represent the stance of monetary policy.
Let's see how an unexpected tightening of the policy, say, a
surprise increase in interest rates, influences other variables.

We find that monetary tightening leads interest rates to rise. As a
result, inflation falls and the output gap falls. Thus, the model
predicts a recession in response to a surprise increase in the
interest rate.

Let's see it work again

dsgenl has lots of postestimation features. We can use them
after estimation to view the steady state vector, the policy
matrix, and the state-transition matrix.

Consider a variant on the neoclassical growth
model. It describes relationships among GDP, the major components
of GDP like consumption and investment, and factors of production
like labor, capital, and productivity.

The above command would fit the model, but that is not what we
are going to do. We are going to solve the model at values of
the parameters, namely values common in the literature, which are

{beta} = 0.99
{alpha} = 0.36
{delta} = 0.025
{chi} = 2
{rho} = 0.9

To do that, we will create a parameter vector in Stata.
The vector will contain values. The order in which we
specify the values will not matter, because Stata vectors have
row and column names associated with them, and we set the
appropriate column names.

If you were interested in this model (some people are), the values
just reported might interest you. Or ratios of the values would be
of interest, such as the consumption-to-output ratio of roughly
75%.

The policy and state-transition matrices are approximations to
the model's policy and state-transition functions. They display
the impact effects of a change in a state variable on the
control variables and on the expected future values of the state
variables.

Here is the policy matrix. We specify option compact to
report results more densely.

. estat policy, compact
Policy matrix

k z

c

.5659819 .2928678

i

-.8879074 5.284044

w

.4538247 .6779014

h

-.2606242 .8947184

r

-.8067995 1.57262

y

.1932005 1.57262

These values reported are percentage deviations from steady state.

The last row of the second column is the impact of
z on y, or productivity on output. 1.57262 means that
when productivity rises by one percent, output y rises by 1.57
percent.

Here is the state-transition matrix:

. estat transition, compact
Transition matrix of state variables

k z

k

F1.

.9528023 .1321011

z

F1.

0 .9

The transition matrix reports what is expected to happen if
a state variable rises by 1% today. For instance, if z
(productivity) rises, the next period's k (capital expenditures) are
expected to rise by 0.13%.

Finally, we view dynamic effects by graphing the impulse–response
function. The first command calculates the impulse–response function
for 20 periods in the future, and the second command graphs it.

The vertical distances are percentage deviations from steady-state
values. The impulse is to z (productivity). We see the
response of z itself in the bottom-right panel. After a shock,
productivity declines smoothly back to its steady-state value.

Consumption's (c) response is interesting. Given an impulse,
consumption rises for multiple periods before declining back to
the steady state.