22. Surprises and announcements

A shock can arrive in two ways. Either nobody saw it coming, or it was announced some periods before it landed. The paths differ, and a simulation that cannot tell them apart is answering a different question from the one that was asked.

A plan entry carries two coordinates: the date, which is when the information arrives, and the page, which says how far ahead of the landing it arrives.

page 1   agents learn at the date that the shock hits that same date
page k   agents learn at the date that the shock hits k-1 later

22.1. The default is perfect foresight

A plan whose entries all sit on page 1 keeps a single page, and a single page is one stacked solve over the whole span. Everything in it is known from the first period. That is what perfect foresight means, and it stays the default:

p = simplan(m, [0, 40], 1);
p = append(p, 'EfficiencyInnovation', 5, -0.10);

The path begins to move immediately, because the fall at date five is already known at date one.

22.2. Asking for a surprise

To solve period by period instead, each period seeing only what is known then, ask for it:

p = simplan(m, [0, 40], 1, 'recursive', true);
p = append(p, 'EfficiencyInnovation', 5, -0.10);

Now nothing moves before date five. The recursion is what gives a page-1 entry its surprise meaning: with one information set there is no difference between a surprise and a shock seen coming.

22.3. Announcing a shock

A page beyond the first announces:

% at date 5, agents learn that the shock hits at date 7
p = append(p, 'EfficiencyInnovation', 5, -0.10, 3);

The path moves at date five, when the announcement arrives, and again at date seven, when the shock lands.

The plan owns the horizon. Appending on a page the plan does not yet have adds the pages that announcement needs, so solve_shock_horizon does not have to be set on the model. The pages added are copies of the page the constructor laid down, so a grown plan and a plan built wide hold the same array and no conditioning is invented.

22.4. The three information structures side by side

The same shock, the same date, three ways of knowing about it:

Information

Path first moves

Shock lands

perfect foresight

period 1

period 5

surprise

period 5

period 5

announced two ahead

period 5

period 7

Reproduced by rise-modern-tutorials/WorkingWithAModel/anticipation.

22.5. What a recursive pass can and cannot see

At each period the solver is given what is known then, and nothing else.

A future shock is hidden. Page 1 at a later column is what will be realized there, which the agent at the current date does not know, so it is dropped from the window. Two pages are enough for this whatever the distance between the current date and the shock.

A future endogenous target is not hidden. A target on a future endogenous cell is not a realization the economy springs on anyone; it is a restriction the forecaster holds from the outset. Conditional forecasting therefore behaves under a recursive plan as it does under an ordinary one.

A freed instrument stays free. Freeing a shock so a target can be hit leaves an empty page-1 cell, and the announcement pages do not pin it back.

22.6. Under simulate

Everything above is about perfect_foresight. simulate and forecast use a stochastic solution, which agents cannot see past, so a page-1 entry is a surprise there whether the plan is recursive or not. A page beyond the first announces a shock the solution must anticipate: a plan with N pages needs the model solved with solve_shock_horizon of at least N-1, and simulate refuses it otherwise (RISE:simulation:planExceedsShockHorizon). A recursive plan carries a second page, so the rule applies to it too.

A solve paradigm (option solve_paradigm, for example the piecewise-linear paradigm) also steps with the shocks of the model’s own horizon. A later page that announces nothing, such as the second page of a recursive plan, is dropped, so the recursive plan runs as surprises and gives the path of the single-page plan. A page that announces something beyond the horizon is refused (RISE:simulation:planExceedsParadigmHorizon).

22.7. How an announcement evolves: pages and revisions

Under simulate, forecast and filter an announcement is an expectation, and an expectation can be revised. In RISE (Maih [2015]) every anticipated shock follows one law of revisions. The risk terms of the solution, the simulation and the draws of a plan use it at every order; the filter and the forecasts from data use it at first order.

