18. Entropic tilting
A survey, a nowcast, or a policymaker’s judgment says something your model cannot see. You do not want to re-estimate the model, and you certainly do not want to re-specify it. You want the forecast to respect that information and to change as little as possible otherwise.
That is entropic tilting. It takes the model’s forecast density and reweights its paths so the density satisfies your views, choosing the weights that move the density least in the Kullback–Leibler sense. The model is not touched. Only the weight on each simulated path changes.
out = rise.scenario.tilt(m, {"PAI", 4, "mean", 0.5});
This call asks that inflation four periods out average 0.5. The value
is taken as it is, in the units of the simulated variable: it is a level,
not a shift from the forecast nor a number of standard deviations. A view stated
relative to the model’s forecast is built from the paths themselves. Here
the density is simulated first, 2000 paths of 8 periods, and the view puts
inflation four periods out half a standard deviation above the model’s own
forecast:
T=8;
N=2000;
ens=struct(PAI=zeros(T,N));
for i=1:N
db=simulate(m,simul_periods=T,simul_burn=0);
pai=double(db.PAI);
ens.PAI(:,i)=pai(end-T+1:end);
end
base=ens.PAI(4,:);
out=rise.scenario.tilt(ens,{"PAI",4,"mean",mean(base)+0.5*std(base)});
Here is what it reports, on a small New Keynesian model (the worked example in the RISE cookbook):
Entropic tilt
----------------------------------------------------------
paths 2000 over 8 periods
moment rows (one tilt) 1
largest miss 6.500e-13
divergence from the base 0.1264
effective sample 77.9% of the paths
----------------------------------------------------------
18.1. The target vocabulary
Each view is one row of four: {variable, horizons, moment, value}.
mean the average of the variable at each horizon given
std its spread, holding the mean where the density puts it
var the same, given as a variance
pathmean one number: the average across the horizons given
terminal the value at the last horizon given
cov co-movement of a pair: {["PAI","Y"], 1:4, "cov", z},
their covariance at each horizon, averaged over the
horizons given
targets = {
"PAI", 4, "mean", 0.5 % one horizon
"Y", 1:4, "mean", [0.2 0.1 0.0 -0.1] % a path
"PAI", 8, "std", 1.2 % a risk view
};
A std or var view also pins the mean at that horizon — where you put it
with a mean (or terminal) row, wherever that row sits in the list, or
where the density already had it. Otherwise the spread could be met by sliding
the center, which is not what you asked for. A cov view pins the means of
both variables at its horizons in the same way, so it asks for a covariance and
not for a raw cross moment: shifting a variable by a constant changes nothing.
18.2. One tilt, never several
An ensemble of paths is a joint distribution over the whole horizon, not one density per period. So views on several horizons, or several variables, are several rows of one moment vector, solved once, giving one weight per path.
Tilting one period at a time would give each period its own weighting of the
same paths, and the resulting “density” would not be a density of anything.
tilt does not let you do that: every row you give joins the same tilt.
18.3. Reading the diagnostics
divergence from the base is what the tilt cost: the Kullback–Leibler divergence of the tilted density from the one the model produced. It is the number to compare across views.
effective sample is the fraction of the paths still carrying weight,
1 / (N * sum(w.^2)). A tilt carried by a handful of draws is noise wearing a
distribution’s clothes.
largest miss is how far the achieved moments sit from your targets.
What these show in practice, on one density:
view divergence ESS
inflation +0.5 sd at h4 0.1264 77.9%
output +0.3 sd over h1-h4 0.0716 86.7%
inflation spread x1.5 at h6 0.2049 38.6%
inflation up, output held 0.3719 39.5%
Three lessons are in that table.
A path of modest views can be cheaper than one bold point view. The four output views move together, so the density meets them without much reweighting.
Spread costs more than location. Widening the band means leaning on the tails, and the tails are thinly populated.
A view that disagrees with the model’s structure is expensive, and the divergence tells you so. In this density supply shocks dominate, so higher inflation comes with lower output — pushing inflation up alone drags output from +0.04 to −0.78. Holding output where it was while inflation rises asks for demand-driven inflation the density rarely produces, and costs three times the point view.
That last one is worth taking seriously. When a tilt is expensive, the model is telling you that your view and its mechanism disagree. Tilting will still deliver the numbers — but the next question is whether the model is missing something, which is a different rung of the ladder.
18.4. What it refuses
Weights that sum to one can look well formed even when a view is out of reach.
Handed a target of 50 against an ensemble spanning roughly [-3, +3], the
solver underneath puts every bit of the weight on a single path and achieves
+3.2. It reports that miss as OPTIM_NOT_A_ROOT and returns empty
weights, including when no status output is requested. Nonfinite or complex
numerical evaluations return TILT_MOMENT_FAILURE. The public scenario
interface returns an empty result for an unmet target or inadequate effective
sample fraction (TILT_EFFECTIVE_SAMPLE_SMALL). Input errors remain errors;
see Numerical failure statuses. It checks:
noTargets no views given
unknownVariable a name the density does not carry
horizonOutOfRange a horizon beyond the density
targetCountMismatch values do not match horizons
unknownMoment not one of the six moments above
badTargetShape a row that is not four entries
covNeedsTwo a cov view with one variable
badTargetValue a value that is not a finite real number
negativeSpread a std or var view below zero
These input errors carry the prefix RISE:scenario:. A miss or an effective sample that is
not a number counts as a failure, and MinESS must lie in (0, 1].
18.5. Options
Nsim paths to simulate when source is a model (default 2000)
Horizon periods to simulate (default 12)
MinESS refuse below this effective-sample fraction, in (0, 1]
(default 0.05)
Tolerance how closely targets must be met (default 1e-6)
Seed random seed for the simulated density
Print show the report (default true)
source may also be an ensemble already in hand, a struct of
varname -> [T x N]. Use that to tilt the same draws several ways and
compare their costs, as in the table above.
18.6. Fan charts from the result
The weights plug straight into weighted quantiles:
q = utils.entropic_tilting.weighted_quantile(draws, [0.05 0.5 0.95], out.Weights);
A quantile is the smallest value whose cumulated weight reaches the level, among the values that carry weight: level 0 gives the smallest of them and level 1 the largest. The weights need not be normalized, but they must be finite and nonnegative.
18.7. References
Krüger, Clark and Ravazzolo (2017), “Using entropic tilting to combine BVAR forecasts with external nowcasts”, Journal of Business & Economic Statistics 35(3), 470–485.
Robertson, Tallman and Whiteman (2005), “Forecasting using relative entropy”, Journal of Money, Credit and Banking 37(3), 383–401.
18.8. See also
Scenario plausibility — the next rung: forcing a path through the shocks, and pricing what that does to the model
18.9. Forecast-struct utility
utils.entropic_tilting.tilt_scenario accepts the simulated paths directly.
Every field is a periods-by-draws matrix. Its moment callback receives one
variables-by-periods path, with variables in fieldnames(forecasts) order.
The target is an absolute moment value in the same units.
forecasts=struct('a',[1,2,3;4,5,6],'b',[10,20,30;40,50,60]);
[weights,means,retcode]=utils.entropic_tilting.tilt_scenario(...
forecasts,@(path)path(1,1),2);
% weights is3-by-1; means.a is[2;5] and means.b is[20;50].
The cube preserves the original period and draw positions, including a
single period or a single draw. The returned weights are a column, and each
weighted forecast is a periods-by-one column. If finite moments cannot meet
the target, weights and means are empty and the third output is
OPTIM_NOT_A_ROOT. Weights that fail the core moment tolerance are not returned as an accepted forecast.