1.4. Fast estimation kernel
Every evaluation of the posterior during estimation rebuilds structures that do not depend on the parameters: the steady-state scaffolding, the filter initialization frame, index maps. On small and medium models that rebuilding costs more than the mathematics. The fast estimation kernel builds those structures once, when the objective is created, and evaluates each draw with only the work that depends on the parameters.
It is a performance path, not a different computation. Every value it returns is identical, bit for bit, to the value of the generic objective, and a configuration it does not replicate is refused rather than computed differently.
1.4.1. Turning it on
The kernel is opt-in, through the option estim_fast_kernel:
Value |
Effect |
|---|---|
|
Normal RISE behaviour: the generic objective. |
|
The fast kernel with its default settings. |
a settings struct |
The fast kernel with modified settings (see below). |
The option applies wherever the posterior objective is built:
m = estimate(m, estim_fast_kernel = true);
f = pull_objective(m, estim_fast_kernel = true);
Posterior maximization reaches the same mode, with the same number of
function evaluations, through either path. Because the cost of an
evaluation is also the cost of a draw, samplers built on pull_objective
benefit in the same proportion.
1.4.2. What it honours
Choices that change the posterior belong to the model, and the fast kernel replicates them rather than setting them:
Filter initialization.
kf_init_variance = [](the ergodic, Lyapunov initialization, the default) and a positive scalar (Harvey’s large-variance initialization) are both replicated.Steady-state semantics. With
sstate_imposed = truethe analytic steady state is checked and a failed check rejects the draw. Withsstate_imposed = falsea failed check starts the same numerical rescue as the generic path.Derivative routines.
solve_function_modemay be'explicit'or'disk'.Regime switching with exogenous, constant transition probabilities.
1.4.3. When a model does not qualify
The fast kernel requires a first-order solution with symbolic derivatives and an analytic, non-loop steady-state file. It does not replicate, and so declines:
the exact diffuse initialization (
kf_init_variance = 'exact') and a user-supplied filter initialization (kf_user_init);measurement errors, observed exogenous variables and a user filtering algorithm (
kf_user_algo);linear, nonlinear or general parameter restrictions, endogenous priors and DSGE-VAR priors;
maximum likelihood (
estim_mle), Fisher scoring and runs that skip the likelihood (estim_eval_lik = false);endogenous switching, time-varying transition probabilities, anticipated shocks, occasionally binding constraints, optimal policy and real-time data.
A model that does not qualify falls back to the generic objective.
fast_kernel_check prints every condition and its verdict:
fast_kernel_check(m) % with the option at its default
fast_kernel_check(m, true) % as it would be evaluated when requested
With the option at its default the first row reports that the kernel was not requested, and the summary still says whether the model qualifies.
1.4.4. The settings struct
rise.engine.dsge_tools.estim.fast_kernel_settings() returns the default
settings; modify the fields you need and pass the struct as
estim_fast_kernel.
Field |
Default |
Meaning |
|---|---|---|
|
|
Master switch inside the struct. Passing a struct is itself a request, hence the default. |
|
|
What happens when a model does not qualify: |
|
|
Build the steady-state scaffolding once rather than on every draw. |
|
|
Build the filter initialization frame once rather than on every draw. |
|
|
Run the constant-parameter Kalman recursion inline rather than through the general filter engine. |
Every field is a performance choice: no combination changes a result. That makes the struct a measurement instrument. Switching one stage off measures what that stage buys.
1.4.5. What to expect
The fast kernel removes a cost that is roughly fixed per evaluation, so its effect is largest where that cost dominates. Measured ratios of the generic to the fast objective were about 3 on fs2000, about 2 on Smets and Wouters (2007) and on a regime-switching fs2000, and about 1.9 on a 160-variable policy model.
On larger models two ordinary model options often matter as well, with or without the fast kernel:
solve_function_mode = 'disk'writes the derivative routines to disk. It changes no result, and on the 160-variable model it cut the cost of an evaluation by 12 to 18 percent.solve_accelerate = trueeliminates the static variables before the QZ decomposition. It is a numerical choice: posterior values moved by about 1e-8 out of 2750 on that model. It pays when many variables are static.
See the tutorial Estimation/fast_kernel/howto.m.