Pages. The model file is not changed, and no state is added to it. Each shock \(j\) has its own anticipation horizon \(h_j\), its solve_shock_horizon. A scalar gives every shock the same horizon; a struct (struct('EA', 2)) or a two-column cell ({'EA', 2}) sets the shocks it names and keeps the horizons of the others. A shock never named has horizon 0; under regime switching a shock takes its largest horizon over the regimes. In period \(t\) agents hold \(h_j+1\) pages of the shock,

\[e_{j,t|t},\; e_{j,t+1|t},\; \dots,\; e_{j,t+h_j|t},\]

what they expect it to be in period \(t\) and in each of the \(h_j\) periods after it. In a plan these are pages 1 to \(h_j+1\). The solution takes them as arguments,

\[x_t = T\left(x_{t-1},\, e_{t|t},\, e_{t+1|t},\, \dots,\, e_{t+k|t}\right), \qquad k=\max_j h_j ,\]

and print_solution lists them as E, E{+1}, …, E{+h}. A shock that is not anticipated has its current page only.

Revisions. In the next period each page moves one period closer and takes a revision:

\[e_{j,t+1+b|t+1} = e_{j,t+1+b|t} + \nu_{j,t+1}^{(b)}, \qquad b=0,\dots,h_j ,\]

where \(e_{j,t+1+h_j|t}=0\): the farthest page is a new announcement. The revisions are independent across shocks, pages and periods. Each has the law of its shock: mean zero and standard deviation one, as every shock in RISE, and the higher moments that solve_user_defined_shocks gives, if any. The shocks that enforce constraints are solved, never drawn, and take no revisions. Three consequences:

  • An announcement need not come true: a later revision changes it or cancels it.

  • The shock delivered in period \(t\) is the sum of the \(h_j+1\) revisions its pages received, from its first announcement in \(t-h_j\) to period \(t\): \(e_{j,t|t}=\sum_{b=0}^{h_j}\nu_{j,t-b}^{(b)}\). Its variance is \(h_j+1\) shock variances; page \(b\) has \(h_j+1-b\). Over 20,000 simulated periods of a shock anticipated 2 periods, the three pages have variances 3.05, 2.01 and 1.02. With the same loading in the model’s equations, a longer horizon therefore also delivers a more volatile shock: the horizon does not rescale the variance. A simulation that starts with nothing announced reaches these variances from its period \(h_j+1\) on.

  • The first-order solution uses only the expected pages of the next period, today’s pages moved one period closer: it does not depend on the law of the revisions.

The state. At first order, with \(P_t\) the pages of period \(t\), \(S\) the shift that moves them one period closer, \(D\) the map that puts the revisions \(\nu_t\) on the pages each shock’s horizon covers, \(T_x\) the transition of the state and \(B\) the loading of the pages,

\[\begin{split}\begin{pmatrix}x_t\\P_t\end{pmatrix} =\begin{pmatrix}T_x&B\,S\\0&S\end{pmatrix} \begin{pmatrix}x_{t-1}\\P_{t-1}\end{pmatrix} +\begin{pmatrix}B\\I\end{pmatrix}D\,\nu_t .\end{split}\]

It is the state of the same model written with the pages as endogenous variables and the revisions as its shocks. For one shock anticipated 2 periods:

A0 = A1{-1} + V0     the shock delivered today
A1 = A2{-1} + V1     the page for the next period
A2 = V2              the new announcement

RISE carries this state itself; the model is written without it.

Simulation and plans. simulate draws the revisions and carries the pages. In a simulation plan an entry that is set is a level: it replaces the carried page. An entry left free carries the page, with a revision drawn under simul_shock_uncertainty = true and a zero revision otherwise. On the model of the tutorial, an innovation EA anticipated 2 periods, with simul_shock_uncertainty = false:

p = simplan(m, [0, 6], 1);

% date 1: EA will be 1 at date 3
p = append(p, 'EA', 1, 1, 3);

% date 2: the announcement is revised to 0.5
revised = append(p, 'EA', 2, 0.5, 2);

% date 3: the announcement is cancelled
cancelled = append(p, 'EA', 3, 0, 1);
Z discounts expected activity (model units)

Plan

EA delivered at date 3

Z at dates 1, 2, 3

announced

1

0.147, 0.164, 0.182

revised at date 2

0.5

0.147, 0.082, 0.091

cancelled at date 3

0

0.147, 0.164, 0

announced, plan built with 'shockInit', 'zero'

0

0.147, 0, 0

An entry that 'shockInit' sets is a level too: 'zero' sets every page of every date, so the zero of date 2 replaces the announcement of date 1. Leave 'shockInit' out to let the pages carry.

Impulse responses. irf announces one unit and lets no revision follow. Its path is that of the announced plan above: with irf_shock_date = 3, the largest gap is 0.

Risk at order two and above. The risk terms of the solution (the derivatives in \(\sigma^2\), \(\sigma^3\), …) are made of the moments of the revisions. Each page that a shock’s horizon covers takes its own independent innovation, \(\sum_j (h_j+1)\) of them, and a joint moment of any order is the product of single moments. A shock that is not anticipated takes one innovation, whatever the horizons of the other shocks. In the tutorial, \(X_t=\rho X_{t-1}+s_a E^A_t+s_s E^S_t\) with \(E^A\) anticipated \(h\) periods and the surprise \(E^S\), and \(Y_t=\beta Y_{t+1}+X_t^2\). From a period with nothing announced, the shock \(E^A\) delivered \(i\) periods ahead still has \(\min(i,h+1)\) revisions to come, so with every shock and page at zero the order-2 solution gives

\[Y = \frac{s_a^2\sum_{b=0}^{h}\beta^{b+1} + s_s^2\,\beta} {(1-\beta)(1-\beta\rho^2)} .\]
Y at order 2 with every shock at zero (model units; \(\rho=0.5\), \(\beta=0.9\), \(s_a=s_s=0.1\))

Horizon of \(E^A\)

0

1

2

3

both shocks

0.232258

0.336774

0.430839

0.515497

the surprise alone (\(s_a=0\))

0.116129

0.116129

0.116129

0.116129

The values are those of the closed form to the digits shown. See also Higher-order perturbation.

Filtering and the likelihood. At first order the filter carries the pages as states, with the transition above. By default it starts the state and the pages from their joint stationary covariance; with an initial covariance set by the user (kf_user_init, or a scalar kf_init_variance), the pages start independent of the state, with their own stationary covariance. The likelihood is that of the model written with the pages as states: on 40 periods of X and Z in the tutorial, both give the log-likelihood 17.35616032 (gap 7e-15). The updated shocks hold the pages: f.Expected_updated_shocks.EA is a ts with \(h+1\) pages, page 1 the shock delivered, equal to the updated page states of the explicit model. The data reveal pages through the variables that look ahead (Z in the tutorial): data on X alone say nothing about the pages still to come. With occasionally-binding constraints the filter integrates over the enforcement patterns of the window (kf_kink_density, on by default; see Over an anticipation window).

Forecasts from data. At first order, forecast and simulate from a database that holds an observable of the model (simul_historical_data with simul_history_end_date) filter the data up to that date and start from the updated pages there, each parameterization from its own. A filter that fails there stops the call (rise:forecast:pageFilter). Without shock uncertainty the revisions are zero, so the announcements the data reveal are delivered as they stand; with simul_shock_uncertainty = true revisions are drawn on top of them. In the tutorial the forecast of X one period after the history is \(\rho X_T + s_a\) times page 2, -0.2721 against -0.2513 for \(\rho X_T\) alone. A plan passed in simul_historical_data supplies its own pages.

Reproduced by rise-modern-tutorials/WorkingWithAModel/announcement_revisions. Tests: models/dsge/solving/anticipated_revisions, models/dsge/simulation/page_window, models/dsge/simulation/anticipated_runtime and models/dsge/filtering/TestCarriedPageLikelihood.m.

22.8. Impulse responses

irf places a shock and the information about it. It knows nothing about how the constraints are enforced.

The date of the impulse. The impulse is announced in period 1 and hits in period irf_shock_date. The default is 1, a surprise in the first period. The date goes from 1 to k+1, where k is the largest anticipation horizon of the model’s shocks (solve_shock_horizon, the fudge shocks of the kinks included). A later date is refused before anything is simulated (RISE:irf:shockDateBeyondHorizon), and the message names the limit.

What agents see of it. Each shock j has its own horizon k_j, its own solve_shock_horizon. At date t agents see the impulse to shock j only if it is due within k_j periods. An impulse announced further ahead than k_j moves nothing before period irf_shock_date - k_j.

Whether they act on it. irf_anticipate (default true) says whether agents act on the announcement. With false they ignore it, and the impulse is a surprise in period irf_shock_date. The solution keeps its anticipation either way, so the fudge shocks still enforce the constraints in expectation.

The example is the model of the tutorial, nk_zlb. Its policy rate obeys R = max(0, RSTAR), held by a fudge shock, here anticipated 12 periods, and the demand shock E_D is anticipated 4 periods. So k is 12, and an impulse to E_D can hit in periods 1 to 13.

m = dsge_model('nk_zlb');
exo = get(m, 'exo_list');
fudge = exo{startsWith(exo, 'FUDGE_FACTOR_')};
m = set(m, 'solve_shock_horizon', {fudge, 12; 'E_D', 4});

% a surprise in period 1
a = irf(m, irf_shock_list = {'E_D'});

% announced in period 1, hits in period 5
b = irf(m, irf_shock_list = {'E_D'}, irf_shock_date = 5);

% announced 8 periods ahead, seen 4 ahead: nothing moves before period 5
c = irf(m, irf_shock_list = {'E_D'}, irf_shock_date = 9);

% the announcement ignored: a surprise in period 5
d = irf(m, irf_shock_list = {'E_D'}, irf_shock_date = 5, ...
    irf_anticipate = false);

Call (E_D anticipated 4 periods, k = 12)

Path first moves

Shock lands

default

period 1

period 1

irf_shock_date = 5

period 1

period 5

irf_shock_date = 9

period 5

period 9

irf_shock_date = 5, irf_anticipate = false

period 5

period 5

A generalized impulse response follows the same date and the same rule. Its draws are seen within their own horizons, and the constraint-enforcing shocks are not drawn: a draw of a fudge shock would be noise in its equation, not information. A cocktail of shocks (irf_shock_sign as a structure) hits at the same date, each shock seen within its own horizon.

Reproduced by rise-modern-tutorials/WorkingWithAModel/irf_timing. Its section 4 runs one fall in demand, hitting in period 5, anticipated or a surprise, with the zero lower bound enforced and switched off (simul_disable_constraints = true).

22.9. Earlier responses

Before irf_shock_date, irf placed every impulse in period k+1 and announced it in period 1. Two of its responses come back exactly with options:

Earlier response

The same numbers today

Every shock anticipated the same k periods (solve_shock_horizon a scalar k)

irf_shock_date = k+1

irf_anticipate = false, which removed all anticipation, the fudge shocks’ included

Solve with solve_shock_horizon = 0 and keep the default date: the same response, starting in period 1 instead of period k+1

When the shocks have different horizons and a constraint is enforced, the earlier responses moved before a shock with a shorter horizon was due: the enforcement read the impulse further ahead than the shock’s own horizon. Those responses have no equivalent. Only the shock and the news of it move the economy.

22.10. Compared with splitting into frames

Another way to do this is to split the span at each surprise date, solve each segment forward with later surprises zeroed, and splice the pieces.

The recursion here is the same construction, generalized. Instead of splitting at break points it visits every period, and where nothing new arrives it shifts the previous solution one period left rather than re-solving. In a deterministic problem that shift is exact, so the answer is the same and the work is strictly less.