3. What’s new
This page records user-visible changes to the modern RISE Toolbox – new features, behavior changes, and things you may need to know when upgrading. Newest entries go on top.
Note
This page covers the modern toolbox only. The legacy toolbox
(RISE_Tbx_Beta) has its own release notes in rise-stable-docs;
the two are never mirrored into each other.
3.1. Unreleased
Fixed: the public global-methods solve succeeds. A solve through
set(m,'solve_paradigm',{@gm.paradigm,'grid',G})was always refused (GM_INVALID_CONFIG, 40): its certificate required evidence from refined and enlarged solves that no driver produced. The certificate now checks the one solve it receives, with every single-solve accuracy, feasibility and coverage check kept;gm.certify_stabilityis removed. The README and Global methods describe the current call, with a checked example. See Global methods.Fixed: MW with a chain left unperturbed, and the isolated M variant, carry the two first-order terms of a switch at the expansion point. With
{'mw',mkv_list}leaving out a chain whose regimes have different steady states, and with{'m','isolated'}, the regime steady states are not rest points of the switching economy. The first-order constant used each regime’s own residual, zero by construction, and no lead shift: the solution returned each regime’s steady state as if the regime were permanent (on an affine model with intercepts 0 and 1, settled values 0 and 5 instead of 0.144 and 4.711). The constant now takes the residual of the expected system at the regime steady states and the lead after a switch is the next regime’s policy from today’s state. With every chain unperturbed, affine models are exact at every order. Plain'mw'and fully perturbed partitions are unchanged. The fast estimation kernel computes the same terms. See Perturbation types for regime-switching models.Changed: the M variant is chosen by position, and ‘maih’ is ‘m’.
{'m','isolated'},{'m','curvature'}and{'m','joint'}select the three versions of perturbation M; bare'm'is{'m','curvature'}. Settings may follow the variant, for example{'m','joint','Continuation',false}. The isolated variant takes no setting, andContinuationapplies to the joint variant only.'maih', the full name of'm', is accepted wherever'm'is and means exactly the same. The keysExpansionPointandHigherOrdersare retired: a new call that uses them stops with a message that gives the positional form ({'m','ExpansionPoint','regime_steady_state'}becomes{'m','isolated'};{'m','HigherOrders','joint'}becomes{'m','joint'}). Saved models are translated on load: a saved bare'm'or'maih'is today’s default, and its stored policy is solved again at the next solve; saved settings with the former keys become the matching variant. The isolated variant’s label ism{isolated}. See Perturbation types for regime-switching models.Fixed: the switching filter starts each regime from its own transition and shock loadings. The initial covariance of a switching filter averaged the shock loadings of the regimes; their cross-regime products made the likelihood, the filtered and smoothed variables and the regime probabilities move when the shocks of a regime were rotated. Initialization now uses the averaged covariance of the shocks, \(\sum_r \pi_r R_r R_r'\), and the first prediction in regime \(r\) the transition and the loadings of \(r\); with one regime nothing changes. The filter likelihood of switching models changes, and a search of it can end at another mode. For switching models, initialization uses a reference covariance from the probability-weighted transition and regime innovation covariances, followed by a regime-specific first prediction. This approximation is rotation-invariant; it is not the exact regime-conditional stationary covariance of the switching process. See Diffuse initialization.
Fixed: smoothed regime probabilities retain unit mass at roundoff discrepancies. The backward smoother previously skipped normalization when the discrepancy was small, allowing an almost-certain regime to exceed one. It now normalizes by the computed marginal mass and applies the same scaling to backward history weights. The likelihood is unchanged.
Fixed: one identification per parameterization for VARs identified by sign and zero restrictions.
identifyleft the model unsolved, and every consumer of it (solve,irf,historical_decomposition,variance_decomposition, …) searched a rotation of its own: the outputs of one model could rest on different identifications, or one of them on none (code 801). The search of a regime now draws its candidates from a stream of its own, seeded by a seedidentifytakes from the global generator and by the bits of the parameter values the regime sees;solvestores the rotation with the solution, an estimation stores that of its estimate and filters its shocks with it, and every consumer reads it. The reported likelihood and filtration come from the same final pass. A posterior or bootstrap draw finds the same rotation wherever it is solved, for bit-identical values, and a failed search gives every consumer the same code. Constructing a sign/zero-restriction identification engine consumes one globalrandicall to choose its seed; subsequent rotation searches use private streams and do not advance the global generator. LPidentified_setuses its own supplied/default seed and leaves the global generator unchanged. Serial execution and process-based parallel pools are validated for reproducible rotation searches. Thread-based pools have not been validated and are outside this guarantee. A candidate whose column has the wrong sign is negated instead of thrown away when the proposal is symmetric under that negation (agnostic, or no zero restrictions), which leaves the law of the accepted rotations unchanged: with one sign restriction on each of twelve shocks, a search failed at the defaultmax_trialsone time in four, and now finds a rotation at the first candidate. On a proxy SVAR the restrictions identify the shocks the proxies do not instrument, and the likelihood does not change. Results under agnostic sign restrictions move to another admissible rotation.identifyrefuses a DSGE-VAR, which is identified by its DSGE. See Reduced-form VAR Modeling.Changed: the mode search no longer stalls against the points the model rejects; a switching model starts from its constant-parameter mode. Just beyond the stability boundary, where the kernel can still be evaluated (a VAR), the search sees it continued minus a penalty growing with the radius, and the estimate is still stable. Elsewhere every rejected point is valued above every accepted one and ranked by how far it is from passing (the steady-state residual, the misplaced root, the radius, …); a failure without a measure is a wall. The samplers and the posterior are unchanged, and every shipped optimizer respects the bounds (
wcsminweldid not). A regime-switching model whose start does not distinguish the regimes first searches its constant-parameter version, then separates the regimes deterministically: one start, one switching search. Withestim_barrierfalse, the restrictions thatfminconorbee_gateenforce are among the checks the estimate passes. The estimation sets noTypicalX, MATLAB’s option; RISE’s own optimizers refuse it. See Posterior maximization.Changed: above the first order, a fully observed model takes the direct likelihood when its shock map is proved to have a closed-form density.
The direct route recovers the shocks of every period from the data. It applies to two classes of maps, proved from the structural metadata of the model:
class A, affine maps: every first-order model as before, and above it models affine in the endogenous variables and the shocks, with coefficients that observed exogenous variables do not change;
class B, triangular maps affine in each pivot shock: forward substitution with certified bounds (code 316 above 1e-8, 318 for a zero pivot, 320 when the solution contradicts the proof).
Everything else is unproved, not shown non-injective, and goes to the filter with the reason. With
simul_pruned, the class-B likelihood is that of the pruned simulation: exact with one regime given its initial split, IMM with several. Other pruning callbacks are refused.When the regime sum underflows, it is taken in logs over the regimes with mass. A valid log likelihood of -800 no longer fails. The filter labels are
'kalman'and'nonlinear_filter'; RISE has no particle filter.A non-finite likelihood gives 312, whichever filter returned it. In imm, a covariance that is not positive definite in the constrained update, or near a kink with
kf_kink_density, gives 305 instead of another update. See Direct likelihood of fully observed models.Fixed: the identified set of a local projection leaves the global random generator as it is.
rise.engine.var.lptools.identified_setreseeded it with itsseedand advanced it; its draws, the same numbers, now come from a stream of their own. See Local Projections.New: sample_posterior samples every VAR, constant or switching. A Metropolis-within-Gibbs sampler for
rfvar_model,svar_model,prfvar_model(pooled) andproxy_svar_model, with any number of Markov chains, constant or time-varying transition probabilities, any prior and any restrictions: the regime path in one block, exact Dirichlet, normal, inverse-Wishart and inverse-gamma draws where the conditionals are closed form, random-walk Metropolis elsewhere (A0, time-varying transition probabilities, non-conjugate priors). Draws that are not mean-square stable are rejected (the default stability check).[mpost, draws, results] = sample_posterior(m, N, burnin = b, seed = s):resultsis in the format of the generic samplers.pull_objectiveandestimatesay when a model is covered. See Which sampler? in Posterior sampling.New: combined priors, normalized by Monte Carlo. A prior in
estim_priorson a parameter the VAR prior covers is combined with it (it was an error,setup_priors:VarPriorOverlap): the prior is the product of the densities, as with priors on the structural parameters of ansvar_modelwhose reduced-form VAR prior weighs them. The product is not normalized; RISE estimates its normalizing constant by Monte Carlo from draws of your priors (standard error of at most 0.01 on its log) and takes it out of the log prior, so that every marginal data density is that of the normalized prior.posterior_maximization.prior_normalizerreports it. A reduced-form VAR prior of ansvar_modelnow covers no structural parameter: a marginal data density needs a proper prior on every free structural parameter (before, the one reported with priors on A0 and sigma only was that of the unnormalized product). Switching models are covered as constant ones; priors on the values of two or more regimes that depend on values without a prior of yours (the variances of both regimes underniw) have no marginal data density, with the reason. See Combined priors in Reduced-form VAR Modeling.Changed: rise_smc starts from a proper distribution or refuses. Its chains start from iid draws of the prior (
logpriorwithprior_sampler) or of the uniform distribution on a finite box (lb,ub). Without one, or when the posterior is zero at every one of 200 draws of it (the bounds of flat priors), it refuses with the reason (rise_smc:noProperStart);compute_mddcannot be false. Before, it ran its first rung with one chain, or from draws of zero density, and the ladder failed without a word. See Which sampler? in Posterior sampling.Changed: the hyperparameters of the VAR priors have explicit names. Every factory of
rise.engine.var.var_priorsuses the same names:tightness(wasL1),cross_tightness(L2),lag_decay(L3),constant_looseness(L4; larger is looser),covariance_dummy_weight(L5),co_persistence(L6, the Sims-Zha dummy initial observation) andown_persistence(L7, the sum of coefficients). The Baumeister-Hamilton family ofgenerate_structural_prioruses the same names for itslambda0,lambda1andlambda3. The old names are refused, not aliased. Code that setminnesota’stightnessandlag_decay, its names before October 2026, runs again with today’s meaning. See Reduced-form VAR Modeling.Changed: estimation checks stability as solve does, for every model. With
solve_check_stabilitytrue, the default, every evaluation of the posterior kernel checks the mean-square stability of the solution: a point that is not stable gets code 25 and the search rejects it, so an estimated mode is mean-square stable. The least-squares estimate of a VAR without priors is refused when it is not (estimate:olsNotStable), and a reduced-form VAR with a root above one no longer solves with code 0. Setsolve_check_stabilityto false to estimate without the check. The check gives the verdict of the exact computation by the fastest route:eig(T)with one regime, the Arnoldi estimate with several, and the Kronecker algorithm near the criterion. See Failure diagnosis: diagnose(m) and friends.Changed: every VAR supplies its own solution, and the direct likelihood makes one matrix pass. The VAR classes, constant or switching, build their state space from their parameters, with the exact steady state of each regime, and
solver_usedreports'var_closed_form'. The direct likelihood of every fully observed linear model computes the densities of all periods at once. The results are unchanged to rounding; a kernel evaluation, the stability check included, is 13 to 43 times faster for a constant VAR and 2 to 500 times for a two-regime VAR whose dynamics switch. Options that ask for another solution (solve_orderabove 1,sstate_unique,'frwz', …) are refused with the reason. See Reduced-form VAR Modeling.Fixed: an automatic choice of the first-order solver is made at every solve. With the
solveroption empty, the choice (rise_1ormfi) is recorded with the solution instate_space{1}.solver, and the options keep what you set. It used to be written into the options, so a model re-solved where its regimes differ could keeprise_1and be solved as if each regime lasted forever. See Solving.Fixed: VAR marginal data densities no longer carry a density for the default flat priors.
A VAR prior (
estim_var_prior) gives every VAR parameter without a prior inestim_priorsa default flat prior. It was a N(0, 1e8^2) density, -19.34 per parameter, added on top of the VAR prior: every VAR marginal data density was too low by that much, lag selection by MDD favored short lags, and a switching VAR paid 19.34 per extra parameter. The default flat prior now has no density: each parameter’s prior density is counted once. The posterior mode does not move.A parameter that no prior covers makes the prior improper:
estimatereports no marginal data density and lists the parameters (posterior_maximization.improper_prior). This is the case ofminnesota(no prior on the covariance; useinw) and of ansvar_modelwithout priors on its free A0 entries (and on its shock standard deviations, under a reduced-form prior, which covers neither).A prior in
estim_priorson a parameter the VAR prior covers combines with it, normalized (see New: combined priors above). Templates declareuse_sigma_prior;user_definedhas an option of that name.
Changed: the Minnesota, inw and niw priors take the data and do not depend on its units; generate_niw_prior is removed.
minnesota(endo_list, constant_term, deterministic_vars, lags, data, ...)is scaled by the residual standard deviations of univariate AR fits, with the Sims-Zha hyperparameterstightness(overall),cross_tightness(cross-variable),lag_decay(harmonic lag decay) andconstant_looseness(constant and deterministic terms).tightnessandlag_decaykeep their names with that meaning.inwtakes the data; its defaults are the Minnesota prior and an inverse-Wishart centered at the AR residual variances.niwis the normal-inverse-Wishart (itsdfwas unused, and its density the conditional normal only); it replacesgenerate_niw_prior, with the optionsmean,Omega,scale_matrixanddf.
Fixed: the closed-form mode of a large VAR under an independent prior. The passes stop at the precision of the arithmetic: a 20-variable VAR in levels converged in 27 passes (2.7 s) where it gave up after 10000.
Changed: sample_posterior draws the coefficients and the covariance. A Gibbs sampler on the two closed-form conditionals replaces draws of the coefficients given the least-squares covariance;
niwis sampled too, and a model without closed-form conditionals is refused with the reason.Fixed: under regime switching a reduced-form VAR prior counts the density of each value once. The templates were evaluated at each regime’s reduced form and summed, so a block that does not switch (the covariance when the coefficients alone switch, say) was counted once per regime. The shared elements are now counted once and each switching block by its density conditional on them, through closed-form marginals of the templates (
log_marginal). A split with no closed form is an error;user_definedtakeslog_marginal_funcfor models whose parameters switch in part.Changed: the covariance search of a VAR starts at the AR residual variances under a prior without an inverse-Wishart. Under
minnesotathecovar_*parameters started at the identity, five orders of magnitude off on data in decimals; they now start at the residual variances of the AR pre-fit the prior is scaled on.Changed: L4 is a looseness in every VAR prior, default 100. The constant and the deterministic coefficients have a prior standard deviation of
sig_i*L4(given Sigma,sqrt(Sigma_ii)*L4), as in legacy RISE. The Minnesota family’s numbers do not change; the Sims-Zha priors held the constants at zero at the default and now leave them loose, so their estimates move.Changed: one AR pre-fit for all the VAR priors.
ar_residual_stdgives the residual standard deviations and, as a second output, the covariance of the residuals, which the Baumeister-Hamilton structural prior now uses (it had its own pre-fit). The residual variance is the mean of the squared residuals, the series are aligned on their dates, and a sample too short to scale the prior on is an error (it fell back on cruder scales).Fixed: no marginal data density from the mdd estimators under an improper prior. Every estimator of
rise.engine.mdd.mdd(MHM, bridge, IS, RIS, CJ, Mueller, SWZ, Laplace, Laplace-MCMC) returns NaN when the prior is improper, with the reason and the parameters, asestimatedoes for the Laplace approximation.mdd(draws,m)takes a RISE model’s kernel, bounds andimproper_prior.Changed: silent fallbacks of the VAR priors are errors. The
log_priorofgenerate_sims_zha_prioron a vector that is not vec(B), and a switching parameter whose chain the regimes table does not list, are errors with the reason.L2, which the Sims-Zha priors (reduced-form and structural) accepted and ignored, is no longer an option: a dummy-observation prior cannot tighten the other variables’ lags apart from the own lags.Fixed: M names, saved expansion fields, and the Table 4 comparator.
Public implementation names and diagnostics use M terminology. Numeric return codes are unchanged; former input names receive a migration error.
Loading saved expansion pages and engines translates former field names while preserving cached policies, constants, and resolving flags.
The Table 4 linear comparator explicitly uses its isolated reference steady state and checks solve and simulation return codes before indexing. Figure 6 uses the same declared reference expansion. Accuracy diagnoses failed solves and ergodic simulations directly instead of indexing empty data.
Derivative-only M requests remain available at common steady states; the refusal regression now uses a fixture with differing anchors.
Fixed: default M solves backward switching models and initializes analysis plans.
Backward-only first orders use their direct solution at the current parameters, including repeated solves with a previous policy guess.
Simulation plans explicitly request isolated steady-state defaults; common-anchor models continue to work with plain M.
Self-consistent M returns code 37 when a linear-quadratic policy solver cannot carry a predecessor-dependent promise block. The original diagnostic is retained in the model’s
m_failurefield.Fixed-reference steady-state tests and the Figure 5 linear comparator explicitly retain their regime-steady-state expansion convention.
Fixed: common steady states and saved configurations under default M.
sstateandsolve_derivatives_onlyaccept a common isolated steady state. Diagnostics, structural analysis, reduction and TeX reporting explicitly request isolated anchors when they need them.Loading an older plain-M or Maih model selects regime-steady-state M; older M settings translate to self-consistent M with their fields. Stored policies and calibration are preserved.
A failed definition along parameter-gap continuation returns its numerical error code and restores the original calibration.
Continuationis accepted only withHigherOrders='joint'; retired cell and options-object inputs receive migration diagnostics.
Changed: M uses self-consistent expansion points and inline settings.
Plain
mnow selects the existing self-consistent algorithm, withHigherOrders='curvature'as the default; choose{'m','HigherOrders','joint'}for the existing joint fixed point.{'m','ExpansionPoint','regime_steady_state'}reproduces former plain M, preserving isolated regime steady states and existingsstate_uniquebehavior. The numerical algorithms are unchanged.Settings are inline name-value pairs. Unknown, duplicate, invalid, and explicitly inactive settings are rejected. Former separate-method spellings, cell payloads, and constructor objects raise migration errors; there is no options object or separate old-M type.
Saved models preserve the chosen configuration; older expansion settings are translated on loading without changing cached policies. Repeating equivalent settings preserves the cache; changing configuration invalidates it. Accuracy reports use stored inline settings by default and label the default, joint, and regime-steady-state configurations separately.
Earlier release entries name retired spellings in words.
Changed: the global-methods paradigm is now ``gm.paradigm``.
The package is
paradigms/+gm; the formertinamespace has no alias. Paradigm optionsrepresentation(tensor,sparse,adaptive_local) andalgorithm(time_iteration) separate the policy representation from the numerical algorithm. Defaults remain tensor time iteration; numerical routines and return-code values are unchanged. Neural-network representations and residual-minimization algorithms are future extensions.Fixed: deferred Sylvester fallback blocks are checked before allocation.
When the total possible deferred-block storage exceeds 1 GiB at eight bytes per entry, the fallback is skipped and the iterative solver’s failed iterate and return code are retained. This matches the all-solutions candidate-storage allowance and does not bound total solve memory.
Fixed: perturbation reports assess and time the same solve.
Each requested type/order is solved once. The returned
modelsand signedresidualspreserve the policies and equation arrays assessed;solve_errorsretains thrown solve exceptions. Paths, defaults and residual arithmetic are unchanged.table.timemeasures that solve call, excluding simulation, residual evaluation and report saving.
Fixed: add_welfare reports normalized welfare after optimal-policy conditions. Opt-in state/player values preserve the policy problem; LQ solvers recover the quadratic conditional value, including innovation risk, and general perturbation keeps the requested order.
Fixed: fminunc and fminsearch preserve three-input output callbacks. Internal bound-transformation arguments stay inside the objective closure, including when a time budget is active.
Fixed: optimizer spelling hints require a close name. Unrelated unknown names are refused without an arbitrary suggestion.
Fixed: wgmhmaxlik returns a finite penalty for unusable objective values or invalid proposal covariance. Objective-function exceptions retain their identifier.
Fixed: shipped estimation optimizers refuse unknown option names before optimizing. Checks include empty values, function handles and the selected optimizer of a block search. Algorithm-specific valid names remain available; custom user optimizers retain their own option interface.
Fixed: ``description`` and ``description_latex`` update separate parts of an atom tag.
descriptionreplaces prose before#and keeps math;description_latexreplaces math after#and keeps prose. Both accept structs or two-column mappings.Removed: ``lc_algorithm``. The unused option has no alias. Supplying it raises the ordinary unknown-option error.
Removed: ``kf_nan_future_obs_means_missing``. The unused option has no alias. Supplying it raises the ordinary unknown-option error.
Removed: ``definitions_in_param_differentiation``. The unused option has no alias. Supplying it raises the ordinary unknown-option error.
Removed: ``parameter_differentiation``. The unused option has no alias. Supplying it raises the ordinary unknown-option error.
Removed: ``estim_iterations``. The unused option has no alias. Supplying it raises the ordinary unknown-option error.
Fixed: ``vardec_shocks`` selects the requested shock columns. Shares keep the variance of all shocks as their denominator, and columns follow the requested order. Empty selects every shock.
Fixed: ``description_latex`` updates mathematical descriptions. It accepts the same variable-name mappings as
tex_name; prose descriptions are unchanged.Fixed: ``suppress_warnings`` silences parser warnings for the construction call. The caller’s warning settings are restored on success and failure.
Changed: remove the recursive higher-order option of M.
The M setting accepts
HigherOrders='curvature'or'joint'. The value'recursive'is refused by the existing option validation, with no alias or remapping. The current default remains'curvature'. The separatesolve_perturbation_engine='recursive'and its use inside the retained higher-order schemes are unchanged.New: the impulse responses computed before irf_shock_date, reproduced with options.
The earlier
irfplaced every impulse in period k+1, k the largest anticipation horizon, and announced it in period 1. Two of its responses come back exactly:every shock anticipated the same k periods (
solve_shock_horizona scalar k): callirfwithirf_shock_datek+1;irf_anticipate=false, which removed all anticipation, the fudge shocks’ included: solve the model withsolve_shock_horizon0 and keep the default date. The response is the same, but it starts in period 1: the earlier one was zero in periods 1 to k.
When the shocks have different horizons and a constraint is enforced, the earlier responses moved before a shock with a shorter horizon was due, because the enforcement read the impulse further ahead than the shock’s own horizon. Those responses have no equivalent: they were the defect
irf_shock_datefixed.The irf timing tutorial adds one fall in demand, hitting in period 5, anticipated or a surprise, with the zero lower bound enforced and switched off. Tests:
models/dsge/obc/worked_examples/anticipated_shocks_zlb/Test_irf_earlier_responses.m(reference values from the code beforeirf_shock_date). Tutorial:rise-modern-tutorials/WorkingWithAModel/irf_timing, section 4.Fixed: an impulse response hits in period 1, or at the date irf_shock_date sets.
irfplaced every impulse in period k+1, where k is the largest anticipation horizon of any shock of the model, and announced it in period 1. The fudge shocks of themaxandminkinks count among those shocks. With the fudge shock of a ZLB anticipated 12 periods, an unanticipated demand shock hit in period 13, and the enforcement of the bound saw it coming from period 1. A shock anticipated 4 periods hit in period 13 too, and not in period 5.The impulse now hits in period
irf_shock_date, a new option, 1 by default. It is announced in period 1. It can hit as late as period k+1. A later date is refused before anything is simulated (RISE:irf:shockDateBeyondHorizon), and the message names the limit.Agents see the impulse to a shock only once it is due within the shock’s own anticipation horizon (its
solve_shock_horizon). An impulse announced further ahead moves nothing until then.irf_anticipate(true by default) says whether agents act on the announcement. With false, the impulse is a surprise in periodirf_shock_date. It used to remove the anticipation of every shock from the solution, the fudge shocks’ included, throughsimul_anticipate_zero: the constraints were then not enforced in expectation.irfnow leaves the solution as it is and keepssimul_anticipate_zerofalse, whatever the model holds.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 was noise in its equation.
A cocktail of shocks (
irf_shock_signgiven as a structure) gave the response to the first shock of the model alone: the impulses of the other shocks stayed in the path it is compared with. It now gives the response to the whole cocktail.Endogenous priors and the impulse-response conditions of the priors (
utils.prior.compile_endogenous_priorsandconfigure_model_conditions, sign restrictions included) callirfwith the default date. In a model with an anticipated shock, a fudge shock included, a restriction on impact now applies to the period the impulse hits, and not to the announcement k periods before it. Their estimation results change in such models.The forward-guidance curves of the cockpit (
bake_policy_gridwith itsanticipatedoption) setirf_shock_dateto k+1, so they are as before.
Tests:
models/dsge/simulation/irfs_srfs_cocktails/Test_irf_shock_date.m,models/dsge/obc/worked_examples/anticipated_shocks_zlb/Test_irf_shock_date_zlb.m,models/dsge/obc/worked_examples/anticipated_shocks_zlb/Test_check_last.m(withcheckLasttrue, the responses fail on the short window only),models/dsge/cockpit_export/cockpitBakeTest.m(the forward-guidance curves). Tutorial:rise-modern-tutorials/WorkingWithAModel/irf_timing.Fixed: perfect foresight preserves a known first-date announcement when drawing shocks.
Announcements from the last history date are carried before random draws and their destinations are marked as explicit data. A draw no longer replaces known news silently. Existing plans that placed news on the last history date can therefore produce different simulated paths.
Saved plans without an append record retain the existing refusal to draw shocks under uncertainty. Use levels for news on the last history date: a transform there requires a level before the plan, which is unavailable.
Fixed: perfect foresight continues automatic balanced-growth terminal values at their computed rates.
A fixed level terminal previously pulled growing variables back toward the solved steady-state level. For
solve_bgp=true, the defaultsimul_terminal_condition='steadystate'now continues growing or declining variables from their last solved values at the current parameterization’s computed rates. Driftless unit roots keep their last value; stationary variables use their steady-state levels. The reference uses the regime of the last solved date. Explicit terminal values, including those announced on later pages, take precedence and remain known when a recursive window is re-solved.Models with
solve_bgp=falsekeep their previous behavior; models withsolve_bgp=truefollow this rule even when no variable moves. The terminal reference reuses the classification from the steady-state calculation. Other terminal modes keep their existing meanings and restrictions. Thefirstordermode continues to use the boundary column’s regime, one date after the last solved date used by the balanced-growth closure. Its linear law contains no balanced-growth drift term and does not perform this computed-growth continuation.Changed: declared nonstationary models retain a shared classification of their balanced-growth references.
The steady-state step records, for every endogenous variable, whether its reference follows its computed growth, carries a driftless unit root, or takes its steady-state level. The zero-growth level check is cached per parsed model and reused across copies and parameter draws. Models not declared nonstationary do not perform this additional static check. Cognitive discounting reads the same classification, with the existing growth and static-null-space rules.
Fixed: an svar_model estimated without priors is estimated by maximum likelihood.
estimatestopped with “Dot indexing is not supported for variables of this type” (MATLAB:structRefFromNonStruct) on ansvar_modelgiven noestim_priorsand noestim_var_prior, as in the classical example of the documentation:estimate(m, data=db, estim_linear_restrictions={'a0(y,r)=0'}).Such a model is now estimated classically. Every structural parameter is estimated: A0, the lags, the constants, the deterministic coefficients and the shock standard deviations (one per state when they switch), and the constant transition probabilities. Their priors are flat, with log density zero, so the criterion is the log likelihood. Restrictions work as with priors, and a linear restriction fixes a parameter. Any other parameter keeps its value.
The identification is checked before the search. It is the rank of the Jacobian of the reduced form (the coefficients and the covariance of every regime) with respect to the free structural parameters, at a random point. A model that its restrictions do not identify stops with
estimate:svarMaximumLikelihoodNotIdentified, and the message names the parameters along the flat directions. Under regime switching the regimes are stacked, so identification through regime-dependent volatility is recognized.The search starts from the values the model holds, or else from the reduced-form OLS estimates under A0 = I. Under regime switching, states with the same start are first moved apart. With
estim_svar_start='concentrated'the concentrated start works on the likelihood.Reported: the log likelihood, the standard errors from the observed information (finite-difference Hessian, the default
estim_hessian_type='fd'), and the identification check inposterior_maximization.maximum_likelihood. No posterior and no marginal data density are reported, and the results table says ML.Refused with an error: endogenous priors without parameter priors (
estimate:svarMaximumLikelihoodEndogenousPriors),estim_eval_lik=falseandestim_parallel>1(estimate:svarMaximumLikelihoodOptions), and a parameter that is neither estimated nor given a value (estimate:svarMaximumLikelihoodNoValue).A model estimated this way has no prior to draw from and no posterior to sample, so what would do either stops with
estimate:svarMaximumLikelihoodNoPosterior:pull_objective(the objective of the MCMC samplers, of the marginal data densities and of the emulators),emulate,sensitivity,draw_parameter(m,'prior'),sample_posterior,get(m,'prior_mean'), and prior or posterior statistics intableandprint_estimation_results. A start that the likelihood rejects stops the estimation (estimate:svarMaximumLikelihoodNoStart) instead of drawing other starts from the flat priors.hessian,draw_parameter(m,'mode')(the normal approximation of the estimates),posterior_sample(it applies a function to the draws it is given),mode_curvatureandpredictive_analysis(it draws from the distributions it is given) still work.Any other model with no prior at all stops with
estimate:noPriorsinstead of the same “Dot indexing” error. Models with priors are estimated as before.
Removed: the shock finder find_shocks and the original anticipated-shocks simulator, which nothing calls.
rise.engine.obc.obcas.find_shocksandutils.forecast.simul_honor_anticipated_shocks_originalare removed. The second is the copy kept whensimul_honor_anticipated_shockswas rewritten in March 2021; nothing has called it since, and it was the only caller offind_shocks.The shocks that enforce the constraints are found by the optimization engine (
rise.engine.obc.obcas.optim.adjust_fudge_shocksandfix_it), as before. No behavior changes.
Changed: the checkLast argument of the constraint simulator takes effect again, false by default.
checkLastis the argument of the simulator that enforces the constraints over the anticipation window:'simulator',{'anticip_shocks','checkLast',true}, or the same with'regime_switch'or'cforecast', which are the same engine. It was accepted and ignored: it steered only the old constraint engine, whichsimul_honor_anticipated_shocksstopped calling on 6 September and which was removed on 16 October.Every period of the window is enforced, whatever
checkLastis. WithcheckLasttrue, a step in which a constraint still binds in the last period of the window, after enforcement, fails with retcode 706 (TOO_FEW_FORWARD_STEPS): the window is too short to see the constraint stop binding.solve_shock_horizonlengthens the window.The default is false, which is what every call got while the argument was ignored: a call without it, or with false, simulates as before. The old engine’s default was true.
It holds wherever the constraints are enforced over the window:
simulate,forecast,irf, and the constrained forecast step of the filters and ofx_at_risk, whether it is set on the model withsetor passed in the call. Another argument, or a value that is not a logical scalar, is refused (RISE:simulator:unknownArgument,RISE:simulator:checkLast).The filter returns 706 too when the step its update goes through is refused under
checkLast, and not 314 (CONSTRAINED_UPDATE_FAILED), which stays the code of the other failures of that update. The legacy edition returns 706 as well.irfannounces its impulse in the first period and lets it hit in period k+1, the last period of the first window (k the anticipation horizon). WithcheckLasttrue, the responses to a shock that makes a constraint bind on impact therefore fail whatever the length of the window. Fixed byirf_shock_date: the impulse now hits in period 1 by default (see that entry).The message of retcode 706 (
decipher(706)) now says when it is returned. When a simulation stops on 706, or on any code other than 704 and 707,simulategives that code and its message instead of reporting a divergence at the first period it did not reach.
Tests:
models/dsge/obc/worked_examples/anticipated_shocks_zlb/Test_check_last.m,models/dsge/obc/simulationsOBC/smallExample/Test_constant_zlb_recovery_line.m.Changed: the help, option descriptions and converter output describe RISE on its own terms.
The help of the model-file converters (
dynare2rise,dynare_sstate_file2rise,aim2rise,iris2rise), of thesimplanmethodsinitval,endvalandhistval, ofstoch_simul,solve,head,tail,mcmc_summary_table,igammaandigamma1, and the descriptions of the optionsestim_prior_trunc,kf_riccati_tol,simul_initial_guessandsimul_no_block_decompstate what the feature does without naming or comparing with other software. The help ofendvalsays that it sets the terminal conditions; it said initial conditions.The first line that the converters write in each generated file reads
Conversion of model file [...] into RISE file [...]. The comments thatdynare2risewrites in the generated parameter and steady-state helpers, and the headers thataim2risewrites in its other output formats, are worded the same way. The error raised when priors in the two supported syntaxes are mixed in one model file has a new text.The shipped driver
examples/microfound/gecon_rbc_ic.mis renamedexamples/microfound/rbc_ic.m. There is no alias. The comments ofrbc_ic.m,rbc.mandrbc_switching_prefs.mand the title of the model thatrbc_ic.mbuilds no longer name other software.Apart from that driver name, no function, option, default, return value or generated equation changes. The entries below that named other software are worded without the names.
Fixed: the fwz solver refuses a model outside its assumptions instead of returning NaN.
The
fwzsolver ended with retcode 22 (NaNs in the candidate solution) after one iteration on models it cannot solve, with no hint of why. Its Newton step divides by a matrix built from the current and lead coefficients, with one row for each forward-looking variable. That matrix is singular when several forward-looking variables enter the same equation, as in a growth model whose Euler equation holds the leads of consumption, of the productivity level and of the shock process: the lead block then has fewer independent columns than there are forward-looking variables. The solver also takes the lead block of a regime from a single destination regime, which assumes that the block does not depend on the regime entered next. Where it does, as in the perturbation types that evaluate the leads at the steady state of the regime entered,fwzsolved another model than the one given, without a word.Both conditions are tested before the first iteration, and
solvereturns a retcode that says which one failed:35 (
FWZ_AUGMENTED_MATRIX_SINGULAR): the matrix is singular or not finite in some regime. It is singular when its rank falls short of its size, the rank being that of MATLAB’srank(its default tolerance) after each row is scaled to a largest entry of one.34 (
FWZ_LEAD_BLOCK_DEPENDS_ON_DESTINATION): the lead blocks of a regime differ with the regime entered by more thansqrt(eps)relative to their size. This is tested first: a lead block that depends on the destination makes the matrix built from the block of one destination meaningless.
A model that
fwzhandles solves as before, and the other solvers (mfi,mnk,mnand their_fullvariants) are unchanged. Both retcodes are in the message table:decipher(34)anddecipher(35)name the reason and the other solvers to use.
Fixed: every terminal condition accepts a path only if it solves the model to RootTolerance.
RootTolerance, set throughsimul_stack_solve_algo, was read only by the free terminal (simul_terminal_conditionset to'stationary'). Under'steadystate'and'firstorder', in a conditional forecast and on an extended path, it was accepted and ignored: a solver stopped early by a loose tolerance returned its path with retcode 0, although the path did not solve the model.Every terminal condition now accepts a path only if it is finite and the root mean square of its stacked residual, over every equation and every period solved, is at most
RootTolerance. Otherwise the retcode is 201, as under the free terminal. The defaultRootTolerancestays 1e-5. It is read from the first options structure ofsimul_stack_solve_algo, as the free terminal reads it.Retcodes that change: a path that a solver accepted with a residual above
RootTolerance, for instance under{'sparse','TolFun',1,'MaxIter',1}, now returns 201 instead of 0: it did not solve the model. The tests and tutorials that setRootTolerancewith the steady-state terminal condition now apply it:TestRecoveredConstraintModelsandTestQuotedComplementarity, and the tutorialsguerrieri_constraint_exampleandquoted_complementarity_example. The other tests and tutorials of perfect foresight solve with the default tolerances of the solvers or tighter ones.
Fixed: as many parameter values as regimes can be set on as many parameterizations.
On a model with h regimes, h values of a parameter set on h parameterizations, as in
set(m,'parameters',{1:2,{'c',[1,3]}})on a model with two regimes, stopped with a size mismatch: the values were taken for one value per regime. They are now one value per parameterization, as with any other number of values.One value per regime on one parameterization, such as
set(m,'parameters',struct('rho',[0.4,0.6])), is unchanged.
Fixed: perfect_foresight keeps a failed parameterization in its place.
On a model with several parameterizations, a parameterization whose path could not be solved was dropped from the paths and from
fval, but not fromretcode. The later parameterizations moved onto its place: column k of a series was no longer parameterization k, without a word.A failed parameterization now keeps its column, with NaN values, and
fvalhas one entry per parameterization, likeretcode. When every parameterization fails, no path is returned, as before.
Fixed: a first-order terminal condition with no stable continuation returns a retcode instead of an error.
With
simul_terminal_conditionset to'firstorder', a terminal regime whose first-order solution could not be computed stoppedperfect_foresightwithRISE:perfectForesight:terminalLawNotFound, and an explosive one withRISE:perfectForesight:terminalLawExplosive. Both depend on the parameters.perfect_foresightnow returns no path and a retcode: the code of the solver of the first-order solution, or 24 for an explosive continuation.rise.engine.solvers.perfect_foresight.terminal_mapreturns the retcode as a second output, with an empty law.A terminal regime outside the model, or one that cannot persist, is still an error.
Fixed: the free terminal condition on an extended path is refused instead of being skipped.
With
simul_terminal_conditionset to'stationary', a simulation plan of several pages (announcements, a plan built with'recursive', true, or a model with a shock horizon) ran as an extended path closed at the steady state in every period: the free terminal was skipped without a word.perfect_foresightnow stops with the errorRISE:perfectForesight:stationaryNotForExtendedPath.A plan of one page runs the free terminal as before.
Fixed: the free terminal condition keeps the values of the plan, solves for the freed shocks and stays within the bounds.
With
simul_terminal_conditionset to'stationary', a value that the simulation plan sets over the horizon,endvalincluded, was only the starting point of its entry: the solve moved it like any other unknown, although the help says to pin values throughendval. The value now holds, as under the other terminal conditions.A shock that the plan frees with
free_shockswas set to zero. It is now solved for, so that the path meets the values the plan sets. A plan that frees more shocks than it pins values is an error (RISE:perfectForesight:freeTerminalUnderdetermined).The bounds of
simul_pf_boundswere ignored. The path now stays within them. When the equations have no solution within the bounds, the retcode is not 0.Behavior change: a simulation plan no longer gives a starting guess. Every value it sets over the horizon is pinned. A guess path goes in a plain database passed as
simul_historical_data: its values over the horizon seed the periods they fall on and are not pinned, and a shock the database does not give is zero, as before. An entry with no value starts at zero, as before.
Changed: simulate solves the model again when an option or a parameter change needs a new solution.
simulategiven an option or a parameter that changes the solution, for examplesimulate(m,'solve_shock_horizon',struct('ER',4)), or run on a model whose solution an earliersetmade stale, returned retcode 708 and no simulation. It now solves the model under the new settings and simulates that solution, as the legacy edition does.A model that has not been solved yet is solved, as before. A model whose solution is current is not solved again: its stored solution, and the warm starts it carries, are used as they are.
When the solve fails, the retcode is the retcode of the solve.
irfandforecastcould return 708 for a parameterization whose solve failed, in a model with several parameterizations; they now return the retcode of the solve too. No function returns 708 any more.A parameterization whose solve fails is solved once per call of
simulate,irforforecast, and skipped with that retcode. It is not solved again for the simulation, for the filter that finds its starting regime or for the plan generated from the data.
Fixed: the forecast examples of the reduced-form and structural VAR pages call forecast with name-value pairs.
The examples passed the data, the start date and the parameters to
forecastby position, as inforecast(ve, db, date_start, params).forecasttakes name-value pairs only, so the calls failed.The data go in
simul_historical_dataand the last date of history insimul_history_end_date; the forecast starts the period after it. The number of steps issimul_periods, 12 by default.The parameter draws of the Bayesian example come from
sample_posterior, which returns the model carrying one parameterization per draw;forecastthen returns one column per draw.The conditional example builds a simulation plan with
simplan.from_history, frees the shocks withfree_shocks, pins the policy rate withappend, and passes the plan insimul_historical_data.
Changed: simulate drops a burn-in of 100 periods by default, as in the legacy edition.
Behavior change:
simul_burnnow defaults to 100.simulatewithout data or a plan runs 100 periods before thesimul_periodsit returns and drops them, so that a simulated path no longer starts at the steady state. The series returned have the same length as before (thesimul_periodsperiods and the date before them), but their values differ for a given seed.simul_burn=0gives the former paths.The legacy edition simulates 100 burn-in periods by default and drops them in the same way, so the two editions now agree. The modern default was 0, while the help of
simulatesaid 100. The help says 100 again, which replaces the correction of the help to 0 in an entry below.Whatever simulates with the options of the model burns in too:
stoch_simul(its simulated moments),frontier,accuracy,regime_partition_analysisandrandsample, which cuts a simulation of(N+simul_burn)*Kperiods intoKseries and drops the firstsimul_burnperiods of each.There is no burn-in with historical data or a simulation plan, in
forecast,perfect_foresightandirf, as before. Only a value you pass can be refused:forecastrefuses asimul_burnabove 0 (RISE:forecast:burnIn) and a plan refuses a conflicting one (RISE:simulation:planConflict), and the default of 100 triggers neither.A switching rule in
simul_regimeruns without a burn-in: withsimul_burnleft at its default, the simulation has none. Asimul_burnabove 0 passed with a switching rule is an error (RISE:simulate:burnWithSwitchingRule), as it was.A model saved before this change keeps the
simul_burnof 0 it was saved with. Setsimul_burnto 100 to burn in.
Changed: the function determinacy is renamed no_bubble_radius, and its verdicts state where the radius lies relative to one.
rise.engine.dsge_tools.stability.determinacyis nowrise.engine.dsge_tools.stability.no_bubble_radius. It computes the mean-square-stability radius of a first-order regime-switching solution and the no-bubble radius of Cho (2016), and compares the latter with one. There is no alias: the old name no longer exists.The verdicts state that comparison. ‘no-bubble radius below one’ replaces ‘determinate’ and ‘no-bubble radius above one’ replaces ‘indeterminate’. ‘not MSS’ and ‘unresolved’ are unchanged. The sunspot is built when the verdict is ‘no-bubble radius above one’.
rise.engine.dsge_tools.stability.find_stable_solutionwith'KeepSearching',truegives the verdict ‘two distinct MSS solutions found’ when it finds two distinct MSS solutions. It gave ‘indeterminate’.The message that goes with an ‘unresolved’ verdict at a radius of one no longer mentions determinacy. The help of both functions says that the radius is computed and compared with one, and cites Cho (2016) for the criterion.
The fields of the report (
mss_radius,no_bubble_radius,no_bubble_by_regime,sunspotand the others), the numbers and the defaults are unchanged.
Fixed: the model-file converter keeps the expectations taken with the information of another period.
expectation(-1)(x)in the imported model file is converted to the expectation operator@E[-1](x). Its brackets were taken for an equation tag and made a description,@E"-1"(x), which cut the equation in two: the converted model could not be loaded. The operator now keeps its brackets:y = expectation(-1)(x);becomesy{t}= @E[-1](x{t});, the expectation ofxformed the period before.
Fixed: the model-file converter writes the complementarity tags of the imported model file as constraints.
An equation tagged
[mcp = 'x > lb']holds unlessxis at its lower boundlb. The converter made the tag the description of the equation, so the converted model had no bound. The equation is now written0=min(x-lb,F), whereFis its left-hand side minus its right-hand side:x >= lb,F >= 0, and one of the two is zero. An equation tagged[mcp = 'x < ub']is written0=max(x-ub,F). RISE enforces both as occasionally binding constraints.The bound must be a number or a parameter, and
xan endogenous variable. A tag that cannot be translated exactly stops the conversion with an error that names the tag and the equation:>=or<=(rise:converter:mcpWeakInequality), two bounds (rise:converter:mcpTwoBounds), a bound that is an expression (rise:converter:mcpBoundNotConstant), a variable that is not endogenous (rise:converter:mcpNotEndogenous), a variable with a trend (rise:converter:mcpTrendingVariable), an equation with a static version of its own (rise:converter:mcpStaticEquation), or a tag that does not readvariable > boundorvariable < bound(rise:converter:mcpUnreadable).A bound on a predetermined variable
kholds, as in the imported model file, on the variable decided at the date of the equation, which that file writesk(+1). The converted equation is0=min(k{t}-lb,F), and thekof the imported model file isk{t-1}inF, as everywhere in the converted model.The other tags of the equation, its name for instance, still become its description.
Fixed: simulate and forecast start each parameterization at its own steady state.
A model with several parameterizations (
set(m,'parameters',{2,...}), a posterior sample) forecast from its data, or simulated from a plain database andsimul_history_end_date, started the variables the data do not give at the steady state of the first parameterization in every parameterization. Each now starts them at its own steady state, in the regime it starts in.For example, with
x = c + rho*x{-1} + e,rho = 0.5,c = 1in the first parameterization andc = 3in the second, data withoutxand no shocks, the second parameterization startedxat 2 and moved towards its steady state of 6 (2, 4, 5, 5.5, …). It now starts and stays at 6.The values the data give, the starting regimes and a plan passed as
simul_historical_data, whose initial conditions are its own, are unchanged.
Changed: simulate, forecast and perfect_foresight run from a simulation plan, and the forecast_* options that repeated the simul_* ones are removed.
A simulation plan passed as
simul_historical_datasets the start, the horizon, the initial conditions and the regimes.simul_periods,simul_history_end_date,simul_burnor a numericsimul_regimepassed in the same call with another value than the plan’s (forsimul_regime, another regime at the first date of the plan) is an error (RISE:simulation:planConflict); the plan used to override them without a word, andsimul_regimeoverrode the first regime of the plan. A plan without a regime at its first date takes it fromsimul_regime.forecastwith a plan no longer needs a start date.simul_periodssets the horizon ofsimulate,forecastandperfect_foresight. Its default is now empty, which means 12 periods inforecastand 100 insimulateandperfect_foresight, as before. Asimul_periodsset on the model now applies toforecasttoo.forecast_nstepsis removed, and so isforecast_horizon, which did nothing.forecaststarts aftersimul_history_end_date. Its default forforecastis the last date at which the data (simul_historical_data, else the estimation data) observe a variable of the model. It wasforecast_start_dateminus one, elseestim_end_date, and an error without either; a forecast from anestim_end_datebefore the end of the data now needssimul_history_end_date.forecast_start_dateis removed. Without data or a plan, the forecast starts from the steady state.simul_shock_uncertaintyalone decides whether shocks are drawn. Its default is now empty, which means no shocks inforecastand drawn shocks insimulate, as before.forecastused to replace it byforecast_shock_uncertainty, which is removed. With a plan,truenow draws the shocks the plan does not set: those noappendorfree_shocksgave a value, no'shockInit'set at construction and no dynamic constraint uses. Left empty orfalse, the plan’s shocks are used as they are, as before; the option was ignored with a plan.Behavior change: the regime at the start of a forecast is the plan’s, else the one of a
regimeseries of the data, else the regime the filter finds most likely at the last date of history (the largest of the updated regime probabilities), each parameterization with its own filter. It was regime 1. A switching model whose data carry no observable of the model needs aregimeseries, a numericsimul_regimeor a plan:forecaststops withRISE:forecast:noStartingRegime. When the filter fails,forecastandsimulatereturn its retcode, with no output for that parameterization.simulatefrom a plain database andsimul_history_end_datestarts in the same regime; it drew it from the initial distribution, and still does when the data carry no observable.Behavior change: over the horizon,
forecastholds the regime it starts in at every date the plan leaves free; it drew the regimes. Without shock uncertainty a forecast is then one deterministic path.simul_stochastic_regimestruedraws the regimes in either function;falseholds the starting regime inforecastand, insimulate, takes the most likely regime at each step, as before. Its default is now empty, which meansfalseinforecastandtrueinsimulate.forecastreadssimul_to_time_series(defaulttrue), andforecast_to_time_seriesis removed.forecaston an empty model lists the simulation options it reads.forecastrefuses asimul_burnabove 0 (RISE:forecast:burnIn): a forecast has no burn-in. The value was replaced by 0 without a word.forecast_real_timeforecastskf_nstepsperiods ahead. The default ofkf_nstepsis now empty, which means 16 inforecast_real_timeand 1 infilter, as before.forecast_real_timeused to replace thekf_nstepsof the user byforecast_rt_nsteps, which is removed.counterfactualandhistorical_decompositionuse the options of the model when their inputs are empty:ctrf_sim_engine,ctrf_nsimandctrf_shock_list,histdec_sim_engineandhistdec_nsim; an input given there still wins. An empty input always meant the default of the function, so setting the options had no effect. The default ofctrf_sim_engineandhistdec_sim_engineis now@utils.filtering.sim_engine, the engine the functions used; it named a function that does not exist. The default number of draws stays 100 and the default list of shocks empty.Behavior change:
perfect_foresightwithout data no longer draws random shocks. Its shocks come from the plan only, andsimul_shock_uncertaintytruedraws them as before.estim_use_mleis removed: nothing read it, andestim_mleis the option that gives maximum likelihood. So aresimul_tol,simul_recursiveandsimul_exogenous_func, which nothing read either. Passing one of them, or one of the removedforecast_*options, is an unknown-option error.The help of
simulategavesimul_burna default of 100; it is 0.A model saved before this change stores the former defaults of
simul_periods(100),simul_shock_uncertainty(true),simul_stochastic_regimes(true) andkf_nsteps(1).loadobjloads them as empty, which computes the same, and drops the removed options; models saved since are marked bysaveobjand keep their values. A value set on a removedforecast_*option of a saved model is lost. The engines saved with a model (ctrf_sim_engine,histdec_sim_engine) are loaded as@utils.filtering.sim_engine.
Changed: regime-switching models are described by whether a stable solution was found.
RISE no longer calls a regime-switching model determinate or indeterminate. Finding a solution does not make it the only one, and failing to find one does not show that none exists. Determinacy is reported for constant-parameter models only, from the count of stable roots.
The report returned by
rise.cockpit.bake_policy_gridhas the fieldstable_share: the share of the grid nodes where a stable solution was found. It replaces the fielddeterminate_share, which is removed. The bake prints “stable solution found at … of the nodes”, and the cockpit says that a point was “snapped to the region where a stable solution was found”. Bundles baked before load as before.For a regime-switching model, the verdict that
rise.engine.dsge_tools.reduction.buildgives each frozen regime inR.rootsstates the count: ‘as many stable roots as predetermined variables’, ‘more stable roots than predetermined variables’ or ‘fewer stable roots than predetermined variables’. It said ‘determinate’, ‘indeterminate’ or ‘no stable solution’, which constant-parameter models keep. The warnings of the build say the same.The help of
solve,decipher(21)anddiagnose(m)no longer suggest that an iterative solver stopping at its iteration limit has met multiple solutions.Numbers, defaults and the solutions accepted are unchanged.
Fixed: perfect foresight reads the settings given in simul_stack_solve_algo for the free terminal.
RootTolerance, the residual that the free terminal (simul_terminal_condition='stationary') accepts as a root, was refused withlsqnonlinandfsolveas an unknown option (rise:optim:unknownOption) since optimizer options are checked. It is accepted whatever the solver of the stacked system, in one solver specification or in a fallback chain.FunctionTolerance,StepToleranceandOptimalityTolerancegiven there were translated toTolFunandTolX, which the free terminal does not read, so it kept its own defaults. They now reach its least-squares solve.A misspelled option is still refused.
Fixed: M curvature higher orders use the higher-order solver tolerance.
With the
hopsengine andHigherOrders='curvature', the default linear-solver tolerance for M’s higher-order coefficients is now1e-12, matching the standard higher-order solver. This path previously inheritedsqrt(eps)from the first-order options. Custom linear-solver settings and first-order options are preserved.At second order on the included switching growth model
rbc_switch, the largest coefficient discrepancy from an explicitly tightened solve was2.2e-8before this correction and is zero after it. This comparison uses the maximum absolute difference in each coefficient block divided by the larger of one and that reference block’s maximum absolute value; it measures agreement with the tightened solve, not error against an exact economic solution. The first-order coefficients are unchanged.
Changed: a model that does not parse says where to look.
A model with fewer equations than endogenous variables, or more, stops with the error
rise:parser:nonSquareSystem. The message gives the two counts and lists the declared endogenous variables that occur in no equation, then those that occur in one only, with the file, line and column of their declaration: ten at most, then how many more. With fewer equations the parse stopped with an error saying that the problem is structurally singular, which named no variable.A name that is not declared, in an equation of the model, a restriction or the parameterization, stops with the error
rise:parser:unknownName. The message gives the line and column of the name and up to three declared names closest to it in spelling, case ignored: variables, shocks, parameters, definitions, Markov chains and the switching parameters in theirname_chain_stateform, such asalpha_coef_2. The details of an equation that fails are in the error message; they were printed before an error that said “Parsing failed for the above reasons”.A Markov chain, or a switching parameter of one regime, in an equation where it cannot be used is said to be so, not taken for a misspelling.
Models that parsed before parse as before.
Changed: irf computes what its own options ask for, and the forecast_conditional_* options are removed.
forecast_conditional_hypothesis,forecast_conditional_sampling_algo,forecast_conditional_sampling_burnin,forecast_conditional_sampling_max_rejection_attempts,forecast_conditional_sampling_ndrawsandforecast_conditional_sampling_thinningare no longer options. They had no effect: a conditional forecast is a simulation plan, and the soft conditions of a plan are sampled withsimul_nsimdraws. Nothing replaces them. Passing one is an unknown-option error, andforecaston an empty model no longer lists them. Changingforecast_conditional_sampling_burninmadesimulatereturn retcode 708 (stale solution); that is gone with the option.irf_initial_conditions.regime, and ther0input ofsrf, set the regime the responses start from (the regime at the date before the impulse). It was written to an option nothing read, and the starting regime was drawn. In a switching model a starting regime needsirf_regime_specificfalse; with regime-specific responses (the default), which hold each regime fixed, it is an error.irf_typedecides what is computed:'irf'the impulse response at any order, without draws, and'girf'the generalized impulse response withirf_drawsdraws at any order. The default is now empty: a generalized response at an order above one whenirf_drawsis above one, the impulse response otherwise, which is what irf computed by default before. A generalized response used to be computed at an order above one whateverirf_typesaid, and'girf'at order one gave one only in a switching model. The responses in cell form (irf_to_time_seriesfalse) are labeled with the type computed; they carried the value ofirf_type.srffollows its help. On a switching model it now gives regime-specific responses unlessgirf_runs>1 (a generalized response) or a starting regimer0is given; it gave a generalized response that was not regime-specific.girf_runs>1 gives a generalized response at every order, also at order one in a model with one regime, where it gave the impulse response;girf_runs1 gives impulse responses, regime-specific in a switching model.An
irf_orderabove the order of the solution solves a copy of the model atirf_order, as the help said; it was an error. The model needs derivatives of that order (max_deriv_order, or automatic derivatives).simul_periods,simul_order,simul_anticipate_zero,simul_historical_data,simul_history_end_date,simul_initial_regime,simul_burn,simul_shock_uncertaintyandsimul_sigpassed toirfraise an error naming what sets them (irf_periods,irf_order,irf_anticipate, which has the opposite meaning,irf_initial_conditions, orirf_typeandirf_draws). irf used to overwrite them without a word. Values stored on the model are still not used by irf, and the other simulation options (simul_regime,simul_stochastic_regimes,simul_constraints,simul_pruned, …) apply to the responses as before.Models saved before this change keep their results. They store
irf_type'irf', the former default, which is loaded as''; models saved since keep theirf_typethey were given.The help of
irfsaid thatirf_shock_sign0 gives zero responses; 0 is refused, and the help now says so.
Fixed: optimizer and solver settings that were accepted and then ignored.
MaxTimenow stops fmincon, fminunc and fminsearch inestimate: an output function ends the search once the time is spent (your ownOutputFcnstill runs and can still stop the search). These three have no time limit by default, as before; RISE’s own optimizers keep their default of 7200 seconds. Withestim_blocksand one of these three, the loop over the blocks therefore has no time limit by default either (it stopped after 7200 seconds).MaxNodes, which only bee_gate and bee_root read, raises an error for a MATLAB optimizer.The settings of rise_de, rise_cma_es and the other population optimizers (
NP,F,CR,lambda,init_step, …) given inestim_optimizerwere stored while the optimizer ran with its own defaults:{'rise_de','NP',100}used a population of 20 plus five times the number of parameters. They now take effect.TolFun,TolXand any other option these optimizers do not read raise an error that lists the ones they read.bee_gate printed its progress whatever
Displaysaid, and dropped the options it does not read.Displaynow sets how often it prints (‘off’ and ‘none’ print nothing), and an option it does not read raises an error.wcsminwel and wnewrat stopped at an improvement of 1e-7 whatever
TolFunsaid, and newrat reported its iterations whateverDisplaysaid.TolFun(1e-7 by default, as before) and, for wnewrat,Displaynow take effect.MaxFunEvalsandMaxTime, which neither of them honors, raise an error, as doesDisplayfor wcsminwel, which always prints.With
estim_blocks, the optimizer of the blocks received only its budgets and a few display settings:TolFun,Algorithm,OutputFcnand the rest were dropped. It now receives every option, and the loop over the blocks still sharesMaxIter,MaxTimeandMaxFunEvalsout between them. With fmincon, fminunc or fminsearch the blocks are therefore searched with the settingsestimategives these optimizers (for fmincon the sqp algorithm and tolerances of sqrt(eps)) instead of MATLAB’s defaults.The solvers mfi, mnk, mn, their
_fullvariants, fwz and mafia dropped the options they do not read, for examplesolve(m,'solver',{'mfi','TolX',1e-9}). Such an option now raises an error that lists the ones the solver reads. mafia now receivesValidFunc, and aDisplayit cannot honor raises an error instead of becoming ‘none’.Cyclic reduction (
'solver','cr') iterated to a tolerance of sqrt(eps), at most 1000 times, whateverTolFunandMaxItersaid. Both now take effect, with the same defaults.
Fixed: the classical switching smoother handles a missing sole observation. A gap in a model with one observable could turn the measurement intercept into an empty row and stop smoothing with a dimension error. The empty innovation now stays a column, including the exact-diffuse path; the forward likelihood is unchanged.
Fixed: estimation and sampler settings that were accepted and then ignored.
Nonlinear restrictions (
estim_nonlinear_restrictions) were imposed only by the optimizers that take constraints (fmincon without estimation blocks, and bee_gate); fminunc, fminsearch, the other RISE optimizers and fmincon withestim_blocksignored them. They now enter the objective as a penalty, as the general restrictions do. Like that penalty, they pull the estimate towards the restriction rather than onto it; fmincon and bee_gate still impose them as constraints.A misspelled option of a MATLAB optimizer (fmincon, fminunc, fminsearch, fsolve, lsqnonlin), for example
{'fminunc','MaxIterationz',50}, raises an error that names the closest valid option, instead of being stored and ignored. A shortened name such as'MaxIteration'is refused too. Options of one algorithm (InitDamping, …) and the options of RISE’s own optimizers are accepted as before.solve_linsyst_solverset to'gmres'gave gmres the tolerance as its restart and the iteration limit as its tolerance. Both now reach gmres in their places; an optionalrestartfield of the options sets the restart (none by default).The independence Metropolis-Hastings sampler (
imh) accepted misspelled options. They now raise an error.
Fixed: optimizer options given with their current MATLAB names now take effect.
Options passed after an optimizer name (for example
estimate(m,'estim_optimizer',{'fmincon','MaxIterations',50}), and the same forsstate_solver,solver,simul_rootand the other optimizer options) were stored beside the default under the name given, while every optimizer reads the older optimset name.MaxIterations,MaxFunctionEvaluations,OptimalityTolerance,FunctionTolerance,StepTolerance,ConstraintToleranceand the other current names were therefore ignored;MaxIterations,2 ran up to 1000 iterations. They are now translated toMaxIter,MaxFunEvals,TolFun,TolX,TolCon, …, and an optimset name written with other capitalization (maxiter) is matched too. Options specific to one optimizer are passed on unchanged.solve_linsyst_solver, declared as{solver,options}, now accepts options with current names or only some fields, for example{'gmres',struct('MaxIterations',500)}; before, anything but a struct with bothTolFunandMaxIterfailed.An estimation stopped by an output function (
OutputFcnreturning true) returns its estimate instead of failing when the optimizer had no Hessian to return yet.
Added: describe a model’s regime structure before solving.
describe_regimes(m)prints the chains, their states and the existing regime combinations. An output argument returns the description as a table.The optional
'plot',truedraws a regime map; the default creates no figure. The description uses the existing state names, TeX labels and regime order.
Fixed: course examples preserve dates and report their numerical comparisons accurately.
Course windows keep their actual selected dates and missing boundary rows; forecast and announcement examples align their observations and shock dates.
Loss comparisons use paired batch uncertainty. Rates and residuals use the stated units, and reference comparisons require complete series coverage. Benchmark equations, calibrations and shock specifications are preserved.
Course-kit tools protect their inputs and ship matching participant runners. Program prerequisites, teaching statements and deck sources match the demonstrated workflow. Tutorial execution seeds and restores its random state.
Fixed: report failed numerical attempts without accepting invalid results.
Named statuses and empty results cover unusable root-search seeds, failed moment tilts, unidentified local projections, failed HDMR/PCE fits and unusable numeric sampler starts. Failed refits clear stale coefficients. Optional return-code outputs preserve existing successful outputs; DRAM supports a sixth code while five-output callbacks keep their protocol. Initialization callback exceptions retain their original identifier and stack. Model equations, calibrations and numerical acceptance tolerances are unchanged.
Fixed: use a measured GHK burn-in default without overriding requests.
Empty burn-in selects 23 for GHK and 0 for Gibbs or rejection. GHK’s explicit nonnegative integer settings remain exact requests: zero keeps the initial proposal. The default begins ten consecutive passing values in the recorded mean/variance experiment over three truncation regions, three seeds and 1500 chains per region/seed. This finite experiment is documented with its error table; it is not a uniform mixing guarantee.
Fixed: shift policy coefficients without an added size threshold.
The coefficient-weight calculation always forms one row at a time and keeps its original three-input interface. It computes the same weighted derivatives as the dense formula up to floating-point rounding, without allocating the full coefficient-by-coefficient weight matrix.
Fixed: restore the original interfaces where additional numeric limits had been introduced.
Heterogeneity expansion, accuracy and Taylor-projection quadrature, polynomial reduction and Schur candidate enumeration no longer impose the added work budgets. The direct Lyapunov solver again accepts systems above 64 variables; its dense operator still requires storage proportional to the fourth power of the state dimension. Conditional GHK sampling uses the requested burn-in and retains its Metropolis-Hastings correction. The public Schur Lyapunov solver keeps its fixed 1e-6 buffer. The internal stable-block solve used after explicit root classification applies no second buffer, preserving finite selected-observable covariances.
Fixed: retain whole-pattern constraint verification without added controls.
OccBin infers release from the switched reference equations and stops when its binding pattern converges or repeats. A cycle retains failure code703; a verified pattern binding at the horizon retains706. The added release-condition syntax and iteration-budget option are removed. The independent complementarity utility remains callable separately.
Changed: restore the original lifetime of numerical caches.
Steady-state warm starts use their original get/set/clear interface and remain available until explicitly cleared. Automatic eviction and the added remove/info commands are removed. Structural fingerprints and array-size checks remain, so distinct models still have distinct keys.
Folded monomial and product tables use their original persistent stores, with no added aggregate byte cap or budget-management interface. Their algebra and the independent allocation-copy correction are retained.
Restored: tensor-product and forecast-tilting utilities.
The six Kronecker routines are available again, with exact factor counts, complex shifted solutions and effective output reshuffles. Repeated rectangular powers keep the correct left and right identities. Sparse outputs retain their representation. Scalar order metadata is explicit where dimensions cannot identify it.
utils.entropic_tilting.tilt_scenariokeeps forecast periods and draws in their original positions and returns column weights and means. Finite unattainable moment targets return no accepted forecast and a return code.
Changed: restore the existing risk-adjusted linear interface.
RAL uses the first candidate returned by its internal perturbation solve, as before. The added branch selector, selection warning and branch inventory field are removed. The sparse coefficient extraction and refreshed native stability metadata remain; first-candidate coefficients and model specifications are unchanged.
Changed: unconditional welfare losses can cancel unit-root levels.
For one-regime linear models, requested stationary observables use the stable coordinates before nonstationary covariance entries are marked. Full integrated covariance requests and observables with material unit or explosive loadings still fail. Switching projection is not inferred.
A failed loss now reports its actual status to the caller, with no valid loss number.
optimal_simple_rulereturns the final criterion status as an optional second output. Invalid trial vectors receive the estimation penalty and the search continues; one-output calls do not raise a criterion error. Equations, calibration and loss weights are unchanged.
Fixed: Cleveland storytelling refreshes smoothing from a saved estimate.
Reuse the saved parameter estimate and data, then recompute filtering and published smoothing before reading shock, state and regime outputs. Cached filter fields from an older build no longer bypass this step. Equations, calibration, parameter estimates and the smoother recursion are unchanged; no second estimation is required for a saved estimate.
Fixed: clipped covariance reconstruction remains exactly symmetric.
Symmetrize after eigenvalue reconstruction and coordinate rescaling so floating-point multiplication cannot leave unequal off-diagonal entries. Bounds, scaling, alteration reporting and healthy exact returns are unchanged.
Fixed: blank lines in published source listings retain their positions.
Leading, interior and trailing empty source lines are preserved when a script is published, instead of stopping with a scalar assignment error.
Changed: covariance projection defaults use coordinate scale.
With both bounds empty, project standardizes by the square roots of positive diagonal entries, clips standardized eigenvalues between sqrt(eps) and 1/sqrt(eps), then rescales. Previously the default eigenvalue bounds were absolute. Healthy symmetric inputs remain exact.
Nonpositive diagonal entries use the largest positive diagonal scale. With no positive diagonal, the old absolute default is retained; zero still returns sqrt(eps)*I. Supplying either bound keeps the absolute branch and the old default for its omitted partner.
update_moments uses the new default when its e is omitted or empty; explicit positive e stays absolute. nearest keeps its existing absolute floor and farthest-mode behavior. Symmetrization counts as an alteration in either branch.
Changed: FRED downloads use a keyless route when no API key is supplied.
Explicit keys take precedence over FRED_API_KEY. Without either, current observations come from the public graph CSV and series metadata comes from the public data page. No key is embedded.
If graph CSV is unavailable, the data-page observation table is used. Missing or unreadable metadata raises a warning while returning the data; frequency is then inferred from the dates and metadata fields stay empty.
Optional inclusive observation date bounds are applied locally. The authenticated metadata and observation transport remains available when an explicit key or environment key is present.
Fixed: an explicit steady-state acceptance tolerance can only tighten acceptance.
A supplied value is capped at the historical threshold max(solver tolerance,1e-6). Larger requested values keep that threshold; they cannot make a previously rejected residual acceptable. Empty retains the default, and smaller positive values retain their stricter meaning.
Numerical, file, fast-estimation and diagnostic paths share the capped criterion. Solver iteration tolerances and model equations are unchanged.
Added: an explicit steady-state residual acceptance tolerance.
Empty sstate_acceptance_tol preserves the historical verdict threshold max(solver tolerance,1e-6). An explicit positive finite tolerance can require a stricter residual without changing the solver iteration target.
Direct, block and loop steady-state paths carry the option; diagnostics report the same effective threshold and accept equality at its boundary. A stricter verdict can reject a returned point; it does not improve that point or replace suitable solver tolerances and derivatives.
Fixed: temporary storage when decomposing constant-parameter models.
Construct requested observation-weight matrices in column blocks, without retaining full matrices for unrequested intermediate quantities. Apply weights by observable in row blocks without a full data-weighted copy.
Returned weight matrices and contribution ordering are preserved. Their storage remains quadratic in sample length; chunking reduces temporary storage, not the size of requested outputs. Debug and time-varying matrix paths retain the existing construction. The filter and model are unchanged.
Added: an explicit inherited-capital adjustment-law alternative.
Authored open-economy capital laws, first-order conditions, calibration and shocks remain the defaults. Their recorded derivative conflict is documented rather than changed silently.
A separately selected source-text helper scales the quadratic adjustment cost by inherited capital. It preserves both retained capital conditions; finite differences check investment and inherited-capital derivatives. No complete equilibrium or higher-order policy accuracy is claimed.
Fixed: authored benchmark defaults with explicit preference alternatives.
Keep the original symbolic objectives, calibration, recursive power moment, rounded coefficients, capital transitions and asset budgets as the source defaults. Record source conflicts and park only the affected variants.
Retain the logarithmic period-utility, normalized home-consumption and geometric recursive-certainty examples as explicitly selected alternatives. Their helper functions and tutorial companions remain available. A log value assigned to unnormalized power utility at unit curvature is a discontinuous convention, not a finite limit; it does not preserve welfare levels across curvature. The home helper uses a local Taylor approximation near zero.
A separate two-sector constructor offers the approved constant-returns exponent rescaling and accounting-consistent investment pricing. Preserve the authored degree-1.2 source and historical reference as parked material.
Correct six example custom-argument cells without changing their numerical algorithm. Preserve its observed refinement failure and independent policy identity. The smooth-maximum constructor rejects invalid slopes explicitly.
Changed: switching smoothing uses the published information/disturbance recursion.
The production backward pass follows Hashimzade, Kirsanov, Kirsanova and Maih (2026). Existing filter outputs, history orders, missing-data handling, exact diffuse initialization and constrained-smoother options are retained.
Probability-averaged smoothed levels and growth rates need not remain mutually consistent after regime switches. This known approximation limitation does not change the model equations or their calibration.
Legacy outputs from the classical per-regime backward pass use a different approximation. Compatibility controls match that method and historical transition date explicitly; production keeps the published switching recursion and outgoing transition dating.
In the retained time-varying-transition cases, historical incoming-date smoothed regime probabilities differ from outgoing-date results by up to about 0.1; this dating comparison is distinct from the state approximation.
Fixed: bounded labor-search reference checks and diagnostics.
Residual work arrays preserve automatic-differentiation element types. Checks cover dynamic and steady-state derivatives and every stopping-rule coefficient and continuation term. Fixed technology quadrature inputs are reused within each node solve, with the residual equations unchanged. Explicit imports, separate full/bounded projects and source hashes identify dependencies. Domain counters observe extrapolation, feasibility and Euler residuals without clipping states or policies. These small checks do not certify global convergence, graphics or long-simulation accuracy.
Fixed: the logarithmic home-consumption CES endpoint.
Both home-production utility kernels retain their finite zero-power limit and continuous elasticity derivatives near it.
The ordinary aggregate, calibration and historical reference equations are retained; numerical stabilization does not declare economic kinks.
Test: models/dsge/TestHomeCesEndpoint.m.
Fixed: multiplier reporting in the Bellman-game reference.
Current constraint multipliers are reported separately from discounted continuation-value derivatives, and diagnostics include rival responses.
Post-processing envelopes retain rival terms and use fiscal reductions consistent with the written current constraints.
Independent unilateral best responses and strategic envelopes validate the retained iteration. A new derivation preserves the historical notes.
Test: models/dsge/optimal_policy/non-cooperative games/simplest_matlab_code/TestBellmanRivalResponses.m.
Fixed: binding dates in the level-rate lower-bound example.
A separate affine-rate worked model uses the bound-aware piecewise-linear solver and one monetary-policy innovation, with the original calibration.
Checks require binding and slack dates and verify the affine Taylor rule and complementarity in realized rate levels. Original experiments remain.
Test: models/dsge/obc/worked_examples/regime_switching_zlb/TestLinearRateZlb.m.
Fixed: inflation-target units and complete price steady states.
The bond-premium example retains positive target persistence and treats the target as an annualized log rate, consistently with its policy rule.
Nonzero-inflation steady states use the same continuation exponent as price setting, with consistent reset price, dispersion, marginal cost, production and wage identities. Calibration and shocks are retained.
Test: models/dsge/benchmark_models/source_contracts/TestRudebuschSourceContracts.m.
Fixed: retained source priors and variance-driver construction.
Four structural VAR configurations retain their improper original Beta declarations and are explicitly parked. Batch workflows skip only those configurations; the supported alternatives remain available.
The variance-only driver restores its three original joint Dirichlet declarations and constructs the model under the variable used downstream.
Test: models/var/structural/examples/TestRetainedSvarSourcePolicy.m.
Fixed: executable complementarity bounds and reference-level inputs.
The public policy-rate and compartment examples impose their lower/upper bounds with actual maximum/minimum equations. Complete calibration and reference states are restored; separately named deviation inputs preserve the original natural-rate and contact-rate level variables.
Small nonzero linear right-hand sides are solved in Newton steps, allowing requested path tolerances below the previous absolute cutoff.
All three compartment scenarios retain the source assignment order. In scenario C, the later value 0.4 applies to the shared week 17.
Test: models/dsge/TestQuotedComplementarity.m.
Fixed: common consumption preferences in the labor-search policy example.
The inline, abbreviated and explicit auxiliary versions use normalized CRRA policy utility with the same curvature as households and a logarithmic endpoint at unit curvature. The shipped unit-curvature calibration and normalized leisure utility are unchanged.
Test: models/dsge/TestAMSMPreferences.m.
Fixed: the geometric endpoint of recursive certainty equivalents.
The positive-utility example retains a conditional normalized moment at unit risk parameter, with the matching continuation value and marginal discount weights. Exact identities avoid subtracting nearly equal powers. Its ordinary calibration and historical reference remain unchanged.
Steady-state statement masking distinguishes assignment from comparisons inside right-hand expressions.
Test: models/dsge/TestEZCertaintyEndpoint.m and infrastructure/symbolic/TestConditionalExpressionBoundaries.m.
Fixed: logarithmic utility endpoints and symbolic conditional expressions.
Reusable period-utility examples have an explicit logarithmic branch at unit curvature. Normalized and unnormalized welfare levels retain their distinct conventions at other curvature values; historical references and calibrations are unchanged.
Boolean literals remain constants in symbolic operations. Relational values retain their parentheses in arithmetic, comparisons no longer split equation assignments, and ordinary conditional selectors remain distinct from generated regime dispatch tables.
Six steady-state callbacks share the normalized log endpoint. The recovered welfare benchmark restores its public calibration and all 15 endogenous steady states, including recursive welfare, in place of an empty callback.
Test: models/dsge/TestUtilityLimits.m and infrastructure/symbolic/TestConditionalExpressionBoundaries.m.
Fixed: actual branch conditions in the public constrained examples.
The investment-floor and nominal-rate-floor models use one native complementarity or maximum equation in place of simultaneous relaxed and binding equations. Complete public calibration and steady-state formulas are restored, with both signed source shock plans retained.
Test: models/dsge/TestRecoveredConstraintModels.m.
Fixed: conditional branches in the Ascari–Sbordone and Born–Pfeifer examples.
Calibration and steady-state callbacks share explicit source branch choices, return every declared endogenous value, and read fixed wage slopes before writing parameter updates. Impulse and moment/demand shock exercises remain separate.
Born–Pfeifer composite-targeting weights and recursive welfare dates match the public original. Its natural allocation satisfies the published equation at nonzero taxes while retaining that equation’s diagnostic tax convention. The standalone alternative with missing subsidy inputs is explicitly parked.
Test: the public branch and callback regression classes under models/dsge/benchmark_models/fromJohannesPfeifer.
Fixed: example inputs, resource ownership and numerical utility boundaries.
Quarterly examples select economic columns by header and use the supplied quarterly date index. Original workbooks, transformations and calibrations are retained. Missing original fixtures and unmatched cached modes are parked.
Unloading restores prior explicit paper defaults and skips optional load probes. Example-created pools close on errors; serial execution is available. Historical sampling callbacks are archived, while current density work uses the objective and draws from the same run.
Commutation matrices are constructed sparsely. Combination recursion stops at the requested length. Running means avoid unused covariance work. Floating color values keep their source units; palette grids are cached, and empty palettes perform no conversion.
Polynomial reductions share explicit work limits and preserve monomial ordering without repeatedly sorting leading terms. Static reference graphs retain package, class and private identities and expose unresolved calls.
Historical reports flag invalid ordering and unavailable nonreal evidence. Observation conventions and structural normalizations are stated explicitly; published equations and shock variants are preserved.
The installed manual is rebuilt from current sources with a clean index and the unit-list panel constructor; long examples and formulas fit the page.
Fixed: example workflows and published source keep their declared meaning.
Publishing honors nested output paths and keeps the PDF, TeX and figures together. Listings represent non-ASCII characters explicitly and preserve literal source markup, with the original source unchanged.
The installation check preserves existing figures and returns numeric success or failure with optional stage and exception diagnostics. Empty progress totals complete cleanly, and cancel controls follow their option.
Polynomial text retains double precision and signed scientific exponents. Color conversion accepts numeric matrices and distinguishes HSI intensity from HSL lightness, including gray and black boundaries.
Examples start the active installation. Steady-state callbacks return their declared updates, use a neutral absent shock and reject failed scalar solves; the original model equations are checked. Batch examples keep each calibrated or fitted variant, ordinary forecasts are labeled accurately, and marginal-density examples use the supported methods and kernel sign.
Structural VAR example adapters use current model, prior and restriction interfaces and original variable names. Missing original reference inputs and unfinished conditional drafts are parked explicitly; retained invalid prior choices require a proper prior supplied explicitly.
Fixed: the expected-inflation discount in the alternate estimation benchmark.
The alternate Phillips curve retains the household discount factor on expected inflation, consistently with its published specification and Calvo slope. Both implementations use the same mapped calibration for comparisons; all other equations and shocks are unchanged.
Test: models/dsge/TestFVRDiscount.m.
Fixed: utility, reporting and diagnostic boundaries preserve their meaning.
Column partitions, reordered loops, simultaneous field renames, strict structure schemas and string variable names preserve their declared axes. Expected-failure checks reject successful calls; tolerant comparisons use symmetric strict and inclusive bounds.
Nested call arguments and chart expressions distinguish quoted literals from transpose operators. Raw report blocks close on the same or a later line, equation labels survive either delimiter, and source offsets include trimmed blank lines. Disjoint chart dates are reported unavailable, and callbacks may return multiple graphics handles with aligned legend labels.
The algebraic smooth maximum uses scaled arithmetic with the same formula; smaller smoothing approaches max, with default 1e-10. MCMC best points use the same inverse coordinates as draws, and plots show the requested lags.
Worker setup waits for completion and surfaces errors. Memory queries use platform units with a zero budget when unknown. Batch conversion visits a fixed folder tree once, preserving full basenames and the working folder. UDC refinement reads its tolerance and iteration options correctly.
Nonfinite residuals in any regime take diagnostic priority; unavailable structural evidence is explicit, with checked ranks by game. Failed filter dependencies are unavailable to model conditions, while genuine expression errors still surface. Portable JSON, source and reconstructed descriptions preserve UTF-8 with explicit export encoding and the normal description marker.
Changed: parameter links reject forward references.
Links retain top-to-bottom insertion order. Setting a link that reads a value defined by a later link now raises
RISE:dynabind:ForwardReference, naming both links. Write each linked definition before its first use. Values supplied outside the links and correctly ordered evaluations are unchanged.
Fixed: publishing can write TeX without invoking a compiler.
OutputFormat="tex"emits the same editable report source and persistent figure assets as the PDF workflow. The default remains PDF. Syntax and escaping checks can inspect source without repeated external compilations.
Fixed: user solvers accept multiple bound arguments.
A callback specification with two or more bound payloads no longer fails while comparing it with built-in policy-solver names. Named and handled callbacks receive each bound argument unchanged.
Fixed: switching quadratic loss uses the next regime’s transition.
The Bellman continuation value and its bounded direct solve now use the destination regime’s policy matrix, consistently with the innovation term. For a common steady state, stationary aggregation agrees with the joint regime moment equations. Single-regime calculations retain the same formula.
Fixed: the steady-state model writer closes its output file when writing fails.
An error while writing a steady-state model file no longer leaves the file open.
An output path that cannot be opened now stops with the error
RISE:ssmodel:FileOpeninstead of a later, unrelated write error.
Fixed: filter output preserves its calendar and regime axes.
Missing observations at the beginning or end of the first returned series no longer trim its calendar or shift the dates inherited by later series. Switching-impact collection keeps aligned sample lengths, including an entirely missing series and the extra prediction date.
Inputs stored one cell per regime keep their known time axis, including single-variable series. Samples as short as the number of regimes no longer interchange time and regimes when the axis sizes coincide.
Test:
models/dsge/filtering/Test_filter_calendar_packaging.m.Fixed: a nonstationary direction in a declared stationary block is partitioned, not given a covariance. The Lyapunov initialization used to return a finite covariance with success for a block declared stationary that holds a unit or explosive root. It now separates the stable coordinates with an ordered Schur form, solves their covariance with the existing solvers, marks the nonstationary directions explicitly, and returns code 315 (
LYAPUNOV_PARTITIONED) with the stable part and its residual. Fully stable blocks give the same results as before.Fixed: switching covariance rejects overflow in the total variance. Converged finite conditional covariances can still produce an unrepresentable unconditional variance; the final within-regime, between-regime and total covariance checks now return code 22 with an empty total covariance when that aggregation is not finite.
Fixed: mean-square stability keeps distinct switching regimes. Regime reduction now requires exactly equal dynamics and exactly equal probabilities into each merged group. A rare transition to an explosive regime can no longer disappear under an absolute comparison tolerance; chains that fail the exact checks keep their full stability operator.
Fixed: correlated measurement errors keep a small positive variance. The shared covariance factorization keeps every positive pivot, so a variance small relative to another observation’s no longer disappears; weighting the multipliers by their pivots before the diagonal product also avoids squaring an extreme multiplier when its covariance is finite.
Fixed: exact-diffuse densities keep finite large-variance normalizers. Ordinary and diffuse-informative observations sum the logarithms of the Gaussian prefactor and the variance; multiplying them first could overflow and report an infinite log density for finite inputs.
Fixed: a Kalman step refuses an unrepresentable innovation inverse. The step reports status 305 when its explicit inverse overflows, instead of returning success with invalid updated moments and density; representable positive variances keep their usual update.
Fixed: the counterfactual of the switching Ireland (2011) example.
master_switch.mof the example summed the historical decomposition over its columns withsum(...,2), which a time series cannot do and keep the names of the columns it adds up, so it stopped before the plots; it sums the numbers, and the layout of the subplots follows the number of shocks.Fixed: the sample of the Ireland (2003) example.
master.mof the example detrends the data over the sample it chooses (a start date and an end date) but gaveestimateonly the start date, so the pre-1979 choice was estimated through the last observation; it gives the end date as well (the default choice, from 1979Q3 on, is unchanged).Fixed: dated controls in the payoff of an agent of
rise.microfound. The first-order condition of a control was the derivative of the payoff of its own period and the terms of the constraints. A control that also enters the payoff of the period before or after (the lag of consumption in an internal habit,log(c-h*c{-1}); the capital a firm chooses one period before it uses it) lost the discounted derivatives of those payoffs: withc=1,beta=.9,h=.5and the constraintc=1the multiplier was -2 instead of -1.1, and the condition of the firm’s capital was empty. Both are in the condition now, weighted like the multipliers of the constraints; payoffs without dated controls are unchanged. See Deriving models with rise.microfound.Fixed: replacing a condition of a simulation plan. A later condition on the same variable, date and page replaces the earlier one as a whole: a point appended over a band removes the band (the plan stayed soft), and a level appended over a value expressed in a transform removes the transform (a level of 5 against a previous level of 100 was read as 105). The transform of an entry is recorded from the conditions as the plan validated them, so
y{1}isyon page 2 and a vector of pages is one entry per page.Shiftis a whole negative number of periods (RISE:simplan:badShiftfor-0.5), and the error of a level that is not there names the shift that was asked for. A condition given as a cell with white space inside its name is read correctly. See Simulation plans and Conditioning on transforms.Fixed: parameter restrictions. A linear restriction with a large constant (
'p=1e10') lost the coefficient of the parameter; the step of the finite difference is as large as the constant now, and a restriction that is not linear ('p*q=1','p^2=4') is refused (parse_linear_restrictions:notLinear) instead of being read as a row of zeros. A strict inequality ('p<1') is violated at its boundary, byeps; it was satisfied there.<=and>=accept equality as before. See Restrictions on parameters during estimation.Fixed: portable documents keep the logs, and the comparison sees what changes the model. The model file rendered from a document declared every variable in one plain block, so the variables in logs came back linearized; they are declared in
@endogenous(log).rise.portable_diffcompares the log flag of the variables, the governing chain of the parameters, the states of the chains and the definitions (a new sectiondefinitions, a new fieldredeclaredin every declaration section), and lists inreport.unsupportedwhat a document cannot carry (a steady state block, an optimal policy block…): such a report hascomplete=falseand is notidentical. See Portable model documents.Fixed: the satellite system estimates what is linear and solves what is simultaneous.
estimatefitted by least squares every parameter that appears once in an equation:y = a^2*xfitted on4*xassigneda=4. It now evaluates the equation for its dependence on each parameter, each pair and all together, fits the parameters it is affine in, and lists the others inSkipped.simulatewalked the equations of a system that is not recursive once, in a guessed order (x=.5*y,y=.5*x+1gavex=0,y=1); it solves the simultaneous block of every period, and is an error when the block has no unique solution (RISE:satellite:simultaneousBlock). See Satellite models.Fixed: Markdown conversion and small utilities.
rise.md2mwrote the code of anoexecfence (and of a fence in another language) as ordinary code, so running the script ran it; it is a block comment whose first line isnoexecnow, andrise.m2mdturns it back into the fence (Runnable documents).rise.demoworks in a folder of its own instead of overwriting and deleting ademo_model.rsof the caller’s;yahooSendMailputs the preferences of MATLAB and the Java mail properties back when the call ends, the password included;keepwith every variable of the workspace no longer clears them;utils.error.validgives one answer for a cell matrix;cell_clean_formulaandcellmultkeep the parentheses of a sum; andgrobner_solvegives each unknown a name of its own and reads a sum of products as a sum.Fixed: four replication examples. In
MarkovSwitching/GavinKeenRichterThrockmortonthe marginal cost multiplied by(1-alpha)^(1-alpha)*alpha^alphawhere it divides, and the steady state it implied was not an economy (investment 70 percent of output, consumption 10, hours 2.96); it is the variable cost over output now (investment 20 percent, consumption 60, hours .30). The steady state of the binding regime solves the pricing and resource equations with the cost of price adjustment (the residual was 0.099), and the constant-parameter version no longer boundsRin its steady state. InVariousModels/PeterIreland/Endogenous_JME2003the observation equations of the nonlinear model scaled every response bylog(xss): they arelog(x), and the first-order responses of the observables are those of the linear model. Inproductivity_RED2008the capital Euler equations use the growth factor of the capital law,ZG_I, instead of the technology in levels (the steady state is unchanged). Insgusea_JEEA2013the steady state callbacks no longer return the first steady state they computed whatever the parameters, andsstate_modelreturns the parameterseta_Handeta_Fthat the model reads and gives no value, without which the steady state could not be solved andmaster.mstopped at the search for starting values.Fixed: the satellite system’s reading of an equation. A shift without a sign (
x{1},x{0}) is the offsett+1,t+0it says (it became the unknown namest1andt0); a white space before the brace (x {-1}) no longer makes the lag a current value, so two equations that lag each other are not a cycle; and the names of an equation are read where they stand: theeof1e-3is not a name, andxinmax(x,0)is not dropped.Fixed: edges of the accuracy tools. The grid of
accuracy_plotfor a variable whose steady state is zero runs from-spreadto+spreadin its own units (it was one point repeated); a quadrature grid of more than 1e7 nodes is an error that says how many were asked for;perturbation_reportputs back the random stream of the caller; andaccuracyandaccuracy_plotunder a solve paradigm warn with the number of one-step forecasts that fell back on the engine’s previous solution. See Solution accuracy.Fixed: the Arnoldi stability check says when it did not converge; the RLL guardrail and the legacy solver.
stability.matrix_freerepeats an iteration that did not converge with a larger subspace and returnsconverged;moment_stabilityreports it and does not call stable a radius it could not certify. The guardrail of the recursive local linearization takes the radius from the block of the predetermined variables (the same radius, cheaper on large models), and the help of'shalva_qz'says that it enforces no determinacy. See Failure diagnosis: diagnose(m) and friends and Extending RISE through paradigms.Changed: arrays that grew as a power of the number of variables. The
'matlab'derivatives, the shift of the policy coefficients of discretion, the first-order refinement of the joint self-consistent linearization, the household solver of the heterogeneous-agent steady state, the contraction of a reduction, the preconditioning of the generalized Sylvester equation, the moments of the shocks of the recursive engine andral.paradigmno longer allocate an array that is not needed; the solutions of the models that ran before are identical to the last bit. The folded tensors of the recursive solver and of the chain rules, and the product quadrature of the Taylor projection (optionquadrature_max_nodes, 1e7 by default), are checked before they are allocated: a size the machine cannot hold is an error that says how much was needed.Changed: the solution branch of ``ral.paradigm``, the names of a reduction, and two diagnostics.
ral.paradigmhas the optionbranchand warns when it linearizes the first of several solutions; a reduction is refused for a model whose variables or shocks are not those it was built for, even when the sizes agree;rtp.solvereportsinfo.column_scale_ratioin place ofinfo.cond_J, which was not a condition number; and the shock solver of the constraint engine returns its residual of feasibility and the stationarity of its shocks. See Model reduction.Removed: two internal solvers of the generalized Sylvester equation (
generalized_sylvester_directandgeneralized_sylvester_direct2) that nothing called.Fixed: checkpoints of the Metropolis-Hastings chains and states of the DSMH sampler are validated when they are resumed.
A checkpoint (
store_file,resume) was resumed by any chain that named its file: a chain with other bounds, starting point, proposal, covariance, burn-in, thinning, kind of sampler (rwmhorimh), surrogate or tuning options mixed its draws with those of the file and went on from a stale current density. The checkpoint records these settings now, and a chain that resumes it with other ones stops withrsamplers:checkpointMismatch, naming them (Nmay grow: a completed run is extended). The target is a function and cannot be compared: it is evaluated at the current point of the checkpoint before the chain goes on, and a value other than the recorded one raises the warningrsamplers:checkpointTargetChanged(the model, the data or the prior changed since, or the target is stochastic, as with a particle filter). A checkpoint written by an earlier version resumes withrsamplers:checkpointUnsigned. Resuming with the same settings is unchanged, bit for bit. See Posterior sampling.rise_dsmh: the same for the state passed asstate(rise_dsmh:incompatibleState,rise_dsmh:unsignedState,rise_dsmh:targetChanged); the resumed run still reproduces the uninterrupted one draw for draw.rise_dsmh: the help claimed that averaging the forward and the reverse estimate of every stepping-stone increment cancels the finite-sample (Jensen) bias of the log marginal data density. The two biases have opposite signs and cancel only if the two sets of weights have the same relative variance and effective sample size, which autocorrelated stage draws do not guarantee. The averaging reduces the bias;extras.log_z_forward,extras.log_z_reverse,extras.ess_forwardandextras.ess_reversegive the two sides of every increment and the effective sample sizes of their weights, so that a gap or a small sample can be seen.rise_dsmh: the striated (equi-energy) jumps draw from the finite pool of the previous stage’s draws, not from the continuous previous target, so that their acceptance ratio is exact only in the limit of a large pool; the help says so,striation_weight=0is exact for anyN, andextras.stages(i).pool_sizereports the pool of every stage.
Fixed: the marginal data density with many parameters or small variances.
The estimators of the
mddclass (mhm,is,ris,bridge,cj,mueller,swz) weighed the draws with a normal density built fromdet(Sigma)and the explicit inverse of the covariance matrix of the draws. For many parameters or small variances the determinant is 0 in double precision (45 parameters of standard deviation 1e-4: 1e-360), the log density of every draw was infinite and the estimate NaN or infinite. The log determinant, the quadratic forms and the draws now come from the one Cholesky factor (mdd.cholesky_weighting;mdd.normal_weightingis unchanged). Where the determinant did not underflow the estimates change at the level of rounding only. See The properties.
Fixed: ``utils.estim.bounds_transform`` refuses bounds that make no interval.
Bounds in reverse order (
lb=15,ub=-15) were mapped as if the interval were[-15,15]with the orientation turned round, equal bounds sent every point to NaN, andlb=Infwithub=-Inf(or both infinite with the same sign) was taken for the unbounded case and returned the identity.lbmust be smaller thanub(real numbers, infinities allowed): otherwise the errorutils:estim:bounds_transform:invalidBoundsnames the first position at fault. A variable to be held at a value is left out of the transformation by its caller. For valid bounds nothing changes, bit for bit.
Fixed: the steady-state warm start and custom steady-state solvers.
The cache of the last successful steady state (
sstate_warm_start) was keyed by the file name and three dimensions: snippets of the same dimensions, or a model file edited without changing a dimension, shared an entry, so that one model could start its search from another’s solution. The key has a digest of the names (endogenous, exogenous, parameters, definitions), their order, the layout of the constants and the dynamic equations; the values of the parameters are not part of it, so the draws of an estimation share an entry.The cache kept every model until it was cleared. It keeps at most 32 models and 64 MB now (the least recently used go first) and has the actions
remove(one model) andinfo(entries, bytes, keys):rise.engine.rstst.warm_start_cache('info').A custom steady-state solver (
sstate_solver) was accepted with four inputs orvarargin, while the engine calls any solver that does not have exactly four inputs with the solver options as a fifth argument:x=mysolver(fun,x0,lb,ub,options)was refused. Four and five inputs are accepted; anything else is refused withrstst:select_solver:invalidUserSolver.The criterion of a successful numerical steady state (
max|residual|belowmax(TolFun,1e-6)) and the way to read the residual achieved are written in Zero-th order approximation: steady state and balanced-growth path.
Fixed: the kernel density of a chain that sticks.
The correction of the bandwidth for the draws repeated after rejected proposals scanned to the end of the run from every draw of it, so that the cost grew with the square of the length of the run (0.8 s for 20,000 identical draws, 2.3 s for 40,000, 9.6 s for 80,000). The runs are found in one pass; the bandwidth is the same.
Fixed: help and example.
mh_samplerandapt_samplerreturn a cell with one struct per chain (Results{1}.pop); their help said a struct. The exampleTutorial3/howto_new.mgavemh_samplerthe optionthin(the property isthinning; a field that is not a property of the sampler is an error), indexed the cell as a struct and calledmcmc_mdd, which no longer exists: it builds themddobject from the draws of all the chains.The help of the normal distribution stated the central limit theorem for any distribution; it needs a finite variance (the average of independent Cauchy variables is Cauchy).
Fixed: the report documents (``rise.report``): series, charts, matrices, bands, their ribbons and the ids of the sections.
A series with other numbers of values and dates was cut to the shorter of the two without a word (three values and two dates gave two points), and a matrix of values was flattened into one line. They are now the errors
RISE:report:seriesLengthandRISE:report:seriesShape. A RISE series with pages (scenarios, draws) drew its first page only: each variable of each page is a line, namedname (page p).rise.report.matrixaccepted labels that did not fit the data, and the renderers dropped what was not labeled (one row label for a 2 x 2 matrix printed one row). The check oftableapplies to it (RISE:report:matrixShape) and its data are two-dimensional.rise.report.bandstook the first series of whatever it was given, from the central path and from each edge, whatever they were called. Each of the three is now one series (RISE:report:bandSeries). An edge given as a bare vector with as many values as the central path takes the dates of that path.The two edges of a band were joined by position (and the web page and the PDF took the dates of different edges), and a missing value did not break the ribbon: one polygon shaded across the hole. The edges are now joined by date (
rise.report.ribbon_runs), and a date where an edge is missing, or where the band has no value although the path has one, ends a piece: one closed area for each stretch of consecutive dates, on the page, in print and inplot_fanchart.A constant series gave a window of no height on the web page (its padding,
0.08*eps, rounds away at any level but zero), and its ticks were halved until they underflowed. The window is a share of the level. Sections with the same title (andA BwithA-B) shared one id, so that the contents list pointed at the first of them: each section has an id of its own (a-b,a-b-2, …). Test:models/dsge/io/webreport/test_report_audit_b2.m.
Fixed: the web model report (``webreport``) for models with one parameter, missing responses and many regimes.
The page read the shape of a matrix off its first element, but a 1 x 1 matrix is written as a number and a single row or column as a flat array: the value of a one-parameter calibration was missing, a row of three regimes became one column of three values, and a missing first value stopped the page. The number of regimes says what a flat array is.
A missing response was drawn as a response of zero, joined to its neighbors. The line is now broken at the gap (a point alone is a dot), the vertical range ignores it, and the table and the tooltip show a dash.
From the fifth regime on, the regimes took the color of the fourth. The palette has eight colors (light and dark), and from the ninth the lines and the legend swatches are dashed. The IRF table no longer transposes the data of a variable again for every cell. Test:
infrastructure/reporting/test_webreport_template_data.m.
Fixed: ``shade``, ``recession_dates``, ``save_figure``, ``utils.plot.multiple`` and ``utils.plot.locate_ticks``.
shadediscarded every interval that began before the axes, even one ending well inside them, and never clipped the finish. It ended withhold offwhatever the caller had and, with two y axes, switched to the left side. The interval is clipped to the visible range, the hold state and the side in use are left as they were, and the bands are drawn on the side in use with its limits.recession_dateslost an episode of one observation, and one at the end of the sample, and merged it with the next.save_figureannounced the files it had not written and closed the figure after exports that had all failed. It names the files written (files = save_figure(...)returns them), is the errorsave_figure:nothingSavedwhen none could be written, and closes the figure only when every format asked for was written.utils.plot.multipletook any error of the plot function for a wrong number of outputs and ran the function again with fewer (up to three times); only errors about the number of outputs go on to the next try, and an error no longer leaves every warning of the session off.utils.plot.locate_tickswith no tick asked for never returned: it returns none. Tests:infrastructure/core/plotting/test_plotting_audit_b2.m,infrastructure/core/plotting/test_locate_ticks.m.
Fixed: estimation leaves the diary and the warnings of the session as it found them.
estimatestarted a diary forestim_capture_outputand stopped it, withdiary off, on its last line: a failed or interrupted estimation left it recording, and a normal one closed the diary of the caller. The diary is put back as it was (on, in its file, or off) however the estimation ends.find_posterior_mode,hessianandmode_curvatureswitched the numerical warnings off and back on at their last line: they are restored on an error too. With several models and a pool, each model is estimated with the warnings off on its worker and back as they were after it, instead of off for as long as the pool lives.The optimizer’s constraint call evaluated the nonlinear restrictions again at the point where the objective had just evaluated them (the cache of the last point was never filled), and a model without restrictions pushed the parameters for an empty answer. Neither happens; the values are the same. Tests:
models/dsge/estimation/model_methods/Test_estimation_state_audit_b3.m.
Fixed: ``stoch_simul`` with no autocorrelations, the simulations of ``frontier``, ``predictive_analysis``, ``report`` and the PDF publisher.
stoch_simulwithautocorr_ar=0ended with “unrecognized field autocorr” after the moments were computed: the field is there, empty.frontierkept the number of simulated periods instats__.simul_periods__while the documentedstats__.simul_periodsstayed 0.predictive_analysisran the function of the user twice on the baseline model before the first draw (to check it and to learn what it returns), with their cost and their random numbers, and refused a call whose baseline could not be evaluated though every draw could. It is run once for each draw, and the first draw gives the layout of the outputs.report(m,destination,items)accepted the legacyrprtonly. Anyrise.engine.reporting.rnotesis a destination (rprtis a subclass), and the message names the classes.The format functions of an
rnotestable (FormatFuncs: a test and an action,bold,italics,underlineor a color) were never applied to numeric data: the test was givenstr2doubleof each cell, which is NaN for a number, and an error of the test was skipped without a word. The test is given the numbers of the cells, and one that does not return a value for each cell is the errorrnotes:table:FormatMask.Publishing a report as
report.htmlcompiled it and then looked for a file that pdflatex never writes. Only.pdf(or no extension) is accepted:rnotes:publish:UnsupportedExtension, before anything is written.Under the M expansion with self-consistent points the refusal of the steady state alone no longer speaks of an order 0 (the order is positive; the documentation says so). Tests:
models/dsge/model_creation/entry_points/Test_model_methods_audit_b3.m,models/dsge/model_creation/entry_points/Test_predictive_analysis_calls.m,infrastructure/reporting/test_reporting_audit_b2.m.
Fixed: solvers that failed on the iteration where they succeeded, an iteration limit that was not the one asked for, and a loop without limit. The Newton and functional-iteration solvers of the recursive local linearization, the Taylor projection solver and the outer loop of discretion no longer report a failure when their last permitted iteration solved the problem, and the unique steady state of
sstate_uniquestops aftersstate_solver{2}.MaxIterpasses with return code 1.Fixed: the mean-square stability algorithms disagreed on a single regime.
gmhandcfmcompared the largest root of the transition withstability_criterionwherematrix_freecompared the radius of the second-moment operator, its square. All three now return that radius. See Failure diagnosis: diagnose(m) and friends.Fixed: reports of accuracy.
perturbation_reportfailed with a burn-in of 1 and reported one date too many with a larger one;accuracyand the quadrature of the shocks failed on a model without exogenous variables.Fixed: edges of the heterogeneous-agent and reduction code. The HANK price loop no longer takes the first household solution for the fixed point when it has no aggregate to compare with; the contraction of a reduction is recomputed when its maps change;
dct_basisand the variable map of a reduction handle an empty candidate set and a missing perturbation parameter.Fixed: the historical bridge and the brute-force simulation with a shock horizon, soft conditioning when every draw fails, and ``parameters(cell)`` with several parameterizations. A model solved with
solve_shock_horizonabove zero is refused by the brute-force simulation and the resimulation bridge with an explicit error (it failed on matrix dimensions), soft conditioning withsimul_soft_conditioning‘mean’ returns the failure code when every draw failed, and the names head each page ofget(m,'parameters(cell)').Fixed: the Taylor projection adapter and export.
rtp.from_riseaccepts the model object,rtp.rtp_optionshas the optionorder, andrtp.to_risemarks both phases solved and refuses a solution whose policy at its anchor is not the steady state.Fixed: smaller edges of the constraint engine and the solvers. The Jacobian of the constraint engine uses central differences by default (complex-step gives zero for
abs,maxandmin); the neutral transition routine of a paradigm returns[Q,retcode]; the Sylvester fallback accepts a system without variable with a lead; the Picard iteration of the M expansion with self-consistent points no longer raises a damping below 0.5; the random initial guess of the matrix-quadratic solvers is finite without leads; thedebugcomparisons of the kernels of order 4 and 5 against a reference implementation that is not part of the toolbox are removed.Removed: ``forecast_with_constraints_functional``, an older copy of
forecast_with_constraintsthat nothing called.Fixed: the page on the user-defined solver of the first-order perturbation. It described
B, the shock coefficient matrices, as an input andTe, the impact of the shocks, as an output of the solver. The solver getsBempty andTeis ignored: RISE computes the impact of the shocks from the solution after the call. A solver that returns several solutions stacks them in the fourth dimension ofTz_pband returns one code for each.Fixed: ``rise_lshade`` and ``rise_jso`` never returned when the objective was sometimes Inf or NaN. A finite trial that replaced a parent without an objective value (Inf) improved it by an infinite amount, the weights of the success-history update were Inf/Inf = NaN, so were the memories of the scale factor, and the Cauchy draw of the factor (repeated while it is not positive) compared NaN with zero forever: the second generation was an infinite loop. The weights are equal when they are not finite. A parent whose value was NaN could not be replaced at all (nothing is smaller than NaN); a trial with a value now replaces it. An objective that is finite everywhere gives the same run, bit for bit. The other global optimizers (
rise_de,rise_cma_es,rise_abc,rise_aco,rise_bbo,rise_mads,rise_agsk) return a finite incumbent consistent with its point for such an objective, and a NaN value when no evaluation is valid.Fixed: the Newton step of ``mynewton``, and the covariances of ``satellite.estimate`` and of the local projections, are not computed from Gram matrices.
mynewtonsolved the damped normal equations(J.'*J+lambda*I)*dx=-J.'*fwhatever the conditioning of the Jacobian J. The condition number ofJ.'*Jis the square of that of J: withcond(J)=3e5the step was right to about 5 digits.J.'*Jstill chooses the damping (the samercondtest, the samelambda), but the step is-(J\f)when no damping is needed and the least squares problem[J;sqrt(lambda)*I]*dx=[-f;0]otherwise, which has the same solution as the normal equations. For a well-conditioned Jacobian the steps differ at rounding level.satellite.estimatetook the standard errors frominv(X'*X)and the local projections the covariance of their coefficients frompinv(Z.'*Z); both now use the R factor of the QR decomposition,(X'X)^-1=inv(R)*inv(R)'. With two regressors that differ by 1e-6 (cond(X)of 2e6, the Gram matrix at 4e12) the standard error of the intercept was off by 5e-4 (relative); they now agree with the singular value decomposition to 1e-12. Elsewhere the results change at rounding level.
Fixed: ``bee_root`` took a failed evaluation for a valid starting point. A residual that is NaN or complex, or a point outside the bounds, is replaced by a finite penalty (1e8), and the check of the seeds was
isfiniteof that value: every seed passed, none was ever replaced, and an objective that fails everywhere ran to its iteration limit on penalties. A seed now counts as valid when its residuals could be evaluated; a failed one is replaced by a draw between the bounds (it was a draw from the unit cube) up to 20 times, and a colony in which nothing, the starting point included, could be evaluated stops withrise:bee_root:invalidStart.Fixed: the BFGS updates of ``csminwel`` and ``newrat`` accepted a negative curvature. The inverse Hessian was updated whenever
|dg'*dx|>1e-12, so a step along which the gradient decreased turned it indefinite (H0=1,dg=-1,dx=1gaveH=-1). The update is made fordg'*dx>1e-12only andHis kept otherwise, as it was for a vanishing curvature. A run that never met a negative curvature is unchanged; one that did follows other iterates.Fixed: ``latin_hypercube`` was quadratic in the number of points. Each draw of each variable scanned the K bins left (
findon a K-entry row, n*K times); a design of 2e5 points of one variable took about 10 seconds. One random permutation of the bins per variable gives the same design, every bin of every variable holding exactly one point, in milliseconds. The points are not the ones drawn before from the same seed (the random numbers are used in another order).Changed: the Lyapunov solver ``schur`` has the option ``UnitRootMargin``. The roots with modulus above
1-1e-6were taken for unit roots, silently (T=0.9999995,Q=1, whose variance is about 1e6, came back infinite with return code 302). The margin is the fieldUnitRootMarginof the solver options,lyapunov_algo={'schur','UnitRootMargin',1e-9}; the default is unchanged and a value outside [0,1) is refused. The help of the solver describes it.Changed: ``rise.engine.numerics.cov.project`` says whether it altered the matrix. Its second output,
is_altered, is true when an eigenvalue was moved to a bound or the input was not symmetric. The help states that the default bounds,sqrt(eps)and its inverse, are absolute (in the units of the matrix) and that a caller who knows the scale of its matrix gives them;update_momentsdocuments itsethe same way. The defaults are unchanged.Fixed: ``hessian.outer_product`` computed its matrix twice. After the product of the gradient matrix it rebuilt the same matrix as a sum of per-observation outer products that nothing read. The Hessian and the gradient are unchanged and the loop’s work is gone.
Fixed: ``truncated_multivariate_normal.gibbs`` rebuilt the conditional covariances in every sweep. The coefficients and the conditional standard deviation of each coordinate are read off the precision matrix once, before the sweeps (the cost of a sweep falls from O(n^3) to O(n^2)); the draws follow the same law and differ at rounding level.
New: x at risk, the forecast distributions behind growth at risk, at every date of the data.
rise.engine.numerics.x_at_risk.x_at_risk(m,nf,draws)filters the data and, at every date t, draws the regime of t from the updated regime probabilities, starts from the updated state of that regime and simulates nf periods ahead with drawn regimes and shocks. Row t of each output series holds the N forecasts made at t (dates x nf x N): their 5th percentile is the variable at risk. In a regime-switching model the tail then moves with the probability of being in, or entering, a bad regime, not only with the shocks;fkst.regimerecords the regime path of every draw. The draws are a struct array of parameters, a posterior sample (fields x and f) or a number of draws at the parameters of the model.seedmakes a run reproducible andpartitionssets how the draws are split among parallel workers; the result does not depend on it. Draws that do not solve return their code and NaN paths. The plots ofrise.engine.numerics.x_at_risk.plot(fan charts, densities, quantiles, risk maps, scenario comparisons) take these outputs, and most take one weight per draw, e.g. from entropic tilting. See X at risk. Tutorial: course library, chapter Risk analysis (lecture/demo_risk_regimes.m, and the lecture, lab and homework now use it). Tests:models/dsge/forecasting/x_at_risk/.Fixed: x_at_risk and its plots.
Each future slot of the regime output held the regime the period came from, not the one it was forecast under: the first future slot repeated the jump-off regime and the last regime was never recorded. Slot h+1 now holds the regime of period t+h.
The regimes and the shocks came from the global stream inside parfor, so a result could not be reproduced and depended on the workers. Each draw now has a substream of its own. The numbers differ from those of earlier runs.
The jump-off state is the updated state of the regime drawn, not the average of the regimes’ states. One regime gives the same state as before.
A parameter draw that did not solve was filtered anyway, with a warning per draw and zero regimes. A one-variable model failed. Without the parallel toolbox the progress monitor failed.
The weighted routes of
fan_chart,fan_chartx,quantilesandrisk_mapcalled a helper by a name that does not resolve, and failed.fan_charttook five quantiles for granted: three failed, and the third of any five was drawn as the median. The bands now pair the quantiles from the outside in, and the median is the median.fan_chartxfailed for one interval with its default colors.risk_mapignored the weights in its surface and slope modes.compare_tail_risk,quantify_scenario_bandsandinterconnected_tail_maptook the quantile across nothing for a single date (one value per draw, or a failure).distribution_snapshotleft the draws at the maximum out of the density, and divided by zero (then failed) when all the draws are equal; it now draws a point mass.
Fixed: a beta prior at the largest standard deviation a beta can have. A beta distribution on [c,d] with mean m has a variance below (m-c)(d-m); at that value both shapes go to zero, two point masses at the ends. A prior
{start,0.1,0.3,'beta'}was fitted all the same, with shapes of 2e-14 and 2e-13, a prior with its mass on 0 and 1. A mean and a standard deviation at or beyond the limit are now refused (rdist:beta:moments); priors below it are unchanged. See Prior distributions and implementation.Improved: the normal-inverse-Wishart prior of a large VAR is evaluated from its two factors.
niwandgenerate_niw_priorno longer form the Kronecker product of the innovation covariance and the scale matrix (467 GB for 500 equations of 501 regressors). The values are the same to rounding.Changed: the local-projection identified set draws a direction from n random numbers instead of n^2. The distribution is unchanged and the first draw of a seed is the same; the later draws of a seeded run are not those of before, so a set moves within its sampling error. See Local Projections.
Fixed: files that include themselves, snippet names, policymaker orders, the size of a heterogeneous-agent expansion, and what is held between calls.
A model file that includes itself, directly or through other files, started a recursion that stopped only at the limit of MATLAB’s own. It is the error
rdico:preparse:includeCycle, which names the files of the cycle. A file read twice without being inside itself (twice in a row, or by two files) is read twice, as before, and an include in a branch that is not taken is not read.The name given to
dsge_from_code_snippetwas used as a regular expression:a.bfound the snippeta_b, andm[1]orf(x)were not found. The name is matched as written. A name given to two snippets of the script is an error (RISE:from_code_snippet:DuplicateSnippet); the first was taken without a word.The orders of the policymakers of an
@optimization_problemare whole numbers. An order that was not (@order=abc,1.5) was accepted as soon as another policymaker had an order, and the check for a skip went through every value between the smallest and the largest order, so the orders 1 and 1e12 asked for 1e12 values. The sorted orders are compared: a skip is reported at once (rdico:policyOrderGap) and an order that is not a finite whole number is the errorrdico:policyOrder.A heterogeneous-agent model whose axes make more than 20000 cells is refused before any cell is written (
hank_expand:tooLarge), with the number of cells, of individual variables and of pairs of cells the expansion would have. The limit is therise_flagsentryhank_max_cells(inflifts it).The monomial bases and the product tables of the automatic-differentiation engines were kept for the rest of the session, however many and however large. They are kept within 1 GiB, the least recently used going first; a table that is dropped is built again when it is needed.
Reading a model file took time quadratic in the number of lines (the lines left were copied for each line read, and the rows kept for each row kept). A generated model of tens of thousands of lines is read in time proportional to its length.
The memory of the derivatives of high order is documented: a sparse matrix keeps a pointer for every column, so the derivatives of order k with respect to n variables cost 8*n^k bytes however few of them are not zero (see “Order of approximation” in the page on solving).
See Model file language, Optimal policy, Heterogeneous agents (HANK) and Solving.
Fixed: budgets and exit flags of the global optimizers; the population of rise_de.
rise_abc,rise_deand the rest of the+globaloptfamily returnedexitflag=1whatever stopped them,MaxIter=0included. The flag now says why, as MATLAB’s optimizers do: 1 when the algorithm reached its own goal (a known optimum, a collapsed mesh), 0 when a budget ran out, -1 after a manual abort. The point returned is the best one evaluated, as before.MaxFunEvalsandMaxTimewere looked at between generations only: a start and a population of three withMaxFunEvals=1evaluated the objective four times, and a population of 40 under a time budget of a tenth of a second was evaluated whole. The evaluation that would exceed either budget is not made: the search stops there and returns the best point evaluated so far (exitflag 0). The starts count as evaluations; the HessianH, when requested, costs further evaluations that the budgets do not cover. A run that no budget binds is unchanged, bit for bit; one that a budget stopped in the middle of a generation now stops earlier. See Stochastic Global Optimization.rise_deaccepted populations too small for its strategy and failed in its first generation (rand/2withNP=5,rand/1withNP=3). It checksNPagainst the donors of the strategy (rand/14,best/1andcurrent-to-best/13,best/25,rand/26) and refuses an unknown strategy before the population is evaluated.
Fixed: the optimizers wcsminwel, wnewrat and wgmhmaxlik, and those behind them.
Called with extra arguments for the objective, the three wrappers failed with “too many input arguments”: each handed them to the optimizer, which handed them to a closure that already holds them.
They reported success whatever happened:
wnewratandwgmhmaxlikalways,wcsminwelalso at its iteration limit.exitflagis now 1 when the optimizer’s own criterion is met, 0 at the iteration limit (and forwgmhmaxlikwhenMaxIterallows fewer than its three rounds), and -2 when the start or the end point has no usable objective (not finite, or outside the bounds). The message ofwcsminwelfor the Hessian recomputed by finite differences lost its last letter. See Posterior maximization.csminwelfailed with “output argument not assigned” when the objective at the start exceeded 1e50; it returns the start, with return code 8 (wcsminwel: exitflag -2). When it picked a candidate by its fallback it paired it with the gradient of the previous iteration; it now uses the gradient of the candidate. A run that takes that branch follows other iterates than before.wnewrat: a point that ended on or beyond a bound was moved just inside without evaluating the objective there, so that the value returned belonged to the point before. It is evaluated again. Reaching the iteration limit stopped the run with an error (a call to a function that is not on the path).sa.printlinefailed when given a file id, andsa.gmhmaxlikwith an option string ('NumberOfMh',2,...) called three functions that MATLAB does not have.
Fixed: bee_gate with fewer than three nodes never returned. Half the colony, rounded, are employed bees and each takes its donor among the others by drawing until the donor differs; with
MaxNodesof 1 or 2 there is none.MaxNodesmust be an integer of at least 3 (rise:bee:maxNodes), checked before the objective is evaluated. The colony class itself failed when called without options.Fixed: nonlinear solvers and the fixed-point iterator at their limits.
mynewton(f,x0)without options failed on a missingTolX. The default options of the nonlinear solvers now holdTolX(sqrt(eps)) andMaxFunEvals(Inf).The squared norm of the residuals used the nonconjugating product, so a complex residual had a negative or complex norm (
1igave -1); it is real and nonnegative. For real residuals nothing changes, bit for bit.root_solvedid not test its starting point: with a budget of one iteration an exact root was reported as “converged to a point that is not a root” (exitflag -2). An iteration limit with a residual left is exitflag 0.fix_point_iterator, behind the doubling Lyapunov solver and the refinement of the Maih-Waggoner solutions, reported the iteration limit (retcode 21) for a fixed point reached on the last iteration allowed, and failed withMaxIter=0(no output); the initial guess comes back with retcode 21.
Fixed: probabilities, quantiles, calibration and draws of the prior distributions.
The cumulative distribution of
uniform,lognormal,arcsine,pareto,raised_cosine,weibull,kumaraswamy,folded_normal,igamma,igamma1,sichisq,betaprimeandinverse_gaussian, and the helpersutils.cdf.arcsine,exponential,kumaraswamy,log_normal,pareto,raised_cosine,weibullandinverse_gaussian, was not a probability outside the support: a value beyond [0,1] (uniformat -1 was -1), NaN (lognormalat 0), a complex number (weibullbelow 0) or an error (betaprimebelow 0). It is 0 below the support and 1 above it, a NaN stays a NaN (levyandtruncated_normalreturned 0 for it), and nothing changes inside the support, bit for bit.t: the quantile function lost its endpoints for 1 < degrees of freedom < 1000: the quantiles of 0 and 1 (-InfandInf) were missing and the vector was shorter than the probabilities.lognormal: a small standard deviation was computed from a difference of two exponentials that agree to all their digits (a standard deviation of 0 for a log standard deviation of 1e-10), and the reverse conversion from a difference of logarithms (a log standard deviation of 0 for a standard deviation of 1e-10 times the mean), so that a lognormal prior with a standard deviation of 1e-4 times its mean could not be calibrated. Where the log standard deviation is below 0.1 (a standard deviation below a tenth of the mean)expm1andlog1pare used; the expressions are the same elsewhere.A standard deviation above 400 given with a mean was replaced by 400, in silence, by the priors calibrated by a numerical fit (
gamma,beta,betaprime,folded_normal,half_normal,kumaraswamy,pareto,raised_cosine, the triangular distributions, andgammatauandigamma1): a gamma with mean 1000 and standard deviation 1000 had a standard deviation of 400. The standard deviation asked for is the one matched; an infinite one (a distribution without variance, as the inverse gammas of the variances of a model) is still matched with 400, and a NaN is refused (rise:rdist:sdNotFinite).dirichlet: the variance asked of the prior (fh([],'var')) is the covariance matrix of its elements (it was the sum of their squared standard deviations). A declaration whose concentrations are not positive is refused: a standard deviation of the left-out element at or abovesqrt(m*(1-m))(mits mean), a mean that is not strictly positive, or means that sum to 1 or more.rise.engine.estimation.rdist.utils.draw(the prior draws of predictive analysis and ofwhere_do_you_live) stopped on a Dirichlet group (it allotted one row to the group instead of one per parameter), and put the draws beyond the bounds of the prior (the truncation of the tails and the bounds given with the prior) on the bounds, so that each bound carried the probability of the tail it cut off (62% of the draws on the bounds of a standard normal restricted to [-0.5,0.5]). The draws come from the prior conditioned on its bounds: for a given seed they differ slightly from before, and no draw sits on a bound.A user-defined prior tabulated its cumulative probabilities, the starting points of its quantile function, as the integrals of the density up to the values of the density (10,000 numerical integrals, unrelated to the grid); it uses the cumulative trapezoid rule at the grid points.
The calibration of
arcsineby quantiles starts from the support that has them (closed form): its cumulative distribution is flat outside the support now, and a search that starts with the quantiles on the ends of the support has no direction to go in.The multivariate kernel density of a constant sample was NaN, with a singular-matrix warning. It is a point mass: infinite at the point, zero elsewhere, with the warning
rise:multivariate_kernel_density:constantSample.
Fixed: parallel tempering (``apt``), the acceptance ratio of the slice sampler, and the sampler wrappers and shortcuts.
apt(target,x0,lb,ub), a documented syntax, stopped on the options it did not have.The number of stages
Hofaptmust be an integer of at least 2 (one stage, or a fraction of a stage, passed the construction and failed in the first swap).With
separate_shape_adaptation=false, the adaptation of the mean shrank it a second time at each update ((1-gamma)*m+gamma*m_mean, wherem_meanis already the average deviation fromm): the mean moved even when the stages did not, and the adaptation of the shared covariance followed it. The robust adaptation (ram_adapt=true) with a shared shape stopped at the second stage (the shared factor has a single page); each stage now updates it in turn, with 1/H of the step. The default, separate shapes, is unchanged, bit for bit.The acceptance ratios of a continued
aptrun were the acceptances of all the runs over the iterations of the last one (above 1); they are those of the run. The acceptance ratio of aslicechain stopped byMaxTimeorMaxFunEvalstook the planned number of sweeps for the number made (above 1); it counts the sweeps that moved the point, which is all of them for a chain that runs to its end, as before.sampler_rwmh,sampler_imh,sampler_aptandsampler_slicestopped onoptswhen it was left out (the four-argument call of their help); their help gives the real defaults (N=5000,burnin=100).mh_sampler,apt_samplerandslice_samplerturned the objective of the draws back to the sign of the function given, but not that of the best draw:best.fislogfatbest.xnow. The call ofmh_samplerin the LWZ example passes its covariance and valid options.
Fixed: ``rise_dram``. A results struct handed over to continue a chain gave the default proposal scale 2.38 whatever the number of parameters (the default
2.38/sqrt(d)counted the elements of the struct);dis that of the starting point. A burn-in that is not an integer is refused (it failed in the allocation). The acceptance rate is that of the proposals after the burn-in (it counted the acceptances of the burn-in), and the help says that the covariance returned is that of the retained draws, not the covariance of the proposals.Fixed: the transformation of bounded parameters (``utils.estim.bounds_transform``). The inverse of a bounded interval returned NaN for a point far from zero (below -709, and 0*Inf for a lower bound of 0):
utr(-1000)on [0,1] is 0 now. A point on a bound was moved inside by 1e-14, which does nothing from 128 on and left-Inf(the transformation of[1e10,1e10+1]), and crossed an interval narrower than that, with a complex result: the offset is one spacing of the numbers when 1e-14 is below it, and at most a quarter of the width of a bounded interval. Intervals whose bounds are below 128 in absolute value and whose width exceeds 4e-14 are unchanged, bit for bit.Fixed: blockwise optimization (``estim_blocks``). The start of the clock of
blockwise_optimizationwas not of the format of the time budget (clockagainstdatetime), so that the first look at the budget failed and no estimation with blocks could start.beeaccepts astart_timeof the format ofclockor adatetime. With its default optimizer,bee_gate, the iterations of a block are counted as one (its fourth output is not a summary with the iterations).Fixed: Monte Carlo filtering and MCMC summaries.
logistic_regressionoverwrote the column of a parameter calledResponsewith the outcome; the outcome is calledResponse_1then.pca_analysisandcluster_analysisstopped for a single parameter (no second principal component); the second axis is zero.The Monte Carlo standard error of
mcmc_summary_tablewas 0 with fewer than four draws (one batch of draws, whose mean has no variance); it is NaN.
Removed: two unused files.
utils.mcmc.update_scaling(its lower bound of the scale was an empty branch) andrise.engine.estimation.rsamplers.bayesgraph_diagnostics(for a single chain it used a variable it had not defined); nothing called them.Fixed: the parser of the model files: names with blanks, steady-state spellings, auxiliary names and the text it rewrites.
A model file whose name holds a blank (
dsge_model('my model')) was looked for without it (mymodel.rs) and not found. The file is read under its own name; the model is still named without blanks.x(ss),x(sstate)and their brace forms were refused as a wrong specification of time, whereasx(stst)worked. The three spellings of the steady state are accepted.The auxiliary variables of the expectation operator (
AUX_EXPECT<n>) and of the discretionary dollars (DISCRDOLL<n>) were numbered from 1 in every pass over the same dictionary, so a second pass created the names of the first. A name already in the dictionary is skipped.The auxiliary steady-state equations that depend on one another were substituted into one another with the semicolon of the substituted equation inside the parentheses,
(2*(4;);), and with the text of a name replaced inside longer names (xinlongx,c(1)inabc(1)) and in the left-hand sides. They are substituted as whole names, in the right-hand sides, without the semicolon.The
saveasoption: a blank line of the expanded model stopped the export with an index error, and an error while writing left the file open.
See Model file language.
Fixed: the model-file converter: includes, descriptions, helper names, function names and paired equations.
An included file is sought in the folder of the file that includes it first, then in the current folder and on the path as before. It was sought in the current folder only, so a model converted through its path from another folder failed, or read another file of the same name.
The helper files written next to the model (
_params,_initval,_endval,_sstate) were declared with the folder of the destination in the name of the function when the destination had a folder (function ...=out/model_params). They are named after the file alone, and written in the folder.The description of a variable,
long_name='Output (real)=GDP', lost its parentheses, its equal signs and the wordlong_name. It is kept as it is (a double quote in it becomes a single quote).Uppercase function names were lowercased by a literal replacement:
EXP(also changed theEXPinEXPECTATION(or in the name of a variable. Only whole names that are called are lowercased.A pair of a dynamic and a static equation is recognized in either order; it was recognized with the dynamic equation first only, and the static first left both equations in the model. A static equation without its dynamic partner is an error (
rise:converter:unpairedStaticEquation).
Fixed: the symbolic engine: derivatives without expressions, and explicit lists of indices.
Anonymizing the derivatives of a constant, or of variables that do not occur in the equations, failed with an index error. They evaluate to a sparse zero of the right size.
A symbol given as
{'v',[1,2]}, an explicit list of indices, failed (the vector was used as a cell and the format of the names was invalid). It now gives the same derivatives as the family{'v','\d+'}.
Fixed: transition matrices, callbacks that name their inputs differently, function files of one character, snippets.
A transition matrix given as a structure with one chain (a single two-state chain) was replaced by the identity. The chain is evaluated.
A transition matrix that is not square (
[.2 .3 .5]), empty or complex is refused (return code 3); a row of probabilities was accepted.Expressions that name their inputs differently (
@(x)x+1and@(longname)longname+2) gave invalid text when combined into one function. The combined function stacks the expressions as they are, and nothing is written to a file for them.A function file of one character (
f.m, given asf) could not be turned into a handle.dsge_from_code_snippetlooked for the snippet in the toolbox’s own file whenrise_startuphad not set its application data; the calling script is found without it.
Removed: files that nothing called.
rise.engine.sym.tsparse(the wrapper of the transpose of a sparse matrix, which nothing created; its product with a numeric matrix, itssizeand its linear indexing were wrong).rdico.time2growth, which read the numeric time column the wrong way round.rise.engine.parser.initialize_dictionary(it depended on a package that is gone) and the Dirichlet helpersutils.estim.format_dirichlet,utils.distrib.dirichlet_shortcuts,dirichlet_sum_weights,dirichlet_transformanddirichlet_untransform; the Dirichlet priors of the switching probabilities are handled by the distribution classes.
Fixed: the mean-square stability check merged regimes it may not merge. Regimes with the same solution are merged before the check, which is exact only if every merged regime moves into each group of regimes with the same probability. That condition was not checked, and an unstable solution could pass (a radius of 1.20 read as 0.57). The regimes are now kept when it fails; where it holds nothing changes.
Fixed: soft conditioning. A band far in a tail gave draws outside the band. The predictive distribution of a banded variable now keeps the shocks the plan fixes (they counted as zero) and is conditioned on the other hard conditions of the plan. Several bands are drawn jointly, with the correlations the model gives them, instead of one at a time; bands the freed shocks cannot meet at once are refused. See Forecasting and simulation.
Fixed: the constraint engine’s test for violated restrictions gave each horizon’s restriction the regime path of the whole horizon, and counted a residual that cannot be evaluated (NaN) as satisfied.
Fixed: an invalid covariance of the measurement errors was accepted.
solvenow refuses one (a correlation outside [-1,1], or correlations that cannot hold together) with the new return code 8. The brute-force simulator and smoother keep the correlations of the measurement errors. See Solving.Fixed: the HANK steady-state solver reported success with a distribution that had not converged (a periodic chain, or the iteration limit reached) and with a price/aggregate loop that had run out of iterations (
info.price_convergedis new), and failed on models with permanent types. See Heterogeneous agents (HANK).Fixed: a warm-started steady state (
sstate_warm_start) kept the cached value of a variable that the currentsstate_boundsfix.Fixed: solve paradigms and perturbation engines. A solution adopted from a dissolving paradigm (
ral.paradigm) is checked for stability; the Taylor projection starts from the perturbation solution itself (its guess was q! too small at order q >= 2), and its Newton solver no longer stops on a small residual alone: after a step larger thantol_step, the coefficients are corrected with the last Jacobian;rll.paradigm’s ‘sylvester’ Newton step solves the Newton equation; the higher orders of the self-consistent linearization fail when a Sylvester system does.Fixed: ``solve`` returned 0 when the identification of a VAR found no rotation. It now fails with the identification’s return code 801.
Fixed: ``is_stationary_system`` called a random walk stationary. The second moments of the states must now converge as well.
Fixed: dates and shapes. A one-date simulation history with announced shocks keeps its announcements on their pages (a model without announced shocks still reads its pages as dates);
plan2databaseputs each value at its own date; observed exogenous variables used by@epilogueentries are read at the dates of the path; a satellite variable namedtcompiles; the steady-state code writer keeps the spaces of quoted literals.Fixed: ``perturbation_report`` gives a linear model the verdict
exact(it saidfailed), and a model without a leadno forward equation. See Perturbation types for regime-switching models.Fixed: scenario plausibility, tilts, robust forecasts and local projections read their series on one calendar.
rise.scenario.plausibilityrefuses a missing (NaN) shock in a scored period, or a shock series that ends before the others, instead of scoring it as a zero (RISE:scenario:missingShockValues), and refuses shock series on different dates and the pages of a density forecast, which were aligned by position and laid end to end as periods (shocksNotAligned,onePage). Its tail probability no longer rounds to zero far out, and its q no longer rounds to 0.5 for a tiny scenario. The divergence is KL(scenario || model), as computed.rise.scenario.relocateaccepts a history of time series on the same dates (every one was refused as ragged) and refuses other dates and pages (historyNotAligned,historyOnePage).rise.scenario.tiltrefuses a negativestdorvartarget and a target that is not a finite real number (negativeSpread,badTargetValue); a miss or an effective sample that is not a number is a failure, andMinESSlies in (0, 1].utils.entropic_tilting.corereturns the moments it solved with (info.moments).utils.entropic_tilting.weighted_quantilereaches level 1 when the weights cumulate to just below one, and gives level 0 to a value with weight.rise.engine.var.lptools.estimaterefuses series on different dates and paged series (lptools:estimate:notAligned,lptools:estimate:onePage).utils.entropic_tilting.tilt_scenario, which nothing called, is retired.
See Scenario plausibility, Entropic tilting and Robust forecasts.
Fixed: user simulators and conditional forecasts.
A user simulator given through the
simulatoroption as{simulator, args...}was always refused, and a function handle failed; both run, with the extra arguments passed on.A perfectly conditioned system of conditions in small units is no longer refused (702): the rank test is relative to the largest singular value.
With
debug, the bound checks of the density conditional forecast report violated bounds.In the historical decomposition of constrained switching models, the regime weights are normalized also when every regime is feasible.
Fixed: HDMR, GP leave-one-out scores, the sensitivity KS distance and the Shapley decomposition.
hdmrbuilds its orthonormal polynomials exactly instead of fitting them from a random start (the means missed zero by up to 8e-4 on 40 draws); HDMR sensitivities change by the old fit’s error. Default names, predictions at numeric points,polynomial_integrationover any interval, an infinitesample_percentage, constant outputs (NaN with the warninghdmr:zeroVariance) andfirst_order_effectwith several outputs are fixed. See High Dimensional Model Representation.The leave-one-out Q2 and
loo_rmseofrise.engine.surrogates.gprefit the trend without each point, so they are no longer optimistic on small designs, and a design with a far-out point can now score far below zero (Q2 -19 instead of .92 foremulate(m,'method','gp')on the fs2000 log posterior); undefined scores are NaN and Inf.The KS distance of
sensitivity_reportand the exact Shapley decomposition ofrise.engine.resim_bridge.shapleyno longer need memory beyond the size of their answer (10 GB and 82 GB on large designs); their values are unchanged.
Fixed: the filter initialization’s checks of user values, and filtering utilities on their edges.
kf_user_initnow refuses negative regime probabilities (an error) and a covariance that is not positive semidefinite (retcode 311).With
kf_init_variance='exact', the observability of the diffuse directions no longer depends on the units of the observables.The sigma-point filters now return retcode 304 for an indefinite covariance instead of projecting it.
immrefuses occasionally-binding constraints above the first order.The HP filter of
simulatekeeps a straight line of two or three observations.
Fixed: edge cases of the numerical kernels.
The numerical Hessian (
numdiff.hessian) failed on a row vector of parameters, and the outer-product Hessian (hessian.outer_product) kept the first parameter only: a 1-by-1 Hessian for two parameters. Both now treat a row like a column; columns are unchanged, bit for bit.The numerical Jacobian built three n-by-n matrices of perturbed points before differentiating column by column (2.4 GB at n=10,000, whatever the number of rows of the result). It perturbs one point at a time; the values are the same, bit for bit.
cov.nearestreported a covariance as unaltered when no eigenvalue moved by more than 1e-6 (a variance of 1e-12 raised to 1.5e-8), and, withfarthest, measured the change after flipping the negative eigenvalues, which hid the flips. Raising or flipping an eigenvalue is now always reported, as is the symmetrization of a nonsymmetric input. The repaired matrices are unchanged.The orthant probability (
truncated_multivariate_normal.orthant) failed from 24 dimensions on: its lattice took 2d primes from a table of 46. The table grows with d; up to 23 dimensions the lattice is the same.The summary of regime partitions (
regime_partition.compute_stats) failed for a single simulation: it averaged the six statistics of the one row.Without the Statistics Toolbox,
quasi_monte_carlo.sobolandhaltonfailed in their Latin hypercube fallback (the arguments were in the wrong order). The fallback is randomized within its cells when the sequence would have been scrambled (the default), and centered otherwise.
Fixed: Lyapunov and first-order solvers at their limits.
lyapunov_algo='direct'forms the dense n^2-by-n^2 operator, whose memory grows as n^4 (12.8 GB at 200 variables). Above 64 variables it stops with the errorrise:lyapunov:directTooLarge, which namesdoublingandbartels_stewart; up to 64 it is unchanged.sandwichtook the real part of the solution of a complex problem (X=.25*X+(1+1i) gave 4/3, retcode 0); the solution of a real problem is real, as before.fevdcovchosen as the Lyapunov solver returned a 3-D array with retcode 0, whatever the truncation of its sum of 1000 steps. It returns the 2-D covariance, flags its finite columns, and gives retcode 21 unless that covariance solves the equation withinTolFun(roots near the unit circle).cyclic_reductionturned a convergence on its last allowed iteration into the iteration limit (retcode 21), and so did the perfect-foresight Newton (MaxIter=1on x-1=0 returned the root with exitflag 0).groebnerfailed after solving in its non-minimal mode (an undefined variable), andutils.solve.grobner_solvefailed with a single unknown.The Newton line search, when no step lowered the norm, returned a step it had halved after its last evaluation, with the function values of the step before.
Perfect foresight: the block-tridiagonal Newton failed for a single period (an index past the end), and the Krylov Newtons (
gmres_newton,jfnk) failed on a dense Jacobian, as numerical derivatives give.
Fixed:
bee_gatedid not count one of its objective evaluations. The generator of the candidates (the initial population and the bees that replace the exhausted ones) evaluates the objective once, at the best point, to find out whether it returns a return code. It drew the point of that probe with a function that reads the index of the candidate being generated, undefined at that moment: the probe failed in atryabout half the time, and when it ran its evaluation was not counted, so thatf-Count,funcCountand the trajectory log were one below the number of calls of the objective. The probe now evaluates the best point (the center of the bounds when there is none) every time, and is counted. The candidates accepted follow the same rule, since the objective thatbeehands to the generator always reports return code 0, but a seeded run changes: the probe no longer draws random numbers.Removed: files that nothing called.
cov.posdef(it kept negative eigenvalues) andcov.make_positive_definite(its repair stopped after 100 attempts, indefinite).The Kronecker helpers
A_times_k_kron_B,korder_matrix_vector,kp_shift_solve,qtkp_shift_solveandA_times_reordered_kron_Q1_Qk_times_B; several gave wrong results or failed on some of their arguments.fixedcoef_dsge_solvers.groebner, an unreferenced copy of themsre_solversone.The Kronecker helper
A_times_B_kron_C(its size guard compared a logical negation and never fired).fixedcoef_dsge_solvers.maih_waggoner, eight files of an unreferenced copy of themsre_solverspackage.utils.optim.weighted_samplinganduniform_sampling(the endpoint indices of the latter had half the probability of the others).
Fixed: posterior statistics and convergence diagnostics.
statistics: thehpdiinterval was the equal-tail interval (the percentiles of the two tails), longer than the shortest interval for a skewed posterior. It is the shortest interval between two draws that holds the share asked for, as inposterior_parameter_statistics; for a posterior with several modes the highest density region may be made of several intervals, and this is the shortest single one. The optionboundswas ignored (the bounds were computed and printed whatever its value, false by default). A call whosemomentswas false, the default, stopped on the covariance table after printing the others.posterior_parameter_statistics: with few draws (ten, say) the rankround(p*ndraws)of the lowest percentiles and deciles was 0 and the call stopped; the rank is at least 1, and the deciles are only computed when asked for. The median was the lower of the two middle draws for an even number of draws; it is the sample median.inefficiency_factors(obj,pname)without an order returned the factors of every parameter instead of the one asked for.geweke: a segment of fewer than 100 draws was cut in 100 groups, empty ones, and every p-value was NaN. Such a segment has groups of one draw, and a taper longer than the number of groups gives NaN.brooks_gelman: chains with the same means (a repeated largest eigenvalue of the between-chain variance) stopped the multivariate statistic with “more than one best”.
Fixed: the marginal data density object (
mdd).The moments of an earlier call were kept when the center (the mode or the mean of the draws) changed, and computed again when it did not: a second call with another center returned the first one’s estimate.
mhm(obj,tau): a truncation probability given without options was replaced by the default.1:.1:.9.The constructor required the Hessian to be positive definite, whatever the sense of the problem, so that the Hessian of a log posterior (
maximization=true, negative definite at the mode) was refused. It checks minus the Hessian of the log posterior, and the error says which sign is expected (rise:mdd:hessianNotDefinite). See The properties.
Fixed: densities and moments of priors, and kernel density estimates.
The log density of the folded normal was
-Inffar in the tail, where both exponentials underflow (at 40 for the standard folded normal, whose log density there is -800.2).beta,gammaanddirichletwith a shape parameter of 1 had a NaN log density at the end of the support where the density is finite (0*log(0)): beta(1,2) at 0, gamma(1,2) at 0, a Dirichlet at a vertex.The mean and standard deviation of
gammatau,igamma1andkumaraswamycame from ratios of gamma functions, which overflow beyond 171: NaN, or a wrong 0, for finite moments.Kernel density estimates (
posterior_parameter_statistics,fanchart,empirical_moments): finite bounds were replaced by minus and plus infinity, so that the density of a bounded parameter went beyond its bounds. A finite bound is the support of the density now (the draws must lie strictly inside); an empty or infinite one leaves that side open, as before, which is what every caller in RISE passes. The kernelstriangular,cosine,uniformandtriweightof the optionkernelstopped the call, andepanechnikovwas smoothed with a kernel sqrt(5) wider than the one its bandwidth is computed for: they run, with the bandwidth of their own variance. The defaultnormalkernel is unchanged. The correction of the bandwidth for repeated draws counted every later smaller draw as a repeat; it counts runs of equal draws, which gives the same for sorted draws (the posterior statistics and the fan charts sort them) and no longer oversmooths draws kept in chain order.
Fixed: steady-state constraints that use a definition. A constraint of
sstate_endo_param_swapsuch as'y-d', withda definition of the model, was refused as containing an unknown symbol.Fixed: smaller points of the samplers.
slice_sampler,mh_samplerandapt_samplerfailed on their short calls (withoutx0, or withoutSIG); they start at the middle of the bounds with the default covariance. Their “See also” lines no longer name a sampler that is gone.rise_dram: a NaN or complex target value was accepted for sure (min(1,exp(NaN)) is 1), and a start where the target is not finite is an error (rise_dram:invalidStart).The covariance tuner allocated all
burnindraws, and its debugging table, even when they were not requested.Reflection at the bounds (
reframe, frame style 2, not used by the samplers) left a point more than one width outside the box outside it.
Removed: four unused files.
constant_bvar_sampler(it called a function of the VAR code that is gone),utils.mcmc.initial_drawsand its helpersutils.mcmc.is_violationandutils.mcmc.sort_population; nothing called them.Fixed: local projections with missing states, a single horizon 0, gaps in the sample and shock labels.
A row whose state is unknown (a missing observation of the state variable, or a
delaythat reaches before the sample) was taken for the low state. It belongs to neither state and is left out;state.valuemust be a finite number or'median'andstate.delayan integer from 0 to the sample size minus one.With
horizons = 0,Sigmawas the identity, whichidentified_setrotated as if it were the covariance of the data. The horizon-1 regression is run for it whatever the horizons; a shock-mode estimate has no innovation covariance and givesNaNthere.The Newey-West standard errors (
beta_se) paired the rows that remain after a missing value is dropped, so rows on both sides of a gap counted as neighbors. The lags are counted in dates; a sample without gaps gives the same numbers.hac_lagsmust be a finite nonnegative integer.Restrictions named for different shocks were all applied to the one shock
identified_setidentifies; they are an error (lptools:identified_set:shockNames). See Local Projections.
Fixed: the user-defined VAR prior. The template made by
rise.engine.var.var_priors.user_definedlacked what the estimators read, soestim_var_priorrefused it, and its coefficients came in another order than those ofminnesota,niwandinw. It is evaluated like them (in each regime of a switching VAR, the densities summed),log_prior_func(params, Sigma, user_params)receives the coefficient matrix stacked by column in the order ofparams_orderand returns a real scalar.minnesota,niw,inwanduser_definedrefuselags = 0themselves. See Reduced-form VAR Modeling.Fixed: the parameter helpers written by the model-file converter ignored their .mat file. The
<name>_params.mhelper loaded the file given as its second argument and then assigned every baseline value over it; an empty second argument failed. The baseline values come first now and those of the file replace them.Fixed: the preprocessor of the model files: includes, conditions and comments.
An
@includein a branch of@if/@elseif/@elsethat is not taken is no longer read: its file need not exist.A relative
@includeis sought in the folder of the file that includes it first, then in the current folder and on the path: a model read through a path from another folder finds the files next to it. A file name may hold several dots (child.v1.rs).A condition that cannot be evaluated, or gives no true or false value, is an error (
rdico:preparse:ifCondition); it counted as false. A name that is not among therise_flagsis still false, now with a warning (rdico:preparse:undefinedFlag), and@if ~xis true for it (@if xand@if ~xwere both false).Blanks after the
@(@ if,@ else,@ end) are accepted; they stopped the preprocessor.A
//inside a quoted description (a URL) belongs to the description, as a%does; it cut the declaration.A block comment that is never closed is an error naming its line (
rdico:unclosedBlockComment); it removed the rest of the file. See Model file language.
Fixed: statements of the model language that were dropped or misread.
A
@parameterizationstatement without its;at the end of the block is an error (rdico:parameterization:unterminated); it was dropped. A comma inside a call (rho = max(0.4,0.5);) no longer separates the fields of a statement.The arguments of a carry-around function of
@functionsare split at the commas outside any parentheses, brackets or braces. A declaration that does not readname(args)=expression;, or the last one without its;, is an error; it was dropped.The option of a pseudo-function (
diff,movavg, …) follows the last comma outside any nested call:diff(max(x,2))is the first difference ofmax(x,2). A moving window of 0 is an error; it divided by zero.An
@epilogueentry that uses its own series (q = q{-1} + y;) is refused (RISE:epilogue:selfReference); it parsed, although its series cannot be computed.A name is a transition probability when the whole name reads
chain_tp_i_j:s_tp_1_2_gapis an ordinary name.Heterogeneous agents: a lead or a lag of any length inside
@Aggis an error (hank:agglead); only{t+1}and{t-1}were refused, and@Agg(c{t+2})was summed against today’s distribution. See Heterogeneous agents (HANK).
Fixed: the automatic-differentiation class
rise.engine.sym.adolmagainst MATLAB’s array semantics.x'conjugates;isemptyfollows the values;sumalong a dimension beyond the last leaves the values as they are;adolm.derivativesaccepts a function that returns a number.A constant operand takes the number of variables and the order of the differentiated one (its derivatives were dropped); two differentiated operands of different contexts are an error (
adolm:context).acoshbelow -1 had the derivative of the wrong sign. The scalar engine’sasinhno longer cancels to-Infat large negative arguments.
Fixed: the help of the time-series plots lists the options they have.
The help of
plot,hist,plotyyandboxplotsent the reader toparse_plot_args, and the help ofplotlisted the optionsvlineandhline. No plot reads them (a'hline'pair went to MATLAB’splotas an unknown property). The RISE options are those ofutils.plot.myplot:nticks,logyanddate_format, and a range of dates first. Lines are drawn after the plot withxlineandyline.The unused files
parse_plot_args,rise_dates.weeklyDatestr(it failed on every call) andfetch_fred_seriesare removed; nothing called them.
Fixed: time series keep the names of their variables, and their windows are checked.
Elementwise functions (
log,exp,abs,apply, …) and arithmetic with numbers (db+1,100*db) keep the names and the descriptions of the variables: they were dropped. Arithmetic between two series keeps the names when both series have the same ones; series with different names give unnamed variables, as before. See Indexing and assignment.splicekeeps the names and the descriptions of the series it joins, and spreads a one-column series over several columns on every page (a series with several pages failed).rollingrequires a window that is a positive integer no larger than the sample. A longer window failed on an undefined variable, as didexpandingon an empty series; an empty window gave an expanding one.spectrumcomputes the periodogram with the fast Fourier transform. The values agree with the previous ones to rounding; long samples no longer cost the square of their length.npdecompsays when a sample is too short: it needs 6 observations of each season and 13 in all. Shorter samples, such as less than 6 years of daily data, failed on an index inside the seasonal filter.fetch_fredreads an API key and series IDs given as strings. A string key was taken for one more series ID, and the request went out with the default key.
Fixed: dates written as text and read from text.
datestrandcharof dates take the format their help documented, a datetime display format applied to the last day of the period (the Saturday of a week):datestr(rq(2020,1),'yyyy-MM-dd')is'2020-03-31'. It failed with too many input arguments. See Time Series and Data Management.A day of the year below 1 is an error:
rd(2021,0)andrd('2021D0')were December 31, 2020.A yearly date given as text is read as a number.
ry('2000+21')is an error: the text was evaluated as MATLAB code and gave 2021.date2obscounts the periods on the calendar instead of building the range of dates (200 years of daily dates took seconds), and gives NaN for the dates of a vector that come before the start date (it gave 0).
Fixed: methods of the model classes: tables, reports, the mode curvature, estimation helpers and exports.
tablefailed on every call (its defaultlatex_filename, the string"", is not empty). Its columns are now the statistics requested, in the order given or the oneordersets, a statistic set to false is left out, and a dirichlet block has one row per parameter, without prior mean, standard deviation or quantiles.reportruns onestimation,estimation_statisticsandcode; the estimation table comes from the encoded priors (the distribution, its 90 percent interval, the modes and, for one model, the standard deviation at the mode).mode_curvaturekeeps its grid within the bounds and on both sides of a negative mode, and builds one around a mode at zero (the standard deviation at the mode on either side). The normalization argument never had an effect; it is accepted with a warning. The output on an array of models is accepted back as its cache.An estimation whose log file already existed stopped before it started; the old log is renamed with its time stamp, in seconds.
A starting point found on the last allowed trial, and a
posterior_samplecompleted on its last pass, are kept.On arrays of models,
hessian,pull_objective,log_posterior_kernelandhistorical_decomposition_switchreturn every output, one per model.fisherworks on its first call;parameters_to_filenames the function after the file, without its folder, and closes the file; numericestim_blocksmust be valid ranks.fold_solutionworks with some of the variables or of the states.is_forward_guidance_puzzlereturns the eigenvalue of one model as a number, and its error under regime switching says to set the second input to false.observables_decompositionaccepts a range of dates.The autocorrelations of
stoch_simulare correlations; they move by about 1/T.The queries of the default options on an empty model no longer fail.
The shock horizons are imposed on every solution of a model with several.
Fixed: the sample size of a DSGE-VAR counted the initial observations. The data moments of a
dsge_var_modelare made of the observations after the first \(p\), which the lags use, but the sample size \(T\) was the length of the whole data window. \(T\) is now the number of observations the moments are made of, in the data VAR, the posterior mode, the prior weight \(\lambda T\) and the marginal likelihood. Every DSGE-VAR result moves, the data moments by the factor \((T+p)/T\). See DSGE-VAR Modeling.Fixed: variance decompositions of variables with small variances, and of shocks whose variance could not be solved.
A total variance below 1e-12 was replaced by 1, so the shares of a variable measured in small units were not shares. Every positive variance now divides its own contributions, whatever the units; a variance that is not positive has zero shares, as before.
A shock whose variance failed to solve, with a finite result, gave shares above one. The decomposition at infinity is now zeros with the solver’s return code, as when the total variance cannot be solved.
Fixed: local projections returned responses they had not identified, and identified sets that broke their restrictions.
estimaterefuses a sample with no usable observation and a horizon with no more observations than regressors, or with collinear regressors (lptools:estimate:noObservations,lptools:estimate:notIdentified).identified_setimposes zero restrictions exactly, by drawing the impact direction among those that satisfy them: drawing on the whole sphere left no draw. Restrictions that only the zero direction satisfies are refused.With
normalize, the restrictions are checked on the normalized responses, so the set satisfies them. Without zero restrictions or a normalization the sets are unchanged.
See Local Projections.
Fixed: the posterior of restricted VAR coefficients under a Gaussian prior with a known covariance (
sample_posterior). With linear restrictions the prior was centered on the least-squares projection of its mean on the restrictions instead of being conditioned on them. The draws change when the prior mean violates the restrictions and the prior variances are unequal; otherwise they are unchanged.Fixed: two cases of integrating out the lags of a structural VAR (
estim_svar_integrate_lags).An equation whose lags, constant and deterministic coefficients are all fixed by restrictions stopped the estimation; nothing is integrated for it now.
Under regime switching, an evaluation whose EM had not converged, or whose bound fell, was accepted as converged. The objective now refuses it.
Fixed: VAR identification and priors.
When the sign-restriction search finds no rotation, the model is no longer rotated by the last candidate, which violates the restrictions, and marked identified: it stays unrotated with the return code 801.
inwrefuses at construction adfthat is not a finite real scalar above \(n-1\).The
log_priorcallback ofgenerate_niw_priornow gives the same density asevaluate_at_reduced_form.The Choleski identification refuses an ordering that repeats a variable.
Fixed: a simulation step with non-finite values no longer runs through the remaining periods. An exploding path (order 2 and above without pruning) or an OccBin step that failed (the step returns NaN) used to come back from
simulateas a database of NaN or infinite numbers, and fromirfas responses of NaN, with return code 0. The simulation now stops at that step with return code 704 (SIMUL_INVALID):simulatereturns no database and its diagnosis says where the path died, andirfreturns no responses. See Forecasting and simulation.A condition of endogenous priors or
mcfon impulse responses, autocorrelations, variance or historical decompositions that cannot be computed at a parameter point makes the point fail, as a model that does not solve does, instead of stopping the run with an error.state_var_listof a model solved at order 2 or more stopped with a dimension error when the list was not compact (the default), so no condition of endogenous priors ormcfcould be built on such a model. It returns the list.
Fixed: the posterior samplers could return draws that are not draws.
The slice sampler could return a point outside the slice when the search interval became very narrow. It keeps the current point then.
slice_samplerran random-walk Metropolis-Hastings; it runs the slice sampler.A chain stopped by
MaxFunEvalsorMaxTimereturnedNentries, the unmade ones as copies of the start. It returns the draws it made.A target that throws an error counted as a finite (very low) log density, which a chain could accept. It is a zero density now, like a NaN; the errors are counted and reported, and an error at the starting point stops the sampler.
The tempering sampler (
apt) accepted a NaN target value for sure. It never does now; chains without NaN are unchanged.Delayed acceptance could never reach a region where the surrogate fails. The step is a plain Metropolis-Hastings step there. See Posterior sampling.
Chained ordering constraints (x1<=x2<=x3) are all enforced, and
pull_objectiverefuses an ordering constraint between parameters whose priors or bounds differ: the samplers enforce it by swapping the two values, which suits exchangeable parameters only, e.g. one parameter across regimes. See Restrictions on parameters during estimation.rise_dramno longer piles up draws on the bounds: a proposal outside them is rejected.The unused copies
apt_sampler_legacyandmh_sampler_legacyare removed.
Fixed: with two chains or more, ``mcmc`` kept the worst of the chains’ best draws, and the mode of its ``statistics`` was the worst draw. Both are now at the largest log posterior, and
log_postandbest.fare the log posterior for every input form (the numeric form{draws,-log posterior}is turned around).Fixed: inefficiency factors, HPD intervals and Raftery-Lewis diagnostics. Inefficiency factors counted the lag-0 autocorrelation twice: independent draws gave about 3 instead of 1, and every factor was too high, by about 2 for chains that mix well. The highest posterior density interval could miss the shortest interval at the top of the draws. The Raftery-Lewis searches never ended on very short chains.
Fixed: the SWZ marginal data density was too low for posteriors with several modes or skewness, and the iterative bridge could run forever.
swznow draws and weighs with the same radial distribution: on a two-mode posterior with a known answer it was about 0.1 too low and is now within 0.03.bridgewithfix_point=falsestops atmdd_bridge_maxiterand reports whether it converged. See The properties.Fixed: several prior distributions.
tgiven by a mean and a standard deviation now has that standard deviation; it used it as its scale (1.73 times too wide at 3 degrees of freedom). Writet(hpp)for a location and a scale.folded_normalandtruncated_normal(normalwith bounds) given by a mean and a standard deviation now have them.half_normallives on \([a,\infty)\),gammawith a shift reports its mean and mode with the shift and fits its quantiles correctly, andkumaraswamyon \([c,d]\) integrates to one.Far tails of the normal family, and multivariate normal priors with very large or very small covariances, are computed accurately.
Fixed: linear restrictions reach ``fmincon`` in estimation, and a restriction that evaluates to NaN is penalized. The logistic regression of Monte Carlo filtering now fits the labels of its samples.
Fixed: three steady-state checks. A large negative residual of a one-equation steady state no longer passes as solved; growth-rate code for auxiliary equations is valid with many variables; and an authoritative steady-state file’s failure is no longer overridden by a vanishing residual.
Fixed: the storytelling reconstructions of switching models.
The reconstruction now starts from the smoothed state of the first date and replays the shocks from the second date on (it advanced the first date with its own shocks, one date off). Every output of
resim_bridgecovers the second to the last date of the sample, andrunreturns theirdates. See Storytelling.Viterbi returns the most likely regime path, built from the regime likelihoods of the observations (it multiplied the smoothed regime probabilities by the transitions again), and
log_probis the log posterior probability of that path.FFBS samples from the updated regime probabilities (it used the predicted ones, one date late).
Rao-Blackwell is now exact for linear switching models: each regime keeps its own path. A shock counterfactual on a Rao-Blackwell baseline is the same mixture with the shocks changed, so unchanged shocks change nothing.
var_decomp: the joint game’s residual is zero (it compared two other simulations); models with more than 32 shocks are decomposed correctly (up to 52); the ANOVA keeps the mean of a regime visited once, and its within-regime decomposition adds up.
Fixed: scenario tilts and plausibility.
A
stdorvarview is centered on themeanview of the same variable and horizon wherever that row sits in the list.A
covview is a covariance, with both means held, not the raw cross moment: tilts withcovviews give different weights. See Entropic tilting.The entropic solver no longer overflows on large moments, and reports (or refuses) weights that miss the moments.
rise.scenario.plausibilityrefuses a covariance that is not real, finite, symmetric and positive definite.
Fixed: density conditional forecasts and impulse responses.
Soft conditions are drawn given the hard ones they are correlated with. The Gibbs sampler handles mixed hard and soft conditions; a single soft condition works; a rejection sampler that runs out of attempts returns retcode 703 instead of a draw it rejected.
With several draws, each draw keeps its own shocks.
The impulse responses of a model with several solutions, averaged over several draws, are no longer divided again for every later solution.
Fixed: surrogates and HDMR.
rise.engine.surrogates.pcerefuses a design that does not identify its basis, and reports leave-one-out as undefined (Q2 NaN) with as many points as terms.rise.engine.surrogates.doesamples the prior restricted to the bounds instead of clipping it onto them; the basis ofpcefollows. Nothing changes where the bounds cut off less than 1e-10 of the prior.ei_maximizereturns its best point after a budget too small for its final surrogate.hdmrsamples a function with the current Sobol call, and fits a polynomial basis per input.
Changed: the OccBin paradigm guesses and verifies the whole binding pattern each period. It used to look for a binding spell only when today’s step violated a constraint, so a spell starting after today was not anticipated (for instance with a policy rule that reacts to last period’s inflation), and periods inside a spell were never re-checked. Each period it now guesses which constraints bind over the next
maxspellperiods, solves the path, and revises the guess until it reproduces itself, as in Guerrieri and Iacoviello’s algorithm. A binding period is released when the constrained variable’s shadow value satisfies the constraint; a release condition can be given as a third element,{'B<=m*Q*H','debt','LAMBDA<=0'}. New optionsmaxiterandlcp_fallback(when the guesses cycle, the same problem is solved as a linear complementarity problem by Lemke’s algorithm). Any number of constraints, as before.A step without a verified binding pattern is no longer replaced by the unconstrained step, which used to violate the constraint without a word. It fails with code 703 (the guesses do not settle) or 706 (the pattern still binds at the end of the horizon
maxspell), warns (occbin:paradigm:stepFailed, with the code), returns NaN, and keeps the first failed step in the payload’sfailurefield.simulateandirfthen stop with return code 704 (SIMUL_INVALID), without a database or responses.Values move wherever a spell is expected to start after the current date: on the two RISE examples (
examples/occbin,rng(1900)) the paths agree until date 101 of 1000 and date 270 of 300, where the bound is slack today but the unconstrained expected path crosses it one or two periods later.
Fixed: time series keep every observation at its date and every page.
Selecting dates that are not consecutive (
db(rq(2020,1)+[0,2]), a logical mask) gave the later observations the next dates: Q1 and Q3 came back as Q1 and Q2. The result now spans the first to the last selected date, with NaN at the dates left out.ts(dates,data)with one date per row places each row at its date, and the FRED readers (fetch_fred,fred_to_rise_ts) build their series this way: the dates a series skips, such as weekends, are NaN instead of compressing the series. See Indexing and assignment.convertto a higher frequency puts each observation at the period that holds the end of its own (the day or the week of a month end), from the calendar. It used fixed ratios (4 weeks a month, 7 days a week), started daily data one day late, and turned pages into variables. Conversions between annual, half-yearly, quarterly and monthly data, and from weekly to daily data, are unchanged.convertto a lower frequency: a day goes to its week (Sunday to Saturday), and a week to the month, quarter, half-year and year of its Saturday. Daily data were moved one day ahead, days were cut into blocks of 7 from January 1st, and weeks into blocks of 4 or 13.dropandgroupkeep every page.ts.collectworks when a later series has a higher frequency, and its descriptions follow the sorted names.
Fixed: the calendar of the dates.
1900 and 2100 are not leap years.
rd(2021,31)is January 31 (it was February 28). An impossible day such asrd(2021,2,31)is an error (it became March 3).Weekly dates follow one calendar: a week runs from Sunday to Saturday and is dated by its Saturday, week 1 is the week of January 1st, and the label is the year of the Saturday with the rank of the week.
rw(2021,1)is Saturday January 2, 2021, labeled2021W01(it printed2020W53). A week beyond the last one of the year is clamped to it, with a warning. See Weekly dates: rw.A date object holds one date: build ranges with the colon operator,
rd(2023,1,1):rd(2023,1,3);rd(2023,1,1:3)is an error.obs2daterefuses observation numbers that are not finite integers and takes vectors mixing positive and negative numbers.
Fixed: statistics and filters of time series.
moments: the autocorrelations are correlations between the observations and their lags over the common sample, in [-1,1]. They could leave that range on short samples; on long samples they move by the order of 1/T.allmean(the geometric mean),describe(percentiles of short samples and of variables with missing values),ts.dummyandts.step_dummy(dates given as text),pdecompandnpdecomp(several variables; several pages are refused).ma_filter: the default window is 1 for annual and undated data (it gave NaN everywhere), and a window longer than the sample is an error.spectrumrefuses missing values inside the sample (it removed them and treated the rest as equally spaced).chowlin: the standard errors and t ratios of the coefficients, and the bands of the disaggregated series, were scaled by the inverse residual variance. The maximum-likelihood mode withfmincon(estim_method=2) works.
Fixed: numerical derivatives of order three and above, and steps at large negative arguments.
With
solve_derivatives_type = 'numerical', orders 3 to 5 were swamped by rounding: onexpat 1, whose derivatives all equal e, they were off by 0.05, 2.5e3 and 2.5e8. The step of order k is noweps^(1/(k+2)); orders 1 and 2 keep theirs.The step now scales with the size of the argument whatever its sign: a large negative argument got the unit step (the derivative of the identity at -1e16 was NaN). Nothing changes at arguments above -1.
An order whose derivatives are all zero returns zeros instead of stopping with an error.
Fixed: the Lyapunov solvers could report a failed solve as a solution.
doublingat its iteration limit,directon a singular equation, the Krylov solvers (cgs,bicgstab,bicgstabl) at their iteration limit andfix_pointafter an overflow returned retcode 0, and the wrapper set the infinite entries of a failed solution to zero. Each failure now carries its code (doubling: 21, 22, 23;directandfix_point: 302; the Krylov solvers: 400 or -402), and a failed solve is not repaired. The switching covariance no longer takes an overflow for convergence (22), andbartels_stewartno longer gives a finite variance to a variable driven by one of several unit roots. Converged solves are unchanged, bit for bit.Fixed: perfect foresight accepted paths that do not solve the model.
The free terminal (
simul_terminal_condition = 'stationary') now returns retcode 201 unless the root mean square of the stacked residuals is at mostRootTolerance(1e-5 by default): a model without a real root came back with retcode 0. See Deterministic and quasi-deterministic solutions.The free terminal now solves each period in the regime the plan gives it; it used regime 1 throughout.
A bounded solve no longer accepts a root outside its bounds when the solver ignores them (
fsolve): retcode -402.simul_pf_boundsgiven as[lb,ub]for a variable no longer stops with “bounds must have 1 or 3 elements”.A conditional forecast with freed shocks on a switching model, with analytic derivatives, now uses the Jacobian of the equations it solves.
Fixed: draws from truncated normals in conditional forecasts with
forecast_conditional_sampling_algo'gibbs'or'ghk'. Draws far in a tail landed on a bound or were not finite.'ghk'returned the GHK sequence, an importance proposal, as if it were a draw; it is now the proposal of a Metropolis-Hastings chain that targets the truncated normal and runs at least 50 steps before the first draw it keeps. The default'rejection'is unchanged.Fixed: first-order solvers and numerical kernels. AIM no longer stops on a nearly rank-deficient lead block; the
fwzsolver’s initial guess takes the expectation over the next regime; the Maih-Waggoner refinement of themwperturbation solves the coupled system exactly;dsge_schurwithallSolsexamines each set of leading roots once (it enumerated every ordering, 12! for six variables) and stops with a diagnostic beyond 1e5 sets; the running covariance behind posterior statistics no longer loses a small variance under a large mean; a Kronecker product with a one-row matrix no longer scrambles its entries;rise.engine.solvers.root_solveapplies the chain rule to an analytic Jacobian of bounded variables.Fixed: optimizers.
rise_cma_esmeasures its evolution path against the expected norm in its dimension (the rank-one update stopped from a few parameters on; CMA-ES runs change).wgmhmaxlikfinishes its runs (it started from a NaN covariance and stopped with an error in its last round), and stops onMaxIter,MaxFunEvalsandMaxTime, returning the best point it evaluated (see Posterior maximization).wnewratno longer treats a failed evaluation as a success. The initial population ofbeeno longer holds NaN candidates.Fixed: the browser cockpit (``rise.cockpit``) checks what it shows.
Entropic Tilting: the handle you drag is the mean (drawn as a dashed line), which is what exponential tilting matches; the page no longer calls it the median. A drag the ensemble cannot support leaves the last accepted distribution exactly as it was. Paths whose tilted weight underflows to zero no longer distort the fan bands.
Policy Rule Cockpit, Credibility / Attention, Commitment vs Discretion: an interpolated solution between grid nodes is checked for explosive dynamics (mean-square, for the commitment process) and replaced by the nearest solved node if it fails; whenever the responses come from a point other than the sliders’ (snapped, clamped or replaced), the page says which. The policy cockpit’s determinacy shading now appears on two-dimensional grids, and its baseline impulse response follows the selected shock.
Regime Dial: the ergodic distribution is solved exactly and checked (200 power iterations were far off for persistent chains), and the page states that the policy functions are those solved under the baked transition probabilities.
Commitment vs Discretion: refuses bundles with other than one or two regimes and grids outside [0, 1], names truncated end points by their values, and ignores a scripted
lambdaoutside the grid.Rewriting History: dates follow the data’s frequency (they were read as quarterly); labels are shown as text.
Reset cancels pending animations and refinements; canceled touch gestures stop editing.
bake_ensemblesimulates a Markov-switching model with its regimes (it used regime 1 only) and refuses solutions above first order.bake_policy_grid’s interpolation check fails when exact solves fail or interpolated dynamics explode, andnvalidate=0is reported as disabled, not passed; a one-knot grid dimension works.The bakes draw from private random streams and leave the global generator alone. The shocks are unchanged; the regime draws of a
bake_policy_gridbundle withexport_all_regimeschange once (they no longer depend on the validation).rise.cockpit.launch’s Node fallback server serves files on Windows (it refused all of them) and only inside its root.JavaScript tests:
cd cockpit/webthennode --test.
Fixed: the ergodic variance decomposition of a regime-switching model is that of the switching system. With
vardec_ergodic=trueit was the decomposition of a constant-parameter model built from the probability-weighted average of the regimes’ matrices, which is not the variance of the switching system. White noisey = a(s)*e1 + e2with a = 1 and 3 in two equally likely regimes has the shares 5/6 and 1/6; the average model gave 4/5 and 1/5. The second moments are now those of the regime process itself, shock by shock, at every horizon. A constant-parameter model and the regime-specific decomposition are unchanged. Infinite-horizon shares are NaN for nonstationary variables.Fixed: a shock that may not enter the solution left its higher-order terms in. At order two and above, the masks of the shock horizons, of
simul_anticipate_zeroand of the constraint enforcers removed only the products in which every factor was such a shock. Every product with one of them as a factor is removed now, so second-order solutions and simulations with those settings change. First-order results do not.Fixed: perfect foresight, five cases.
An announcement made on the plan’s first date, the last date of history, was lost. It is now known from the first simulated date (see Simulation plans).
Two endogenous targets announced at two leads failed.
Transform-expressed conditions that do not settle are a failure now (retcode 709), not a success with a warning.
The fallback chain of
simul_stack_solve_algois accepted and run in order, in the ordinary and the conditional solve.The conditional solve routes every accepted solver name.
A stalled continuation, there or in
diagnose, is reported as localizing the failure, not as proof that no solution exists.Fixed: ``solve`` solved an unchanged model again, every time. It asked for the structural matrices, for which the model is always solved afresh. They are asked for only when you ask for them (a third output), so
simulate,irf,forecastand the decompositions keep a solution that is still valid. Changingsolve_automatic_differentiatornow marks the solution stale.Fixed: entry points of the model classes.
estim_start_from_modetook the text'false'for true; it now takestrue,falseand empty only.A state-specific shock horizon failed for a chain name with an underscore.
A NaN discount factor in a loss is refused.
plan2databaseaccepts integer dates in a plan.Removing the last prior clears it, with the restrictions it set.
Zero, negative or infinite data of a log variable are an error (
rise:data:nonpositiveLog); NaN still marks a missing value.sample_posteriorkeeps the correlations of a Gaussian VAR prior.The function from
identificationreturns retcode 801 and no matrix when no rotation satisfies the restrictions.check_derivativesreturns retcode 33 when the exact derivative types disagree, and the discrepancies as a second output.max_discrepancyreturns NaN for solutions with NaN or Inf.simulate,abcdandcalculate_losswork on model arrays;draw_parameter(m,'mode'),estim_blocks,predictive_analysiswith a matrix of draws andregime_partition_analysiswork.
Fixed: reports and time-series plots.
The web model report (
webreport) showed empty IRF and IRF-data tabs, and a response of tiny scale made it ask for millions of axis ticks. Both tabs now build, and the ticks stay few.The “Download data” button of a chart in
rise.report.tohtmlgave the thinned and rounded hover points. It now gives every date and value of the chart in full precision, a missing value as an empty field, one column per series and two per band. See Report documents.rnotes.publish, behindrise.publishandrise.report.topdf: margins with a unit ("2cm") are accepted;NumberingDepthis applied (the default, 3, also numbers the subsubsections of the report and book classes); an engine path with spaces runs; a compiler that ends without making the PDF is an error, where a PDF left from an earlier run used to pass for the new one; publishing leaves your open files open. A report with figures delivers them in<name>_figuresbeside its LaTeX source, which points there and so still compiles (withKeepTempFiles, it points at the kept working folder). See Publishing a script.rnotesnumbering: figure and long-table labels are written; a figure or table is counted, and can carry a label, only when it is numbered and has a caption, as LaTeX numbers it, and a label on one without is an error;Numbered=falsegives an unnumbered caption and an unnumbered equation environment; a label given with an equation environment goes inside it; automatic section labels carry the chapter (sec:2.1), so a second chapter no longer throws.rnotestext: a backslash is escaped as\textbackslash{}with no stray braces; model code without coloring escapes%and#;latexSafekeeps\thetawhole; a table cell that is one formula ($\beta$) is set as mathematics; the parameter table’s columns sit under matching headers;create_figureapplies a style shared by several lines.texreportequations: chained powers read as MATLAB evaluates them (2^3^2is(2^3)^2), and a symbol with a subscript takes its date inside it (\rho_{k,t}).Plots of time series:
nticksanddate_formatreach the axis; daily tick labels show the month;plotyy’s third output is the right-hand series; one date with several pages plots its pages; the data cursor names the date under the cursor.save_figureprints from an invisible copy, as its help says: your figure keeps its size, paper size and fonts, andtight=falseis honored.
Fixed: the filters’ initial covariance when its Lyapunov equation is not solved, and filters and smoothers at their edges.
The default initialization (
kf_init_variance=[]) now checks the solution of the Lyapunov equation, by the solver’s status and the equation’s residual. States with a unit root (withoutsolve_bgpevery state counts as stationary) keeplyapunov_diffuse_factor; stable states whose equation is not solved fail the evaluation of a constant-parameter model (retcode 311), and keeplyapunov_diffuse_factor, with a warning, in a switching model. Before, the solution was used whatever the solver reported. The likelihood of a model with a unit root under the default initialization can change. See Diffuse initialization.gpbnnow filters a period with every observation missing (it stopped); the smoothed measurement errors now subtract the intercept of the measurement equation.Multi-step forecasts (
kf_nsteps) now take the deterministic exogenous variables and the intercept of the date of each step, and a step whose forecast fails is NaN, with the steps after it (it was zero).The divided-difference filter now stores the initial covariance (it stored its square root) and perturbs anticipated shocks as the shock array.
immntakes an engine given by name or as a function handle;crskfcwithhkkm_smoother=falsehandles a last period that observes fewer variables;myKnownRegimesFilterstores the transitions of its path.The closed-form (direct) likelihood now honors
kf_presample, counted from the first date of the data as on the filter route.historical_decomposition_switch, andresimulateon several models, no longer stop on the model object’s read-only state space.The two-branch normalization of
immnear a kink no longer overflows in the upper tail; a singularZ*Rin the inversion filter is now retcode 305, and a NaN or infinite indirect-inference or optimal-simple-rule criterion retcode 312 (both passed as successes).
Fixed: the closed-form (direct) likelihood and the fast estimation kernel on several kinds of models.
A fully observed model solved above the first order now goes to the filter chain; the direct route handles first-order solutions only.
The direct route now includes the drift of a balanced-growth solution in the mean (with
simul_with_growth, as the filter does), and gives zero density (retcode 312) to data that violate an equation no shock enters. Before, a random walk with drift read its drift as a shock, and data violating an identity got the likelihood of data satisfying it.The shocks of the direct route’s filtration are now the standardized shocks, by name, weighted by the updated or the smoothed regime probabilities. They were the innovations, in the units of the variables.
The fast kernel (
estim_fast_kernel) now honors the dynamic parameter links (dynamically_bind) and the balanced-growth drift, and refuses a solve paradigm. Its values differed from the generic objective’s in these cases. See Fast estimation kernel.A VAR-prior template returning NaN or +Inf is now a failure (retcode 309), and so is a non-finite posterior kernel (306). Both passed as successes.
Fixed: the smoothers of the sigma-point and inversion filters.
The divided-difference smoother (the default above the first order) left the transition out of its gain. With several regimes, the cubature, unscented and divided-difference smoothers corrected each regime with the same regime of the next period. They now pair the regimes (Kim’s smoother): on a linear model they give the Kalman smoother, and
imm’s with several regimes. See Filtering.A regime the chain cannot reach no longer stops these filters (retcode 304 or 305): it weighs nothing, as in
imm.The switching inversion filter now mixes the densities in logs (a remote residual gave a -Inf likelihood with success status) and smooths its regime probabilities (it returned the updated ones).
Fixed: the numerics of the Kalman and Hamilton filters.
The log determinant of the forecast-error covariance, and the test that it is positive definite, now come from its Cholesky factor, in every filter and in the fast kernel. Shocks of standard deviation 1e-100 failed, large covariances gave an infinite likelihood, and a covariance with two negative eigenvalues was accepted. Elsewhere log-likelihoods move by about 1e-15 in relative terms.
The Hamilton update now shifts by the largest log mass: a history of zero probability with a large density gave NaN probabilities in
kim_nelsonandgpbn.Exact diffuse initialization now handles correlated measurement errors (the initialization fell back to the default one), gives
immthe right measurement error of every observed variable (it took the first one’s), and refuses an observation without diffuse or finite variance (retcode 305).kim_nelsonkeeps the observations a partly diffuse period’s diffuse variance does not reach.myConstantParamFilterandmyKnownRegimesFilterstop with an error while a diffuse direction reaches the observables. See Diffuse initialization.The smoothed regime probabilities of
kim_nelsonwere NaN when a regime could not be reached, and took the wrong period’s transition under time-varying transition probabilities.The ergodic distribution keeps rare regimes: it set every probability below 1e-9 to zero, and lost their contribution to the moments.
Failures that passed as success now stop the filter: a failed evaluation of the transition matrix in
imm, a failed pair of regimes inkim_nelson. The filter of a model with several solutions no longer recurses without end, and a grouped shock decomposition of a switching model adds up.Filters chosen by name: with a frozen gain (
kf_riccati_tol),filter_cc,crskfcand the constrained cell filter mixed up the predicted and updated covariances; time-varying observation matrices work infilter_ctand the missing-observations filter; the simulation smoother keeps the constants and small correlations.
Fixed: wrong derivatives in the symbolic engine. The derivatives of
cot,acosandatanhwere wrong, and so were those ofnormcdf(u,mu,s)andnorminv(p,mu,s)with respect to the mean and the scale; they are now exact (the standard casenormcdf(x),norminv(p)is unchanged).betapdfnow applies the chain rule of its first argument, andbetainvworks. A shape parameter ofbetapdf,betacdforbetainvthat depends on a variable of differentiation is refused (rsymbdiff:betaShapeDerivative): those derivatives have no closed form. Constants in the generated derivatives are now exact (1e-16*xhad the derivative 0), so derivatives may move in their last digits.Fixed: automatic differentiation.
sqrt(x)atx=0now has an infinite derivative, as in the symbolic engine (it was 0);tanhandcothno longer give NaN derivatives at large arguments; and high orders no longer need memory for every permutation of each derivative.Fixed: the parser in Markov-switching VARs, Dirichlet priors, hybrid expectations and heterogeneous-agent models.
controlled_parametersaccepts a parameter named in full (b1_y_y,a0_y_pi,c_y). A lag that is not a whole number and a shorthand that matches no parameter are errors. The VAR generators accept column lists. See Reduced-form VAR Modeling.dirichlet_k, sd, name, mean, ...;in@parameterizationcalibrates each parameter at its mean (the first one got the standard deviation).A model declaring
hbe_wandhbe_lambda(hybrid expectations) parses again.Heterogeneous agents: an unknown
evolution=kind or axis option, andevolution=withpolicy=, are errors; so is a lead of an individual variable other than{t+1}, which used to be expanded as an expectation at a fixed cell. See Heterogeneous agents (HANK).
Fixed: ``@robustness`` in games. The adversary is built from the policymaker that declares
@robustness(it took the first objective, discount and order of the block), the entropy term goes into that policymaker’s objective, and without@discountboth get 0.99.@robustnessinside@stateblocks is refused. See Optimal policy.Fixed: the model-file converter. Correlated shocks keep their variances (the correlation used to inflate the variance of the second shock, by 4/3 at 0.5), and three or more correlated shocks get the declared correlations. Two estimated-parameter declarations on one line, a named initial value, a predetermined variable written
k (-1), and a file that includes itself are handled (the last is an error). Converted models with correlated shocks change accordingly.Fixed: a user function given as
{'*name',args...}. The star that asks for a preliminary call with the model (a user filter inkf_user_algo) now works in the cell form as in'*name'.Fixed: routines written to disk. Two models with different options no longer share the package of their routines, and anonymous functions that capture variables keep them when routines are vectorized or written to disk.
Fixed: ``mcf`` refuses an unknown sampling procedure when it is built. The check of the procedure name in the constructor of
rise.engine.mcf.mcfnever fired. An unknown name such as'latin_hypercubes'was accepted, and failed only later, when the draws were made, or never, when the draws were supplied. It is now refused at construction withRISE:MCFUnknownSamplingProcedure, the error of the draws. Known names ('uniform','latin_hypercube','sobol','halton') and user-defined procedures are unchanged.Fixed: building priors used, and moved, the global random stream. Fitting the hyperparameters of a prior (given by quantiles, or by a mean and a standard deviation without a closed form) drew starting points from the global random stream. The priors and the bounds of the parameters could then differ, slightly, after different random states, and building a model advanced your stream. The starting points now come from a stream of their own: the same model gives the same priors and bounds whatever the random state, and leaves it as it was. Draws that follow
rng(seed)and the building of a model differ from before for that reason.Fixed: three edge cases of the switching filters and the closed-form likelihood.
immno longer stops (retcode 305) when the transition matrix holds exact zeros and ones. A regime with zero predicted probability contributes nothing, as in the limit.The unscented and cubature switching filters now give the exact likelihood of a linear model, to rounding. They were 1.8e-6 off: the sigma points put a variance of 1.5e-8 on the states the data pin down. Nothing changes where every eigenvalue of the covariance is inside
[1.5e-8, 6.7e7]. See Filtering.The closed-form likelihood of a fully observed model now uses a starting regime distribution given in
kf_user_init. Equal starting probabilities (kf_ergodic = false) and a given distribution sit where the filter puts its start, so the two routes agree under any start. Withkf_ergodic = falseits log-likelihood moves by about 0.06 on the test models; the default ergodic start is unchanged. See Where the regime probabilities start.
New: the tau of a ``gammatau`` prior goes after a colon in its name. For instance
{start, mean, sd, 'gammatau:2'}or{start, lq, uq, 'gammatau:2(0.9)'}, andgammatau:2in a model file. tau is required there, and anything but 0 (negative for the inverse gamma cases,'gammatau:-0.5'and'gammatau:-1'). Before, the prior syntax took the first number as tau: the mean and sd form stopped with an error, and the quantile form built another distribution. See Estimation.Fixed: the Laplace estimate of the marginal data density from MCMC draws. It took the best draw as the posterior mode. Where that draw is not at the mode, the curvature there can be indefinite, and the estimate came out NaN. It now polishes the best draw to the mode, within the parameter bounds, and computes the Hessian there, as estimation does. If the curvature at the mode is still not definite, it stops with an error (
rise:mdd:laplaceNotDefinite) instead of returning NaN. On a TANK posterior the estimate went from NaN to 6592.559, against 6592.558 at the mode found by estimation.Fixed: an observed exogenous variable has one date in the filters and in ``simulate``. Its value at date t enters the equations of date t and drives the move out of t, into t+1.
The default filter,
imm, gave the prediction of t+1 the value at t of an observed exogenous that enters an equation. It now uses the value at t+1, as the other filters and the closed-form likelihood do. On a test model its log-likelihood goes from -87.82 to -92.50, the closed-form value. Models whose observed exogenous variables enter only the transition probabilities do not change.simulateandirfdrew the move into t with an observed driver of the transition probabilities at its value in t. They now use its value in t-1, the period the move leaves. A simulation with such a driver draws other regimes from the same random numbers.
Data simulated with a driver and filtered back now meet the driver on the same dates. See the date of a driver.
Changed: the regime probabilities follow one rule on both likelihood routes. The start uses no data: the ergodic distribution of the transition matrix at the steady state, or equal probabilities with
kf_ergodic = false. The move from one date to the next uses the information of the earlier date, so the first move into the sample uses nothing from the period it explains.The closed-form likelihood of a fully observed model started from the ergodic distribution of the matrix evaluated on the data of its first likelihood period, and ignored
kf_ergodic. It now starts after the first observations it needs to read the state, and evaluates its first move at the last of them. With time-varying probabilities its log-likelihood changes (by +0.24 and +0.08 on the models of the new test). With constant probabilities it is unchanged to rounding, except withkf_ergodic = false, which it now honors.The switching filters evaluated the move from the start into the first period with an observed driver at its first observation. They now take the driver at zero, its steady state, as the start does. This changes the predicted regime probabilities of the first period, and the log-likelihood only when the first period’s density differs across regimes.
estim_force_filter = truenow runs the filter on a fully observed model with time-varying probabilities;filtertook the closed-form route anyway.A missing value of an observed driver gave the penalty likelihood without a word. It is now the error
rise:filter:missingTransitionDriver, on both routes.
The two routes give the same numbers when the filter conditions on the same information: see Where the regime probabilities start.
Fixed: several user-defined priors all took the density of the last one. With two or more priors given by their own pdf (
{start, LB, UB, function_handle}), the log prior of the estimation evaluated every one of them with the pdf of the last (plots and prior draws used each one’s own). Each now keeps its own pdf. The same held for severalgammataupriors with differenttau.Fixed: several parameters sharing a prior distribution, one of them outside its support. With the pareto, half normal, inverse Gaussian, inverse gamma, Levy, lognormal, triangular, raised cosine, beta prime or generalized gamma (
gammatau) priors, several parameters (or endogenous priors) sharing the distribution stopped with an error when one of them was outside its support, and for some of these always. That one now gets a log density of-infand the others their density, unchanged. Gamma and Weibull densities evaluated on a grid that runs outside the support no longer stop with an error either.Fixed: the exponential prior below its lower bound, and the logistic prior far to the right. The exponential prior’s cdf is now 0 below its lower bound (it was negative), its inverse cdf is NaN for a probability outside [0,1] (it was below the bound or complex), and several parameters or endogenous priors sharing an exponential prior no longer stop with an error when one of them is below its bound: that one gets a log density of
-inf. The logistic prior’s log density is now finite more than about 710 scale lengths to the right of its location, where it came out-inf; elsewhere it is unchanged to rounding.Fixed: inverse Gaussian priors with mean/sd above about 18.8. Their cdf overflowed and came out NaN, and setting up such a prior for a parameter stopped with an error. The cdf is now computed without overflow, and the inverse cdf, which sets the bounds of the parameter, no longer starts from a random point: on every inverse Gaussian prior it used to depend on, and advance, the global random stream. A prior given by its quantiles is no longer refused when its mean/sd exceeds 18.8, and the fit of a prior’s hyperparameters from its quantiles no longer stops at the first optimizer that fails with an error: it goes on to the other optimizers and starting points.
Changed: the solves at order 2 and above use a tighter tolerance by default. Left at its default,
solve_linsyst_solveris used withTolFun1e-12 for the second- and higher-order coefficients instead ofsqrt(eps). In heterogeneous-agent models the error of these solves is about a million times the tolerance: on the HANK course’shank1the risk (\(\sigma^2\)) terms were 2.4 percent off on a 6 x 2 grid and 6.6 percent on 9 x 2; they are now within 1e-3, at 1.7 to 2.1 times the iterations. First-order solutions are unchanged, and a tolerance you set yourself is used as given. See Higher-order perturbation.Fixed: ``smooth_kinks`` kept a risk term at first order where a kink is tied at the steady state. The smoothed kink is now centered on the kink at the steady state, so the first-order solution is certainty equivalent: the sigma term (1e-6 on small models, 5.6e-6 on
hank1) is gone, and the second order still sees the smoothing. Models with no kink tied at the steady state solve as before, bit for bit. In the filter, the first period of a tied model now goes through the constrained step like the others.Documented: perturbation M is not valid when the steady state or the growth rate switches. For the pair of regimes (i,j),
'm'(the default) takes next period’s variables on regime j’s steady state or path and the current ones on regime i’s, where regime i’s equations do not hold. On a balanced growth path whose growth rate switches, its solution loses the exact unit root of the path. On a test model, moving the state one period along the path should move every variable by its growth. Under'm'the error is 3.6e-6 and 1.4e-6 in the two regimes; under'mw'and self-consistent M (then selected by the retired M cell syntax) it is at most 2e-13. Solve such models with'mw'or self-consistent M (then selected by the retired M cell syntax).'m'remains the default and is valid when every regime has the same steady state and growth rates. See When the steady state or the growth rate switches, change the type.Changed: ``kf_kink_density`` is on by default. Near the kinks of occasionally binding constraints the filter’s update is the one over the branches around them, with the exact predictive density of the data. A period where the one-step update cycled with no consistent branch used to stop the filter with retcode 314; it now filters. The cost is 1.4 to 2 times the one-step update on a small model with a lower bound, up to 9 times when an unobserved rate stays near its floor.
kf_kink_density = falserestores the one-step update.Changed: ``apt`` no longer under-disperses its draws. Its proposal means and covariances are now running averages of all the draws (
cov_exp = 1). The scales, proposals and temperatures stop adapting afteradapt_untiliterations (default 10000); after that the chain is an exact, non-adaptive parallel-tempering MCMC.Before, the proposals followed the chain:
standard deviations were 23% too small on a 26-parameter Gaussian and 35% too small on BBL’s RANK posterior;
the RANK log MDD came out at 6585.4 instead of 6590.6.
With the change, the RANK posterior’s standard deviations are 0.986 of the authors’ and the MDD is 6590.9 (MHM) and 6590.0 (bridge).
A run continued from a previous result now counts the adaptation clock from the chain’s first run, so a run split in segments gives the same draws as one run.
cov_exp = 0.6withadapt_until = infgives the former behavior. See the posterior simulation page.New: structural VARs with the lags integrated out, under regime switching.
estim_svar_integrate_lagswith the structural lag priors ('bh','sims_zha') used to refuse a switching model. It now finds the posterior mode by EM: the regime probabilities given the parameters, then the lags and variances of each regime in closed form. With one regime it gives the closed form exactly. When only the lags and constants switch, the regimes can be weakly identified; see the limits on the structural VAR page.Fixed: a regime whose lags have a unit root and no drift solves. It used to stop with retcode 21; its steady state is now the minimum-norm one.
New: ``kf_constrained_smoother`` (off by default), smoothed series that hold occasionally binding constraints. With one regime and the option on, the smoothed series are the most likely path of the constrained model given the data: the bounds and kinks hold, the exactly observed data are reproduced, and
simulategives the path back. Off, the series are the published linear smoother’s. Historical timing was 1223 s against 99 s on a HANK with 433 enforcer pages; see the Filtering page.Changed: the reference of a growing variable is its own value grown at its own growth.
@cognitive_discountshrinksV{t+1}toward a reference, and a writtenstst(V{t+1})is that reference. For a nonstationary variable it is nowVgrown at its steady-state growth (V + g_V;Vtimes its gross growth factor for a log variable), for a stationary variable its steady state. In a model declared nonstationary (solve_bgptrue), a variable whose steady-state growth is not zero in some regime gets its previous value plus its growth; a zero-growth variable whose level the steady-state system does not pin down (a unit root without drift) gets its previous value; any other variable gets its steady state. One parametercdlambda_<V>, 1 or 0, is set after every steady-state solve; the unit-root check is computed once, at the first solve, and reused. RISE no longer searches the equations for trend carriers, and the models it used to refuse as ambiguous now solve. The solution is the same at every point of the balanced growth path. Unchanged, bit for bit: stationary models,mcd_V = 1, and the price level (p + pis + m*(pi{+1} - pis)). Changed: consumption on a random-walk technology is shrunk toward(1+mu)*C, no longer toward the realized technology, so expected consumption growth is discounted rather than the gapC/A: in a New Keynesian model with iid shocks,log(C/A)responds to a policy shock by-sig_r/(m_C+phi*kappa)instead of-sig_r/(1+phi*kappa). To keep the former model, write it detrended and tagc = C/A. See Cognitive discounting and Steady states of growing variables in the dynamic equations.Removed: the option ``br_b4_opt_policy``. Expectations, rational or bounded, are taken on the formed system, the planner’s first-order conditions included. In optimal-policy models, a written
stst(V{t+1})of a growing variable now gets the moving reference too.Fixed: ``simulate`` and ``irf`` with an observed driver of the transition probabilities and occasionally-binding constraints. They stopped with an index error; the transition probabilities now move with the same values of the driver as the equations.
Fixed: the Newton solvers of the perfect-foresight solver kept a step the line search had rejected. When backtracking ran out without a sufficient decrease,
gmres_newtonandblocktridiag_newtonwent on from the last trial. They now stop with a line-search failure and keep the last accepted iterate.LineSearch='none'is unchanged.Faster: derivatives of functions of many arguments. The symbolic chain rule no longer builds a partial derivative for an argument whose derivative is zero. The derivatives are unchanged.
Fixed: a measurement error that switches with the regime is drawn in the regime of its period.
simulateused the previous period’s regime, one period late. Measurement errors that do not switch are unchanged.Changed: complex data are refused.
simulatereturns an observable with a measurement error as model value + 1i*error; handed tofilterorestimateas data, it used to make the filter fail far from the cause. Complex series now stop withrise:data:complex, which names them and says to passreal(x)+imag(x).Fixed: ``kf_user_algo=’imm’`` with an observed driver of the transition probabilities. Asking for
immby name was refused, although it is the default filter and handles such a driver.Fixed: an observed driver of the transition probabilities in a model with occasionally-binding constraints. Filtering such a model stopped with an index error: the constraint engine evaluated the transition matrix without the driver’s value. It now receives it, so time-varying transition probabilities driven by data and constraints such as the zero lower bound can be filtered and estimated together.
Fixed: the first period of the constrained filter.
immupdated through the constrained step from inputs set at the end of each period for the next, and nothing set them for the first observed period: its likelihood ignored the constraints. They are now set from the initial distribution whenever it is the stationary one, so the first period is treated like any other. Models whose first period is far from their constraints are unchanged bit for bit; an exact diffuse start, or an initial state given as the first prediction, keep today’s update.New: ``kf_kink_density``, the exact predictive density near the kinks of occasionally-binding constraints (off by default). Where the posterior of a period straddles a kink, the filter’s update settled on one branch of the constraints and missed the others; where its mode lay on the kink (a rate observed with an error near its floor, or missing near it), it cycled between the branches and the filter failed with retcode 314. With
kf_kink_density = truethe update near kinks mixes the branches around them, each weighted by the probability of its region: the exact density of the period’s data for a Gaussian prior, with any number of kinks near at once. On nk3_zlb with the rate missing at its floor or never observed, 15 and 46 of 200 samples fail with 314 without the option, none with it. It applies to one-period constrained steps and does not change failures of the constraint engine itself. See Near the kinks: kf_kink_density and the tutorialWorkingWithAModel/filtering_near_kinks.Fixed: exact diffuse smoothing retains the finite and diffuse backward accumulators. A single-regime local linear trend is checked against the classical exact diffuse smoother, including small innovation scales. The published switching recursion uses the same finite/diffuse information structure. Test:
models/dsge/filtering/diffuse/testDiffuseInit.m(singleRegimeSmootherIsExact).Changed: the steady state of the lead of a growing variable moves with the trend. In a model with a balanced growth path,
stst(V{+1})written in a dynamic equation was the value of the path at the expansion date, a constant: a hand-written anchor such asstst(C{+1})+mcd*(C{+1}-stst(C{+1}))then had no balanced growth path formcd < 1and the solution drifted without shocks. It is now the moving reference of@cognitive_discount(the variable’s own value grown at its own growth, see the entry above). For the log price level withp = p{-1} + pi,stst(p{+1})+m*(p{+1}-stst(p{+1}))isp + pis + m*(pi{+1} - pis). Models without trends, stationary variables andstst()of current values or lags are unchanged. See Steady states of growing variables in the dynamic equations.Fixed: ``’bm’`` on the planner-discount knife-edge. The solve failed (retcode 30) because the anchor condition has a continuum there; the solution is now the limit of those at nearby planner discounts. See Optimal policy.
Fixed: the smoothed shocks of the first period. They were exactly zero: the filter gave the shocks of the first period an initial covariance independent of the first prediction of the state, which they move. They are now the exact ones. On fs2000, RISE’s smoothed shocks match the reference ones in every period; they differed by 6e-4 in the first. The likelihood and the filtered and smoothed variables do not change.
Changed: the known-regimes filter (``myKnownRegimesFilter``) takes the regime of each period, and refuses what it cannot filter. In
filter(m, kf_user_algo = {@myKnownRegimesFilter, regs}),regs(t)is the regime of period t: the regime of the solution that produces period t, whose standard deviations the shocks of period t have. The filter used to apply each regime one period late; a path shifted to compensate must now be passed as is. The constant of each period is that of its regime (models whose regimes have different steady states were filtered with the constants of the wrong regimes). The initial state and covariance are those of the regime of the first period instead of an ergodic average;kf_user_initoverrides them. Constraints (unlesssimul_disable_constraints), news shocks,solve_order > 1and deterministic exogenous variables raise errors with identifiersrise:knownRegimes:*. With shock standard deviations written as switching parameters the filter is the heteroskedastic filter: see Known regime paths and heteroskedastic shocks.Changed: the auxiliary equations of an ``@outside_optimization`` block are exempt with it. The equation RISE adds for a lead or lag beyond one inside a block (
LEAD_1_B{t} = B{t+1}for aB{t+2}) was a constraint of every player, with a multiplier zero along the solution, and could raise the feedback warning. It now belongs to the block, in both forms: the exempt players do not include it in their system and take its variable as given (no derivative with respect to it). The solutions are unchanged; the multipliers on those rows are gone. An auxiliary that an equation outside the block shares stays a constraint. See Optimal policy.Changed: one smoother for the regime-switching filters, in which linear identities written in the model hold.
imm,imm_o,gpbn(every history length),immnandcrskfcnow smooth pairs of linked regime histories against each pair’s own prediction, with Kim’s posterior weights. An identity that is linear in the model’s variables and that the model states in every regime (a level and its first difference) now holds in the smoothed path to rounding; before, it was off by up to about 1e-2. A nonlinear identity is not preserved by the averaging over regimes (the variables declaredlogare averaged in levels). Likelihoods and filtered series are unchanged; all smoothed output of switching models changes.crskfc’s default smoother is now this one. See Filtering.Fixed: on the planner-discount knife-edge, the commitment solution of a regime-switching model is the limit too, rest points included. The continuation to the limit of the planner’s discount started only when the solver reported unit-circle eigenvalues, which the switching solvers never do. It now finds the unit roots in each regime’s solved transition of the state variables. Under self-consistent M (then selected by the retired M cell syntax) and
'bm'the expansion points are extrapolated with the decision rules. On a switching tracker model the reporting variable’s multiplier is now zero, and the solution equals the model without it. Constant-parameter models, and switching models off the knife-edge, are unchanged. See Optimal policy.New: ``@outside_optimization(home){B_F}``, a block that exempts only the players it names. The parentheses, refused until now, name the players that are not constrained by the block’s equations and take the variables in the braces as given; the other players keep the equations as constraints. The exempt player has no multiplier on those rows and no first-order condition with respect to the variables it takes as given: the game is the one written with the equations in
@modeland the variables left out of the exempt player’s objective, under commitment, discretion and loose commitment, in Nash and leader-follower games and in@stategames. A block naming every player is the every-player form@outside_optimization{W}. The linear-quadratic solvers still refuse both forms. See Optimal policy.Changed: a constrained update that cycles between two branches takes the one consistent branch, and otherwise fails at once. Where a constraint binds,
immiterates its update through the constrained step. When the update kept alternating between two branches of the constraints, it failed after 20 iterations (retcode 314). It now checks each branch’s update against the constraints. When exactly one is consistent, the update takes it, and the period is listed in the filter’s output fieldresolved_cycle_updates. When neither or both are, the filter fails with retcode 314 at once. Wherever the update settled before, likelihoods and retcodes are unchanged bit for bit.Faster: filtering under constraints. Three overheads of the constraint engine are gone: the
max()/min()of a model’s constraints no longer go through name-value parsing, the projection onto the constraints no longer throws and catches an error to look up its tolerance, and a projection whose Gauss-Newton loop only returns to the same points stops at once instead of at its step cap. Likelihoods are unchanged bit for bit. On a switching NK-HANK with a ZLB and borrowing limits, an evaluation with the constraints enforced takes about 45% less time.Fixed: ``utils.math_comp.max(A)`` and ``utils.math_comp.min(A)`` with one argument errored. They now reduce as
max(A,[],'ComparisonMethod','real').Fixed: discretion under automatic differentiation. With
'solve_derivatives_type','automatic', next period’s discretionary policy entered the first-order conditions as a constant: its derivatives were lost, and order-2 solutions differed from the symbolic ones. Automatic and symbolic derivatives now give the same solution.Fixed: models built at ``max_deriv_order`` 0. Building a model without symbolic derivatives, to solve it with automatic derivatives, failed with an index out of bounds. It now builds and solves.
Changed: a plan and ``simul_regime`` that disagree about a regime are an error.
simul_regimeused to overwrite, silently, the regimes a plan fixes (append(plan, 'regime', t, r)). Where the two give different regimes for the same period,simulatenow stops withRISE:simulate:regimeConflict, naming the period; where only one gives a regime, or they agree, it is used. The jump-off date is not checked. See Forecasting and simulation.Changed: a constrained update that fails outright fails the filter (retcode 314). Where a constraint binds, the filter updates through the constrained step; when that update failed it fell back silently to the Kalman update, so the likelihood was not the constrained model’s. It now stops with retcode 314 (
CONSTRAINED_UPDATE_FAILED), which an estimation treats as an inadmissible draw. An observed variable held at its bound and an ill-conditioned branch keep the Kalman update, as before. On the test models no update fails outright, and likelihoods are unchanged. See Filtering.Fixed: in ``@transition_functions`` a log variable means its level, as in ``@model``. The transition matrix read a log variable as its log while the reported series (
zlb_tp_1_2) read its level, so the two disagreed, and a transition function with a negative power of a log variable divided by zero at the steady state. Every block now reads a log variable as its level. A model written for the old reading must be rewritten in levels (exp(theta*B)that stood forB^thetabecomesB^theta). See Time-varying transition probabilities.Fixed: under constraints, the regime-switching filters predict each regime with that regime’s solution. For each regime of the next period, the constrained prediction was taken in the most likely successor of that regime instead: the same regime when the transition probabilities are constant and persistent, often another one when they vary with the state or a regime stays with probability below 0.5. The prediction then disagreed with the covariance and the update of its branch, and the update through the constrained step fell back to the Kalman update (35 of 78 periods on a test HANK with time-varying probabilities; none now, and ten times faster). Constrained likelihoods of such models can change; models with constant, persistent probabilities are unchanged, bit for bit. Applies to every regime-switching filter, x-at-risk and the reduced models’ filter. See Filtering.
Changed: Taylor projection takes the expectation over next period’s shocks. The
rtpparadigm set next period’s shock to zero, so its solution had no risk correction at any order. The projection equations now hold in expectation (rtp.shock_nodes, a rule exact at the order): at the steady-state anchor order-2 Taylor projection is order-2 perturbation, and re-anchored it carries the same precautionary drift. Under regime switching the regimes’ policies now differ by their volatilities.'expectation','none'restores the old, certainty-equivalent projection; order 1 is unchanged. See Extending RISE through paradigms.Changed: under the OccBin paradigm a constrained variable lands on its bound when the binding branch is nonlinear in it. The constant of a binding regime is taken where its constrained variables sit on their bounds, so a rule
log(1+R) = gam*log(...)givesR = 0at the zero lower bound rather than the tangent value at the steady state. The new option'anchor_at_bound',falserestores the classical constant of the piecewise-linear method. See Occasionally-binding constraints and the tutorialModelShapes/occbin_bound.New: equations outside the optimization. An
@outside_optimization{W}block holds equations that are solved with the model but are not constraints of the optimal-policy players, such as a welfare tracker kept for reporting: they carry no multiplier, and the variables in the braces, one per equation, are taken as given by the players. The policy problem is then the one without those equations. A variable taken as given that enters what a player optimizes is reported (RISE:outside_optimization:feedback), or refused with'outside_optimization_feedback','error'. Exempting only some players and the linear-quadratic solvers are not available yet. See Optimal policy (Equations outside the optimization) and the tutorialOptimalPolicy/OutsideOptimization.Changed: the multiplier charts take the exact trend exponents of the Lagrange multipliers; one numeraire per independent trend. Under
geometric_multiplierswithmultiplier_charts, the exponents of the multipliers’ trends come from the symmetry of the static system rather than from the solved growth factors, so exponents such as -1 or 0 are exact and zero or negative multipliers get theirs from their first-order conditions (model_data.diagnostics.multiplier_trends).multiplier_numeraireaccepts a cellstr, one trending variable per independent trend, such as technology and the price level. The cases the numeraires do not span, multipliers that do not grow as a power law, and models where the exact route is declined are reported with warnings (rise:multiplier_charts:notSpanned,nonGeometric,exactDeclined). See Optimal policy and the tutorialOptimalPolicy/NonstationaryRamsey(howto_multiple_trends).Fixed: under discretion the mixed derivatives of next period’s policy functions counted several times. The first-order conditions of discretion and of stochastic replanning carry the derivatives of next period’s policy; a mixed second derivative entered them twice (a mixed third one three or six times). Solutions at order 2 and above change wherever the policy functions take two inputs or more; first-order solutions do not. On the quasi-hyperbolic consumer of Krusell and Smith (2003), whose Markov-perfect equilibrium has a closed form, an order-2 solution with a mixed derivative in the policy functions now matches the closed form to 5e-8, where its first-order coefficients were off by up to 0.5.
sstate_discr_policy_initnow sets the initial level and first derivatives of the policy functions (it had no effect). See Optimal policy.Changed: every first-order solve goes through the model’s configured solver; the linear-quadratic optimal-policy solvers state their own limits. The M expansion with self-consistent points solved the first orders of its fixed point with the general solver and refused
loose_commitmentandstochastic_replanningby name. It now uses the solver the model is configured with, whichever it is, assolvedoes (rise.engine.dsge_tools.solve.configured_solver). Each solver applies its own requirements: the linear-quadratic solvers need the lead derivatives of a pair of regimes, divided by the transition probability, to depend on the next regime only, and stop withRISE:looseCommitment:leadBlockDependsOnPreviousRegime(orRISE:stochasticReplanning:...) when the matrices they are given do not have that structure; above order 1 they stop withRISE:looseCommitment:firstOrderOnly(orRISE:stochasticReplanning:firstOrderOnly). On a linear-quadratic planner where the structure holds, loose commitment under self-consistent M (then selected by the retired M cell syntax) gives the general solver’s answer under self-consistent M (then selected by the retired M cell syntax). Nothing changes under'm'. See Optimal policy.Changed: the M expansion with self-consistent points and the Barthélemy-Marx anchors solve optimal-policy models. self-consistent M (then selected by the retired M cell syntax) and
'bm'were refused on any model with an@optimization_problem. A perturbation scheme does not depend on where the equations come from: the first-order conditions are now re-anchored like any other equations, under commitment, under discretion and wherever the commitment parameter switches, at every order, and with a common steady state both types return plain'm'. Under discretion the policy functions of next period’s regime, which the first-order conditions carry, are evaluated where the M expansion with self-consistent points puts the leads, at the transition points; under'm'nothing changes. See Perturbation types for regime-switching models and Optimal policy.Fixed: Taylor projection’s analytical Jacobian follows the lead point; a re-anchored root far from the policy is rejected. The model’s derivatives are evaluated where the next period’s policy lands, which every coefficient moves;
rtp.jacobian_analyticalheld them fixed (2.3% off the numerical Jacobian, and order-3 Newton stalled where a root exists). With the exact Jacobian, Newton beyond a fold of the order-2 equations in levels converged to absurd roots, so a converged re-solve is now kept only if today’s policy at the new state stays withinreanchor_max_jump(new option ofrtp.paradigm, default 0.5) of the last converged policy there; otherwise the step warns and reuses the last converged policy. In levels, order 3 now converges at every step from 0.9 to 0.3 of the steady-state capital. Written in logs (@log_vars), the growth model keeps the root of its projection equations everywhere, and order-2 Taylor projection is 40 to 450 times more accurate than order-2 perturbation in logs. Write models in logs for Taylor projection far from the steady state. See Extending RISE through paradigms.Fixed: Taylor projection differentiates the next period’s policy where the state lands. The projection residual used the next period’s policy and its derivatives at that policy’s own anchor, not where the state lands one period later; the two coincide only at a steady-state anchor of a constant-parameter model. Re-anchored order-2 solutions were therefore less accurate than order-2 perturbation near the steady state (on a growth model started at 90% and 70% of its steady-state capital, largest consumption errors of 0.060% and 0.536% of the steady state against 0.006% and 0.188%); they are now more accurate (0.0033% and 0.138%). Order 3 is as accurate as order-3 perturbation or better from 90% down to 30%. From half the steady-state capital or less, the order-2 projection equations have no root near the policy: those re-solves warn and reuse the last converged policy, and order 3 is the order to use. See Extending RISE through paradigms.
Changed: the RLL paradigm solves each local system with QZ and keeps its own constant by default. The defaults of
rll.paradigmare now'solver', 'rise_qz'(was'fi') and'use_steady_state', false(wastrue); both old values remain options. Functional iteration, capped at 100 iterations, failed at every re-linearization of the growth model far from the steady state, so RLL silently equaled first order apart from one warning; withuse_steady_statetrue the step applied the local slopes around the global steady state, which was less accurate than first order. From capital at 0.9, 0.7, 0.5, 0.4 and 0.3 times its steady state, the largest error in consumption against perfect foresight (% of the steady state) is now 0.07, 0.73, 2.25, 3.28 and 4.27, against 0.11, 1.16, 3.76, 5.94 and 9.05 at first order. At an occasionally binding bound the local system has no unique stable solution, so RLL keeps the previous local solution there, as before. See Extending RISE through paradigms.Fixed: each simulation under the RLL paradigm starts from the solved local policy.
rll.paradigmupdated its stored solution in place, so a simulation started from the local policy the previous one ended with and the same simulation run twice could give two paths. Each simulation now works on its own copy, as underrtp.paradigm. See Extending RISE through paradigms.Changed: a lead that a lag multiplies in a constraint of an optimal policy problem gets its own expectation variable. In
b{t} = b{t-1}/betta*(1+0.1*pie{t+1}) + ...the first-order condition forbwould carrypie{t+2}. RISE now givespie{t+1}the variableLEAD_1_piebefore it derives the conditions, as ifEPIE{t} = pie{t+1}had been declared in the model. Solutions under commitment are unchanged up to terms of higher order; under discretion and stochastic replanning the solution is now that of the expectation form, which solves much faster. Terms in which a lag and a lead interact nonlinearly are left as written. See Optimal policy (“A lead that a lag multiplies”).Fixed: re-anchored Taylor projection from a state far from the steady state. Under
rtp.paradigm(re-anchoring is the default), a growth model started at half its steady-state capital took a path on which consumption jumped up and capital ran down: the first re-solve started from the steady-state policy and converged to another root of the projection equations. Each re-solve now starts from the current policy evaluated at the new state, and only the states of the date-0 vector matter. The solved model also kept the anchors of the last simulation, so running the same simulation again could give another path; every simulation now starts from the solved polynomial. See Extending RISE through paradigms.Fixed: the heterogeneous-agent steady-state engine no longer runs away. On a Huggett household with a borrowing limit of -2, the Anderson-accelerated time iteration of
rise.engine.dsge_tools.sstate.het.enginecould throw the policy to absurd values (steps of 4e35) and then sweep slowly without end. A mixed step much longer than the plain one is no longer taken, a sweep whose step blows up restarts from the best iterate, and repeated blow-ups stop the solve with the warninghet:engine:diverged. See Heterogeneous agents (HANK).Fixed: a plan with free shocks runs over its whole span on a regime-switching model. On a regime-switching model, a plan whose shocks are free (
NaN) holds nothing after the jump-off, the regimes being left to the chain, and its database lost those dates:simulatereturned the jump-off alone, and a conditioned plan stopped after its last condition. The plan’s database now keeps every date. Single-regime models were not affected. See Simulation plans.Fixed: simulate honors ``simul_history_end_date`` with a plain database, and forecast draws its shocks under ``forecast_shock_uncertainty``.
simulateignored the date and started at the database’s first date, pinned to the data after it. When the history runs past the database’s first date, the simulation now jumps off at the date from the plansimplan.from_historygenerates out of the history, asforecastdoes. A database that starts at the date is a conditioning database, as before. The shocks of such a plan are now drawn under shock uncertainty (the constraint-enforcing shocks excepted); before, they were pinned, so a forecast from a database gave the same path whateverforecast_shock_uncertaintysaid.simplan.from_historytakes the regime and the shocks as optional arguments and no longer fails when the deepest lag predates the data. See Forecasting and simulation (“Starting from history”).Fixed: simulate takes a recursive plan under a solve paradigm. A plan built with
'recursive', truecarries a second page, and under a solve paradigm (for example the piecewise-linear paradigm on a model with a lower bound)simulatefailed with a size mismatch in the sub-step forecast. A paradigm steps with the shocks of the model’s own anticipation horizon: later pages that announce nothing are now dropped, so the recursive plan runs as surprises, and a page that announces something beyond the horizon is refused withRISE:simulation:planExceedsParadigmHorizon. Undersimulate, page-1 entries are surprises whether the plan is recursive or not. See Surprises and announcements (“Under simulate”).Fixed: the historical decomposition of a VAR gives the constant its own column.
historical_decompositionread the constant of a VAR from a place where the solver leaves zero, so theconstcolumn was zero and the structural-shock columns absorbed the constant (the columns still added up to the data). The columns are nowinit(the initial lags propagated),const, one per deterministic variable, and one per structural shock, which contain the shocks’ contributions only; they add up to the data. With regime switching the regimes are weighted by the smoothed regime probabilities and the output has one page instead of one per regime.residualsandstructural_shocksno longer contain the constant either. Results change for every VAR with a constant and for every switching VAR. See Reduced-form VAR Modeling.Fixed: tuning the independence sampler maximizes its acceptance rate. With
do_tuning,imhused the random walk’s rule (shrink the scale until the acceptance rate reaches 0.234), which collapses an independence proposal: on a multimodal target the scale fell to about 1e-200. It now searches the scalec0*2^kthat maximizes the acceptance rate and fixes it; on Gaussian targets it lands within a fifth of the best scale. Warningsrsamplers:imhTuningFailedandrsamplers:imhTuningAtSearchEdgeflag a search that cannot succeed. The random walk is unchanged. See Posterior sampling (“Tuning the proposal scale”).Changed: the Choleski identification of a reduced-form VAR follows the order in which the variables were declared.
identify(m, 'choleski', shock_names)andidentificationused to run the recursion in RISE’s alphabetical order of the variables; they now follow the list given torfvar_model(units, then variables, forprfvar_model), as a recursivesvar_modeldoes. Shock k belongs to the k-th declared variable and takes the k-th name; the new option'ordering'sets another order. An unidentified reduced-form VAR uses the same recursive factor. Results change unless the variables were declared alphabetically;'ordering', sort(variables)reproduces the old recursion. Also,irfnow labels the responses by shock slot, so it always agrees with the variance and historical decompositions, including with fewer names than variables. See Reduced-form VAR Modeling.Changed: template differentiation is the default. The construction option
template_diffis nowtrue: every model is differentiated one distinct expression at a time, and an equation with no repeated term is differentiated as before. Same derivatives (to rounding) at every order, with and without regime switching.dsge_model(file, 'template_diff', false)keeps the standard path. See Template differentiation.
3.2. Release 20260831
New: template differentiation, construction option ``template_diff``. Models that repeat a few equations – the cells of a heterogeneous-agent model, the countries or sectors of a loop-generated model, or copies typed out by hand – are differentiated one distinct expression at a time: RISE finds the terms that are the same expression up to a renaming of variables and parameters, differentiates each once, and evaluates its derivatives for all copies in one vectorized call. Nothing to annotate:
dsge_model(file, 'template_diff', true). Same derivatives as before (to rounding) at every order, with regime switching (constant or time-varying probabilities) and in disk mode. On a two-asset HANK model with 150 cells, differentiation falls from 655 s to 40 s and peak memory from 29.8 GB to 5.2 GB; Jacobian evaluation is 30 to 230 times faster across the models measured. Off by default. See Template differentiation.Tests:
models/dsge/template_diff; tutorial:ModelShapes/template_differentiation.Fixed: options given inside the model cell no longer discard the name-value options.
dsge_model({file, name, value}, name2, value2)rebuilt the construction options from the cell alone, silently droppingname2(e.g.'smooth_kinks', false). The cell’s names and values are now validated and merged with the name-value options; a runtime option in the cell, an unknown name, or the same option with two different values is an error. Options are meant to be passed as name-value arguments; cells holding the model line by line, several snippets or several files are unchanged.New: ``rise.microfound`` derives Kuhn-Tucker (inequality) constraints.
.subject_to(irrev="I >= 0")used to be accepted and then silently dropped from the derived model – you got a clean solution to the UNCONSTRAINED problem, with no error and no warning. Inequalities are now normalized to theirg <= 0side, given a multiplier<agent>_lambda_<label>that enters the FOC of every control the constraint touches, and emitted as the complementarity row. Since the Lagrangian isL = U + lambda*g, the derived multiplier is the negative of the textbook one, solambda <= 0,g <= 0,lambda*g = 0is exactlymax(lambda, g) = 0– written out as thatmax, which the parser already recognizes as a kink and routes through the occasionally-binding-constraint machinery. Both>=and<=are accepted (strict forms treated as non-strict). A slack constraint is inert:examples/microfound/rbc_irreversible.mreproduces the plain RBC steady state withI = delta*kand a zero multiplier, while a binding floor pins the variable and returns a negative multiplier. Regression testmodels/dsge/microfound/testMicrofoundKKT.``rise.whatsnew(n)`` no longer spends a slot on an empty section. Cutting a release leaves a freshly opened, empty
Unreleasedheading behind, andrise.whatsnew(1)used to print that – the preamble and nothing else. Sections with no entries are now skipped, soncounts sections that actually carry entries.Fixed/New: mixed OBC enforcement — a ``max``/``min`` kink and a regime-switching constraint can now coexist in one model, each enforced by its own mechanism. Previously a kink on a switching model silently disabled the regime machinery: the constrained simulation path took the deterministic modal transition every period (a persistent chain never left its initial regime), a user
simul_regimeswitch rule errored out with “Both simul_constraints and simul_regime were provided” (the kink had auto-setsimul_constraints), and user-declaredsimul_constraintsoverwrote the auto-generated kink rows, leaving the kink enforced by nothing. The enforcement contract is now: the regime comes first, the fudge shocks second. Each simulated period, the regime-switching machinery selects the regime (stochastic transition draw persimul_stochastic_regimes, or a switch rule reweighting the transition row), and the one-step forecast then resolves the fudge-owned restrictions within the selected regime — including inside the candidate-regime forecasts a switch rule compares, and under pre-specified regime paths. Ownership is per restriction row: kink-derived rows (with their autoFUDGE_FACTOR_*enforcers) are always fudge-owned; user rows are regime-owned when given in 2-column form on a switching model and fudge-owned otherwise; usersimul_constraintson a kinky model now merge with the kink rows; the auto-compiled switch rule covers only the regime-owned rows; a user switch rule is accepted alongside fudge-owned rows and conflicts only with regime-owned rows (clear error). Pure kink-only and pure regime-switching-OBC models are unchanged (all locked regression numbers reproduce). Estimation/filtering violation-check forecasts still force the deterministic modal regime path for reproducibility. Worked example and regression test:models/dsge/obc/worked_examples/mixed_enforcementin the test suite.New: ``threshold_chains``, a one-line declaration for threshold and smooth-transition VARs. Available on every VAR constructor (
rfvar_model,svar_model,prfvar_model,proxy_svar_model):m = rfvar_model(endo, 'lag_length', 1, 'threshold_chains', struct( ... 'name','sc', 'controlled_parameters',{{'b','c','covar'}}, ... 'threshold_variable','ACR'));
This was always expressible by hand — a two-state chain whose
endogenous_probabilitiesare a steep logistic — and the machinery is unchanged: the sugar desugars into exactly thatmarkov_chainsentry before anything downstream sees it, so a sugared model reports the chain it actually has. What the sugar buys is that four things which are invisible when wrong are now impossible to get wrong: that the third argument oflogisticis the threshold; that the two probabilities must be complements (a threshold rule is memoryless ins_{t-1}, so two independent logistics silently give a smooth-transition chain, which is a different model); thatdelay = 1is written with no lag operator because the transition matrix built attgoverns the regime att+1; and that a slope too flat for the scale of the variable leaves observations in the logistic’s interior, where they become genuine regime mixtures.threshold_valueand, for the smooth transitions,slopeeach take either'estimate'(the default — creates<chain>_bar/<chain>_gam, free to be given a prior) or a number, which is written into the transition expression as a literal and creates no parameter at all. The asymmetry is deliberate: a fixed value that arrived as a parameter would be one more name the user must remember toset, and forgetting is silent — the model builds, filters and returns a likelihood computed at whatever the uncalibrated value happened to be. That is the class of failure this sugar exists to remove, so a fixed threshold does not get a name.transitionselects'hard'(default),'logistic'or'exponential'; the hard case uses the newutils.smooth_transition.hard_threshold, theg -> inflimit of the logistic floored into[1e-10, 1-1e-10], so there is no slope to choose. It is namedhard_thresholdand notthresholdbecause MATLAB’s Econometrics Toolbox ships a@thresholdclass and a class folder takes precedence over a path function — the shorter name is silently shadowed.Two implementation notes for anyone touching it.
hard_thresholddeliberately does not wrap its comparison indouble(): RISE differentiates transition functions through@rsymbdiff, which overloadsgtbut has nodouble, so the cast would make the function unusable inside a@transition_functionsblock. Andthreshold_chainsis dropped from the options handed to the code generators (rise.engine.parser.generator_config_pairs), which declare exactly the configuration they accept.Covered by
models/var/reduced_form/testThresholdChains.m(11 tests, including that the sugared chain reproduces the lagged rule, that the contemporaneous rule demonstrably does not fit, and that a model built with a fixed threshold gives the same likelihood as the same chain written out by hand). Documented in the reduced-form VAR chapter.New: local projections, with state interaction and sign-restricted identified sets.
rise.engine.var.lptools.estimateruns the projections andrise.engine.var.lptools.identified_setsearches rotations over them.A local projection is neither a VAR nor a univariate model, and it does not get a model class. There is no dynamic system, no state space and no likelihood: it is a stack of OLS regressions of leads on current and lagged variables, and nothing about it is sampled. What makes it structurally usable is that, with
y_ton the right-hand side, the coefficient block ony_tat horizonkis the reduced-form impulse response matrix at that horizon (Plagborg-Møller & Wolf). So the estimator’s whole job is to hand back{B_k}andSigma— exactly the pair a rotation-based scheme consumes — and two functions are the honest shape for that.Restrictions are parsed by the same routine the VAR family uses (
vartools.read_identification_restrictions, extracted frombuild_identification_enginewhere it had been a local function), so'GDP{0:2}@MP'means the same thing on both sides.identified_setadds anelasticitybound on the ratio of two impact responses and anormalizeoption that rescales each accepted draw. Lag-structure restrictions are rejected: a projection has no lag polynomial.Two properties of the specification are enforced and documented rather than left to be discovered: horizon 0 is the identity by construction (its regression contains its own left-hand side), so
Sigmacomes from thek = 1residuals; and with a single pooledSigmaa state-dependent projection can only reveal state-dependence living in the propagation coefficients, never in the impact covariance. If a mechanism lives there, a switching VAR is the right tool.Both local projections, not one. Passing
shock— the name of a measured shock series — switchesestimatefrom the rotation-based form above to the Jordà (2005) / Ramey–Zubairy (2018) form, where the coefficient on that series is the structural response and no identification step exists.est.moderecords which you ran. The two answer different questions and are not interchangeable, so they are labeled rather than blended: shock mode returnsbetaandbeta_seand leavesBempty, andidentified_setrejects such an estimate outright rather than rotating nothing.Shock mode drops the contemporaneous block, and that is the whole design.
s_tcausesy_t, soy_tmediates the effect being measured; conditioning on it closes the channel and drivesbetatoward zero — a bad control, and a silent one. Only lags ofyare controls. A consequence worth having:betaatk = 0is a real estimate, the impact response, where lpvar mode’sB{r}{1}is the identity and carries no information.Standard errors are Newey–West, truncated at
k + 1by default (hac_lagsto override). Overlapping horizons leave the horizon-kresidual serially correlated of order roughlyk, so OLS standard errors are wrong and get worse with the horizon; shippingbetawithout a HAC correction would have shipped an unusable number. lpvar mode reports no standard errors — its uncertainty is an identified set.And the validation direction, with its precondition. Running a projection on data simulated from a model you control — and checking it returns that model’s own responses — is how you learn whether a specification can recover a mechanism before trusting it on real data. It works: on a known VAR(1) with a triangular impact matrix,
chol(Sigma,'lower')recoversAto0.002andB_k*Amatches the model at every horizon to0.004.It works only when the shock is recoverable from the observables handed over, and the failure is silent. For
y_t = e_t + 2 e_{t-1}— non-fundamental, with autocovariances identical to the invertibley_t = u_t + 0.5 u_{t-1}— the projection returns0.502where the truth is2, reporting decay where the effect grows, atT = 200,000. More data never helps. This is not a weakness of local projections: LP and VARs estimate the same object, so LP inherits invertibility problems in full and is not a robustness fix for non-fundamentalness. Supplying a shock series recovers[1, 2]on exactly that data — the fix is information, not a different estimator.Covered by
models/var/local_projections/testLocalProjections.m(19 tests, including that a linear projection on VAR(1) data reproducesB^k, that shock mode recovers(B^k A)(:,1)exactly — impact vector included — that the model→data→projection round trip closes, that the non-fundamental IRF is not recoverable from history while shock mode gets it, that a normalization is exact, and that an elasticity bound binds). The bad-control test uses a noisy proxy deliberately: with the exact structural shock,e_t = inv(A)*(y_t - B*y_{t-1})makes the bad-control design singular, so the comparison would measure a minimum-norm artifact rather than the bias it claims to. Documented in the new Local Projections chapter; tutorial atrise-modern-tutorials/ModelShapes/local_projections.New: a policymaker can declare that it distrusts its model. Add
@robustness = rhoto an@optimization_problemand the policy becomes robust in the sense of Hansen and Sargent: it is chosen to perform acceptably not only under the model as written, but under the least favorable model close to it.@objective = -0.5*(pi^2 + lambda_y*y^2 + lambda_i*i^2), @robustness = rho_m, @instrument = i
That is the whole of it. The objective stays the ordinary loss: you do not write the adversary, its instruments, or any entropy penalty.
rho = 1/thetais the robustness intensity and it belongs to the policymaker in the way risk aversion does – it prices how far the policymaker entertains its model being wrong. It must name a parameter, never a number, so it can be calibrated, estimated, and attached to a Markov chain, which lets a policymaker fear misspecification more in one regime than in another. ``rho = 0`` is expressed by omitting ``@robustness``: a model that does not ask for robustness does not pay for it, no distortion variables are created, and the answer is the ordinary one rather than an approximation to it.No new solver was needed. A robust policymaker behaves as if an adversary were choosing the worst misspecification it can afford, which is a two-player zero-sum game, which the non-cooperative-games engine already solves. What was missing was not an algorithm but the writing-out, and that is what the parser now does: one distortion instrument per shock, named
DISTORT_<SHOCK>, entering inside that shock’s own coefficient and at every occurrence of it; a one-period lag, so the adversary commits before seeing the innovation it distorts; the adversary’s objective as the policymaker’s, negated, with the entropy term carried by both; and the adversary one@orderbehind, sincemin_u max_wis the ordering the problem is written in.Each of those five changes the answer if it is wrong, and two do so silently – the entropy term placed in one objective instead of both, and the adversary allowed to see the shock it distorts, are each worth about 1e-2 in the policy rule while passing every check that does not involve robustness. The fourth cannot be got right by hand even in principle: a
#definition may not contain variables, so a hand-written game must duplicate its objective and the two copies drift.The distortions are ordinary endogenous variables and appear in the solution, in impulse responses and in simulations. That is deliberate: with more than one shock the worst case is a direction, and which misspecification a policy guards against is usually the point of the exercise. On a small two-shock New Keynesian model the policymaker puts 88% of the distortion on the cost-push shock and 12% on demand – not because demand shocks are smaller, but because the instrument can offset them.
Robustness composes with everything already there: both solution routes, every timing protocol, and regime switching, including a switching
rho. It is bounded, though: past a model-specific frontierrho < 1/lambda_max(C'*Pbar*C)the adversary can buy unbounded damage and the problem has no value. The frontier is an eigenvalue condition, so it moves with the model; under switching it couples regimes; and it moves as it is approached, since it depends on the value under the robust policy itself. It can be small – near 3e-4 on an estimated New Keynesian model – so bracket it rather than guess.Validated against a hand-written statement of the same game to 5e-14 over two multipliers and both timings, and on Chen-Kirsanova-Leith – three named shocks, two Markov chains, four regimes – to 4e-16. Independently, the underlying recursion agrees with a coupled robust Markov-switching Riccati, an algorithm that appears nowhere in RISE, to 1e-14.
Refused, with a reason:
@robustnesson more than one player of a game. Each would fear a different misspecification, so the problem stops being zero-sum and becomes a fixed point in rules – a different object, not a bigger version of this one.Fixed: a switching SVAR with endogenous transition probabilities could not be built at all.
generate_svar_dsgeappended the transition-probability names to the@endogenouslist. The modern parser rejects TVTPs declared as endogenous variables, so construction stopped with “The following transition-probability names appear in @endogenous … must be declared in @transition_functions”. There was no way round it from the user side: the names are generated, not written by hand.proxy_svar_modeldelegates to the same generator and was blocked identically.The same generator also emitted the equations as legacy
! <eqtn>;lines inside@model, which still parse but raiserise:tvp_bang_prefix_deprecatedon every build.Both are now the modern form — the names stay off
@endogenousand the equations go in a@transition_functionsblock — matchinggenerate_rfvar_dsge, which had been migrated while the SVAR generator was left behind. Covered bymodels/var/structural/testSwitchingSvarTransitionFunctions.m, which checks construction, that the names are not endogenous, that no deprecation warning fires, that the solve gives a regime-specificA0^{-1} diag(sigma), and that proxy-SVAR inherits the fix.Fixed: an informative VAR prior could not be used on a switching RFVAR.
estim_var_prioraccepts a+var_priorstemplate (Minnesota, NIW, IW, Sims-Zha, …). Every one of those templates already exposesevaluate_at_reduced_form(B, Sigma_u), andsvar_evaluatoralready evaluates it at each regime’s reduced form and sums — the standard reading of “the same prior applied in every regime”. But onlysvar_modelandproxy_svar_modelregistered aroutines.var_prior_evaluator, so an RFVAR never reached that path.Both ends then took the older single-regime branch.
merge_var_priorsassigned the template’s parameters under BARE names, where a switching parameter needs one entry per state (<pname>_<chain>_<state>), so a switching RFVAR died during prior setup with “parameter c_acr is not controlled by const”; and had it survived,log_prior_densitywould have calledtemplate.log_prior(param), which is dimensioned for a single regime’svec(B). Non-switching RFVARs were unaffected, which is why this stayed out of sight.rfvar_modelnow registers+rise/+engine/+var/+var_priors/rfvar_evaluator.m, the RFVAR counterpart ofsvar_evaluatorand the simpler of the two: a reduced-form VAR is parameterized by its reduced form, soBis read straight off thec_*/b<lag>_*parameters with noA0to invert, andSigma_uoffcovar_*(via the sharedvartools.rfvar_sigma). The evaluator branch ofmerge_var_priorsnow also emits the RFVAR-shaped names (b<lag>_*,covar_*) and keeps taking start values from the template’smeanwhere it carries the parameter, so start values do not regress. Covered bymodels/var/reduced_form/testReducedFormVarPrior.m, which checks the density against a hand-built two-regime sum.Fixed: a reduced-form VAR’s residual covariance never reached its state space, so every likelihood-based RFVAR route ran with ``Sigma = I``. An RFVAR carries one residual per equation, correlated across equations, parameterized by
covar_sigma_<i>(variances) andcovar_<i>_<j>(covariances). Butgenerate_rfvar_dsgewrites each residual into the generated model with a unit loading (... + e1{t}), so those parameters appear in no equation, and nothing read them back. The derivative solve therefore returned a shock block equal to the identity no matter what the parameters said.The consequences were silent and wide. The likelihood was exactly flat in
covar_*— moving a variance from 0.04 to 16 left the log-likelihood unchanged to the last digit — so any ML or Bayesian estimation of those parameters was estimating on a flat surface and returning its seed. Regime-dependent covariances (controlled_parameterscontaining's'or'covar') were a no-op, which made regime heteroskedasticity in an RFVAR a no-op. Identification readSigma_u = Iand rotated the wrong object. Only the OLS short-circuit escaped, becauseestimate_var_olsbypasses the parameter dictionary and writes Sigma into the state space by hand.Fixed by
+rise/+engine/+var/+vartools/apply_reduced_form_covariance.m, called fromdsge_tools.solve.solveafter a successful solve and before identification: it assembles each regime’s Sigma from thecovar_*parameters and writes a Cholesky factor into that regime’s structural shock columns, the same blockapply_identificationlater rotates. SVAR and proxy-SVAR are untouched — they already build their impact block structurally asA0^{-1} diag(sigma). Panel VARs are covered too:generate_prfvar_dsgeexpands the endogenous list to<unit>_<var>and delegates to the RFVAR generator, so theircovar_*names resolve againstvar_block_nameslike any other RFVAR’s.No behavior change for an uncalibrated covariance. A
covar_*that was never given a value (NaN) keeps its identity entry — unit variance, zero covariance — which is precisely what the generated model hardwired before any of this was transmitted. Forcing people to calibrate a covariance matrix by hand to get a VAR to solve would be a tax on everyone to catch a mistake almost nobody makes;estimateseedscovar_*from an OLS pre-fit anyway, so the only affected population is hand-built models, and those keep working exactly as before. NaN means “unspecified”, not “invalid”: a value that was supplied and cannot be a covariance (negative variance, an inconsistent pair, Inf) still stops the solve, with the new retcodeRFVAR_COV_NOT_PD(264).Covered by
models/var/reduced_form/testReducedFormCovariance.m(per-regime Sigma, the panel case, identity defaulting for unset and partially-set covariances, rejection of a supplied-but-invalid one, likelihood responsiveness, and the shorthand forms).Fixed: ``controlled_parameters`` entries naming a VAR covariance were silently ignored. In
assign_markov_parameters, the shorthand expander testedstartsWith(param,'c')beforestartsWith(param,'covar'). Since'covar'also starts with'c', every covariance token fell into the constant/deterministic branch, matched neither'c'nor'c(', and came back as an empty expansion — which the caller could not distinguish from a shorthand that legitimately matched nothing, so the parameter was left uncontrolled without a word. This made the entire'covar'family ('covar','covar(diag)','covar(offdiag)','covar(y1,y2)') dead code, and it also swallowed a fully typed-out name such as'covar_y1_y2', so an off-diagonal could not be made to switch by any route.'s'was unaffected — it is matched later in the chain — which is why the diagonal appeared to work.The covariance branch now precedes the constant branch, a typed-out
covar_*name resolves to itself, and'covar(y1,y2)'strips its parentheses correctly (the old slice kept a leading(). Related: acontrolled_parametersentry that expands to nothing is now an error (assign_markov_parameters:emptyExpansion) instead of a silent drop — the check is on the expansion before the existence filter, so a shorthand may still generate candidates that do not exist, as the normalizeda0diagonal does. Covered bymodels/var/reduced_form/testReducedFormCovariance.m.Fixed: a switching parameter inside a player’s objective was frozen at its first-regime value by the linear-quadratic game solver. In a non-cooperative game solved with
solver = 'loose_commitment'orsolver = 'stochastic_replanning', each player’s objective curvature was read once, at regime 1, and reused in every regime. The constraint blocks were always read at the regime they belong to; only the objective rows were not. A model whose loss weights switch – a policymaker who penalizes an instrument more in one regime than in another, say – was therefore solved against the wrong loss in every regime but the first, and the general route (solver = 'mfi') disagreed with it.The answer was wrong rather than merely imprecise: it was not an equilibrium of the game, and the wronged player’s own best response departed from it. The error grows with how much the objective switches and vanishes when it does not, which is what kept the condition out of sight. Models with regime-invariant objectives are unaffected and no existing result changes.
Fixed in
+rise/+engine/+dsge_tools/+optimal_policy/lq_game_engine.mby carrying the regime on the objective block, as the constraint blocks already did. Covered byrf3sw_obj.rs, a game whose loss weights switch and whose@modelblock does not.New: the linear-quadratic optimal-policy solvers now accept non-cooperative games.
solver = 'loose_commitment'andsolver = 'stochastic_replanning'previously errored with “cannot solve non-cooperative games”; both now handle any number of players at the same@order(same-level Nash), any number of Markov regimes, forward- or backward-looking constraints, and either equilibrium concept (solve_policy_equilibrium'MPE'or'OLE'). No new solver name was introduced: the re-optimization protocol is the solver, the number of players is a property of the model, and the two are orthogonal.The point of the specialization is that it never evaluates a policy-derivative (``f1942``) function. The general route approximates every player’s decision rule by a polynomial and iterates on that approximation, re-evaluating the model’s derivatives and re-solving the steady state at each pass. In a linear-quadratic problem those rules are linear and the coefficients being searched for are entries of the solution matrix, so the whole apparatus reduces to two blocks written in closed form: the rivals’ reactions entering an augmented lag block, and the total derivative of the constraint that a re-optimizing player prices. Those two are held fixed while an ordinary constant-coefficient rational-expectations problem is solved, then updated – the same two-level structure the general route uses, and what selects the mean-square-stable root.
On a two-country central-bank game with 34 endogenous variables and two regimes, under discretion with Markov-perfect play, the specialized route is 8-9 times faster (4.4-4.9 s against 39-40 s) and agrees to 1.5e-06, which is the general route’s own accuracy. It also solves at default settings where the general route returns retcode 210 and needs
solve_discretion_maxiterlifted from 100 to 500. On small models the advantage disappears: warm, the two are within a factor of two of each other at 13-17 equations, because fixed costs dominate.New engine at
+rise/+engine/+dsge_tools/+optimal_policy/lq_game_engine.m, with the model-ordered blocks inlq_game_blocks.m. The single-planner path is untouched – a one-player model never enters the game branch, and the existing 26 optimal-policy regression tests pass unchanged. The parser now records the per-player bookkeeping the engine needs (player_wrt,player_instruments,player_order) instead of leaving it to be recovered from equation-tag strings, andset_lq_gamereplaces the blanket refusal inset_loose_commitment.No new options. The coefficient loop is the same loop, over the same objects, as the general route’s, so it reads the same two settings:
solve_discretion_maxiterfor its iteration cap (floored at 50, exactly as inrun_loop_local) andsolver{2}.TolFunfor its tolerance. Tighten either and both routes respond identically. The one genuinely engine-specific choice – which solver handles the inner constant-coefficient problem, since the name that selected this engine would not dispatch there – travels in the solver’s own option struct rather than becoming a property of the toolbox:solve(m,'solver',{'stochastic_replanning','InnerSolver','mnk'}), defaulting to'mfi'.One case is refused with a reason rather than answered. Loose commitment with a commitment probability strictly inside (0,1), for a game: the probability would have to scale each player’s forward multiplier block, which cannot be expressed in the form the shared first-order engine reads – use
stochastic_replanning.Settled: the promise coefficient is an EXPECTATION, not the realized value — and the last refusal is gone. The linear-quadratic game engine used the promise block at the realized regime. The parser uses its expectation over the successor regime, conditional on landing in one that honors the promise:
- Abar(r_t) = sum_j Q(r_t,j) 1{gate(j)>0} A(j)
/ sum_j Q(r_t,j) 1{gate(j)>0}
The two readings coincide unless the promise block VARIES across the regimes that honor it, which needs three things at once: a hierarchy (so a leader holds promises on its followers’ conditions), a commitment indicator that differs across regimes (so a promise can span a change of status), and a switching structural coefficient (so its value differs by regime). Any two agree; the triple did not, by 1.3e-03.
The relationship was verified in closed form before anything was changed: with the structural chain at (0.9/0.1, 0.2/0.8) inside the commitment chain, the parser’s coefficients are exactly that conditional mean of the engine’s, to six figures in both commitment regimes. The engine now reads it the same way and the two routes agree to 7.3e-09. Fixture
game_fllfsw.Because the transformation is the identity when the block does not vary across honoring regimes, nothing that already agreed moved – which is also why the case had to be constructed before the difference could be seen.
NOTE for whoever revisits this: it makes the games engine AVERAGE where the single-planner promise block was fixed to use the REALIZED block (see the
sum_j Aplus{r0,j}defect). The objects differ – this average is over the successor conditional on honoring, that one was over where the economy might land when r_t was already known – but they rhyme, and the general route was taken as authoritative here rather than derived from first principles. One nested function (promise_expectation) to revert.New: three or more ``@order`` levels are covered. Every hierarchy fixture had exactly two. The construction is a forward pass over processing order and is generic in the count – at the third level the row map resolves rows belonging to two different earlier groups rather than one.
game_rf3x(orders 1/2/3, one player each) prices 3 / 7 / 15 rows and agrees with the general route at 2.1e-10 (MPE) and 4.3e-10 (OLE). Checked rather than assumed, because “generic by construction” was also true of the Markov-perfect cross-chain beforegame_fl3lfdisproved it.Settled: the re-optimizer faces the RESET rule, and the last refusal is lifted. Two channels in the linear-quadratic game engine stand in for what the general route evaluates with
f1942: the re-optimizer’s continuation, and the Markov-perfect reaction of a rival’s instrument. That machinery exists for DISCRETION and takes the non-multiplier variables as its inputs by construction – a planner that re-optimizes has discarded the promise it inherited, so the continuation it faces is a function of the genuine states alone.That is the reset projector
R = diag(I,0)the engine already owns:loose_commitmentizeapplies exactly it, but only AFTER the fixed point. Inside the coefficient loop both channels were substituting the RAW rule. They now substituteH*R.It is a no-op almost everywhere, which is why it went unseen. Under pure discretion
Halready equalsH*R– the multiplier columns of the rule are zero at the fixed point. Under pure commitment the discretion gate is zero and the continuation term is never used. Only a MIXED indicator reaches the case that matters: a discretion regime substituting forward into a COMMITTED successor, whose rule does respond to the promises made today (those columns measure 2.57, not zero).It is also read only by a player whose differentiation targets include a multiplier. Own-level multipliers – a player’s own and its same-
@orderpeers’ – are never targets, so only a player above the bottom level reads them, and for a single-level Nash game the whole thing is a no-op.Costs, measured on a forward-looking two-level game with a regime-varying indicator: 0.37 of a leader’s contemporaneous block from the continuation channel, and 1.5e-01 of the solution from the cross-chain. With both reset, the routes agree to 5.3e-09 (two players) and 2.2e-08 (three), and the refusal of a hierarchy with a regime-varying commitment indicator is lifted.
New fixture
game_fl3lf: two leaders sharing a level above one follower, forward-looking. It is the only shape in which both channels are live on the same player – a two-player hierarchy leaves the leader’s rival set empty, andgame_rf3lfhas the two leaders but is backward-looking with zero multiplier columns. The cross-chain defect was invisible until it existed.Nothing in the general route changed, and nothing needed to.
Fixed (BOTH routes): the commitment indicator was mis-dated in a leader’s forward block. It is one symbol doing two jobs, and the right date depends on which row it sits in.
On a STRUCTURAL row it asks “does the planner honor an inherited promise NOW”, which is a property of
t, anddate_switching_parametershas always – correctly – left it there. On a row that is a previously eliminated player’s FIRST-ORDER CONDITION, which exists only under a hierarchy, it asks something else: that condition carries the FOLLOWER’s promise term, and the block it sits in is multiplied bylambda{t+1}, so what a leader prices isbeta*E_t[lambda^L_{t+1} * c_{t+1}]– “will my follower, NEXT period, honor the promise it is making now”. The indicator belongs to the regime realized att+1.Left undated it was read at
r_t, and being a bare parameter it carried no tag for the forward shift to move: the same mechanism as thedc/du^rivalmis-dating. Worth 0.5 of the leader’s lead block on a forward-looking two-level game, and it applied to the GENERAL route as much as to the linear-quadratic one – any leader-follower model with a switching commitment indicator was affected whichever solver was chosen.The dating pass now splits by row. That is what makes the fix safe: a single planner and a same-level Nash game have no rows above the structural block, so neither can be reached at all, by construction rather than by testing. Measured on a forward-looking hierarchy under commitment: the assembled system and the parser’s went from 9.1e-03 apart to 4.9e-15.
Hardened: the date shift refuses to run on an undated switching parameter. Every coefficient that has to travel from
ttot+1in the optimal-policy pipeline goes through oneregexprepin the parser,local_lead, and that expression moves time-tagged atoms only. A bare parameter carries no tag, so it does not move: it stays bound to the equation’s own regime while every coefficient beside it lands atr_{t+1}. For a constant parameter that is harmless. For a switching one it is a mis-dating, and an invisible one – nothing errors, nothing warns, and it cannot be seen at all with a single regime. Two independent defects have now come through that funnel.local_leadnow errors, naming the parameter, if it is handed a block still carrying an undated switching symbol. Exactly two are exempt, because their timing genuinely is not the constraint’s:commitment, which asks whether an inherited promise is honored now, andole, which selects the equilibrium concept and is the same at every date. Models that were correct are unaffected – the guard is silent once the dating pass has run.New: leader-follower games on the linear-quadratic route. Players with distinct
@ordervalues – a Stackelberg hierarchy rather than Nash – were refused byset_lq_game, on the grounds that a leader differentiates its followers’ conditions and so brings in derivatives of every tracked decision rule, and second derivatives of them. Under LQ those rules are linear and their coefficients constant, so the second derivatives vanish; and the followers’ conditions are rows of the very system the engine writes, so a leader’s dated blocks are a row-restriction of the matrices being built. Assemble the players in processing order –@orderdescending, which is the order the parser eliminates them in, hence lower ``@order`` = leader – and the rows a leader needs are already there. No new algebra, and it composes with the timing exactly as Nash does.Verified block by block against the parser at its converged coefficients on a two-player hierarchy: for the follower
A0/A+/A-differ by0/6.3e-11/0, for the leader by9.1e-12/0/0. Against the general route the solutions agree to1.6e-09backward-looking,1.9e-10with a switching coefficient on a rival’s instrument,1.4e-07forward-looking (the reference’s own accuracy), and exactly under commitment.Beware the indexing:
player_order,player_constraint_rows,player_multipliersandmult_groupsare in processing order while the parser’s declaration list is not. With one player per level the two coincide;game_rf3lfin the regression suite is the fixture where they do not.Refused, and deliberately not papered over: a hierarchy whose commitment indicator differs across regimes. A leader prices its followers’ conditions, and a follower’s condition carries a promise term gated by that indicator. Read as a constraint at
t+1– which is what the leader’s forward block is – the gate belongs to the regime realized att+1; the parser reads it atr_t, because the indicator is a bare parameter with no time tag anddate_switching_parametersexcludes it by name, deliberately (in the single-planner promise block, “does the planner honor an inherited promise now” really is a question aboutt). The readings coincide while the indicator is constant across regimes – pure commitment and pure discretion solve normally – and part company by0.5of the leader’s lead block as soon as it is not. Making the engine agree by copying a dating it does not believe is precisely what hid the mis-dating below for as long as it hid it, so it refuses instead and says why.Fixed: ``MPE`` no longer differs from ``OLE`` under commitment on the linear-quadratic game route. Markov perfection is a discretionary concept and the general route says so by construction: it enters its coefficient loop on
any(commitment ~= 1)and never on the equilibrium concept, so with a commitment regime everywhere the tracked policy derivatives stay at zero and the cross-player chain term is absent. The linear-quadratic engine computes those derivatives itself, so nothing stopped it applying the term anyway – and it did, putting it1.6e-02of the decision rule away from the general route on a two-player backward-looking game undersolve_policy_type = 'ramsey'with'MPE'. Both routes now agree exactly there.Fixed: the linear-quadratic game engine wrote its first-order-condition rows negated relative to the parser. A condition and its negation are the same equation, so for a Nash game the choice was free and invisible. It is not free once a leader prices its followers’ conditions: the leader’s row then mixed structural-multiplier columns carrying one sign with follower-multiplier columns carrying the other. Every condition is now written the way the parser writes it, which also means the two routes report the same shadow prices rather than a sign flip on the rows a leader carries.
Fixed (tests): two refusal tests in the linear-quadratic game suite never reached the solver. They passed a handle of the form
@()evalc('solve(m,...)'); an anonymous function captures only the variables its body mentions, and a name inside a string literal is not mentioned, so the handle raised “Unrecognized variable m” wherever it was called and the “did it refuse?” assertion was satisfied by the wrong error. Both are now real.Fixed (BOTH routes): the Markov-perfect chain term was mis-dated when a rival’s instrument carries a switching coefficient. Player
p’s optimality condition carriesbeta*E_t[lambda^p_{t+1}' * dc(t+1)/dy_t], andc(t+1)is the constraint block at regimer_{t+1}. Its lag block and its derivative with respect to a rival’s instrument are coefficients of the same date-t+1equation, so both belong atr_{t+1}. Only the first was.In the parser the cause was mechanical:
mpe_envelope_inject(create_optimal_policy_first_order_conditions.m) builds the cross term attand shifts it forward withlocal_lead, which rewrites time-tagged atoms only – the multiplier and the variables. A bare parameter carries no tag, so the shift walked past it and it stayed bound to the equation’s own regime. The fix tags it attbefore the shift, so the shift carries it tot+1with everything else.Measured against the defining property of a Markov-perfect Nash equilibrium – each player’s rule must be its best response to the rivals, which with the rivals substituted into the law of motion and the loss is an ordinary single-player Markov-switching regulator – on a two-player reduced-form switching game (exact answer 6.3e-12):
route
before
after
linear-quadratic
4.3e-05
5.5e-12
general (
mfi)4.3e-05
1.9e-12
and the two agree to 2.1e-10. When the rival’s coefficient does not switch the two readings coincide and nothing changes.
Cost. Only SWITCHING parameters are tagged, and only those appearing in
dc/du^rival, so the fix mints at most one auxiliary variable per such parameter and nothing otherwise. Measured:rf3(13 vars) unchanged,game_rf3p(18, three players) unchanged,game_2country(34, two regimes, switching Phillips slopes) unchanged; only the two fixtures whose rival coefficient actually switches grow, by 1 and 2 variables. Parse and solve times unchanged within noise.This also corrects an earlier entry which described the
r_treading as “settled by measurement”. What had been measured was which dating reproduced the general route, on the assumption that the general route was the reference – the assumption that needed testing. The equilibrium residual test is in the regression suite asmpe_br_residual.m.Unrelated but worth recording, since it was conflated with the above during diagnosis:
rise_1is not designed for regime switching, especially with switching in the dynamics or non-extreme transition probabilities, and scores 2.6e-03 on this test for that reason alone.Fixed: the mean-square-stability check was dead on the grand replanning loop.
+rise/+engine/+dsge_tools/+solve/solve.mswitchessolve_check_stabilityoff for the duration of that loop and restores it afterwards, but the post-loop call tois_stable_systemsat between the loop and the restore – andis_stable_system_enginereturns “stable” immediately whenever that flag is false. The check was therefore inert on every discretion, loose-commitment and stochastic-replanning solve routed through the loop, which reported retcode 0 on solutions its own test rejects.Found by diffing the two routes on a two-player game with a commitment regime. Both returned the same solution – 6.0e-08 apart, which is the general route’s own accuracy, and each satisfies the system defined by the other’s coefficients to 8e-09, so there was no multiplicity to choose between – and
is_stable_systemrejected it with a mean-square-stability radius of 2.19. Only the linear-quadratic route, which is checked on the ordinary path, said so.The restore now happens before the call. This is a behavior change: models previously reported as solved on that path may now return retcode 25. That is the correct answer for the solution returned – it is not mean-square stable – but it will look like a regression to anyone who has been relying on the silent pass. Retcode 25 does not prove that the calibration has no mean-square-stable equilibrium: another start can find one (
find_stable_solution).New: ``solver = ‘stochastic_replanning’``, a linear-quadratic solver for the stochastic-replanning problem (
+rise/+engine/+dsge_tools/+optimal_policy/replanning_solver_h.m). It is the loose-commitment engine with the scalargammareplaced by a per-regime commitment indicator read off the samecommitmentparameter, which changes three things. The transition matrix is unrestricted:loose_commitmentrequiresPr(commit next)to be identical from every regime and errors otherwise, becausegammais one number, so persistent and asymmetric replanning processes were previously out of reach. The commitment chain also need not be the only chain: everything is indexed by the composite regime, so any number of other Markov processes may switch the structural matrices, the loss weights or the shock loadings alongside it, with any number of states each. The reset lives in the equations rather than in a post-solve projection —GAM1(y,lamb)is gated by the indicator, so a replanning regime’s zero multiplier response falls out of the fixed point and the reportedTzis the fixed point, unlike underloose_commitment. And it remains available underno_u_turn, since like the loose-commitment engine it computes the derivative of the future policy function inside its own fixed point and never needs the discretionary (f1942) machinery that@no_u_turn = truedrops at parse time; on a model parsed that way with a persistent chain it is the only route that solves at all,loose_commitmentrefusing the chain and the general route refusing the missing derivatives.Validated against the general (parser + MSRE) route over the full reported solution, state columns and shock impacts alike: agreement to 1e-8 or better at
gamma = 1, atgamma = 0, on i.i.d. chains with0 < gamma < 1— whereloose_commitmentdisagrees with the general route by O(1), because it is solving the other problem — and on persistent chainsloose_commitmentcannot express. Indicatively around 50x faster than the general route on the test fixture, though that model is far too small to say anything about scaling.loose_commitmentis untouched and reproduces its previous solutions exactly. Weighting the policy-derivative channel by the probability that the successor replans, rather than by the current regime indicator, turns the new solver back into loose commitment — exactly, on the i.i.d. edge. That variant is deliberately not exposed, because off that edge it has nothing to be validated against.Fixed: the loose-commitment promise term used an average of forward matrices where the realized one is required (
+rise/+engine/+dsge_tools/+optimal_policy/solver_h.m).lambda_{t-1}enters the date-toptimality condition becausey_tsat in the lead term of the date-(t-1)constraint, so the promise term carries the forward block that constraint attached toy_t, de-weighted:Aplus{iota,r_t}/q(iota,r_t)withiota = r_{t-1}. The engine instead formedsum_j Aplus{r_t,j}, marked in the source as an approximation. The two coincide wheneverA+does not switch, which is why constant-coefficient loose commitment was never affected; they do not coincide once it switches. On a model with a lead-dated switching forward coefficient (a{t+1}*x{t+1}, i.e.A+_{ij} = q_ij*A+_j) the decision rules were off by about six percent against the general solver, at bothgamma = 1andgamma < 1; they now agree to solver tolerance. The required block is now computed from the assembled derivatives and, where it cannot be represented, the engine says so: with a current-dated switching coefficient (a*x{t+1}, the default reading, givingA+_{ij} = q_ij*A+_i) the promise matrix is indexed by the regime in which the promise was made, which a solution indexed by the current regime alone cannot carry; the historical approximation is kept and a warning names the general solver as the alternative. Models whoseA+does not switch, including both existing loose-commitment fixtures, reproduce their previous solutions bit for bit.Documented: loose commitment and stochastic replanning are different problems. They are not two solvers for one problem, and at
0 < gamma < 1they do not agree. Under loose commitment the probabilitygammathat the standing plan survives is a scalar (the re-optimization probability is1-gamma) and re-optimization is not a regime but a state value (lambda_{t-1} = 0), so one decision rule per structural regime suffices; under stochastic replanningcommitmentis a regime indicator with its own rule, and the chain may be persistent, endogenous or time-varying. Both carry the same future-policy derivative — thef1942hyperparameters are filled from the solution’s ownTz— and differ only in the scalar in front of it,1-gammaagainst1-commitment_t. Those coincide only atgamma = 0andgamma = 1, where the two routes agree exactly and each solution satisfies the other’s equilibrium conditions. See Optimal policy in the documentation for the full comparison and the measurements.Fixed: an empty shock horizon no longer collapses ``siz.nz`` (
+rise/+engine/+dsge_tools/+solve/rehash_topology.m). A model with no exogenous shocks has an emptyexogenous.shock_horizon, somax(shock_horizon(:))returns[]rather than0. Since scalar plus empty is empty in MATLAB, the augmented-state sizenz = np+nb+1+ne*(1+shock_horizon)silently evaluated to a 0x1 empty instead of a size, and so did anything computed from it downstream. The horizon is now normalized to a scalar zero before it enters any arithmetic, matching whatload_stochastic_solutionandset_simulation_initial_conditionsalready did. Only shock-free models are affected: when shocks exist the value is non-empty and the normalization does not fire, so every other path is byte-identical.``solve_prune_hank_constants``: exact pruning of the variables that are constant in the linearized model (new option, default
false; sideline development pending merge). A binary, parameter-free switch: the solver detects variables whose equations pin their first-order deviations at exactly zero at the evaluated steady state – canonically the rail-stuck HANK interpolation weights (saturated clamps), but also slack borrowing multipliers, pinned policies, and fixed aggregates; the mechanism is generic – removes them together with their defining equations by constant propagation on the evaluated Jacobians, solves the smaller system through the unchanged first-order machinery, and re-inflates the solution with exact-zero rows and columns. The answer is identical with the option on or off (measured IRF gaps 1e-13..1e-10 across the HANK replication suite); only the cost of solving it changes. The reduction is on the SYSTEM and happens ahead of whichever solver runs – a direct decomposition for a constant-parameter model, the iterative MSRE solvers under regime switching – so it is tied to no particular solution method. Under regime switching only variables trivial in every regime pair, at equal steady-state levels, are removed. If the reduction would not be square it refuses loudly and solves the full system. The option is HANK-named because that is where it is validated: the detector itself is model-agnostic, and it has been exercised across the model suite including models with no heterogeneity. (+rise/+engine/+dsge_tools/+solve/{condense_ first_order,inflate_first_order}.m, hook infirst_order.m.) Applies at first order only; higher orders continue to run at full dimension on the inflatedTz.Stability check: inert states dropped before the Kronecker build (
+rise/+engine/+dsge_tools/+stability/is_stable_system.m), gated onsolve_prune_hank_constants. States whose transition rows are exactly zero in every regime and solution are identically-zero directions; mean-square stability is invariant to removing them, and the Kronecker build is quadratic in the state count. This makes the MSS check feasible for pruned heterogeneous-agent models under regime switching: the 2-regime Auclert HANK previously ran out of memory ingupta_murray_hassibi; withsolve_prune_hank_constantsit now checks clean in seconds. Gated rather than unconditional so that every path not asking for pruning stays byte-identical – without pruning an inert direction carries solver round-off (~1e-8) rather than an exact zero, so the scan would cost a pass and find nothing.HANK: ``span`` declarations are now guarded, twice. A
span = sbracket window is an assertion about where the savings policy lands, and its validity depends on the parameterization – so it is now checked machine-side instead of trusted. (1) The steady-state engine measures the landing distanced(i,j) = |b*(i,j) - i|at every solve on the full grid (out.landing:dmax,min_safe_span, per-celld), so the safesis handed to the user for free rather than guessed; if a declared span is violated at the current parameter values the engine stops with a hard error (het:engine:spanViolated) naming the violation and the minimal safe declaration – the span-pruned model would be well-formed and could solve cleanly to a wrong steady state, so nothing downstream would catch it. (2) The parser now rejectsspan = 0(and non-integer or negative spans) with a clear message (hank_expand:span); previously it crashed with a raw index error, since brackets run1..N-1and the top cell’s window would be empty. Validated in a dedicated experiment: span-free andspan=1Auclert steady states identical to 1e-12; a uniform grid plus deep impatience (beta=0.60) trips the guard with “lands up to 3 brackets away (10 of 20 cells); minimal safe span=4”.HANK: generic steady-state engine (
+rise/+engine/+dsge_tools/+sstate/+het/{engine,steady_state}.m, new). A nested solver for the heterogeneous block, driven entirely by the parsed heterogeneity context: household policy by time iteration (all grid cells solved simultaneously by a vectorized Newton, Fischer-Burmeister at the borrowing constraint), cross-section by Young (2010) forward iteration, aggregation through the model’s@Aggdefinitions, wrapped in a damped price/aggregate fixed point (spec.pricesclosure) and an outer Broyden calibration (free parameters against named or function-handle targets;free = {}for pure fixed-point models a la Krusell-Smith). Validated against three independent hand-rolled steady states: Auclert et al. one-asset (all ten digits, full and span-pruned variants), McKay- Nakamura-Steinsson (1e-12 on every calibrated value), Krusell-Smith (imposed residual 5.6e-12 over the full expanded system), and Bayer-Luetticke (5,625 equations, borrowing to -100, entrepreneur via a bin indicator; imposed residual 1e-12, ~30x faster than the reference solver). Hardened for that last class: a guarded power (het_pow; negative exponents floor the base at 1e-12 – the reference solvers’ marginal-utility convention, inert on interior solutions) so “dead” grid cells with infeasibly negative consumption stay real; NaN-loud convergence tests (MATLAB’s max ignores NaN, which had let a poisoned solve report success); per-cell monotone backtracking; and a Broyden that never commits a non-finite step near an asset-demand asymptote.HANK parser: correctness fixes and new constructs (
hank_expand.m):Individual leads on the left-hand side are now expanded correctly. Previously a lead written on the LHS (e.g.
beta*Va{t+1} = ...) was silently renamed to the own-cell next-period variable – no idiosyncratic expectation, no policy interpolation – and solved a different model. Both sides now go through one expansion path; lead-free sides reduce to the old rename byte-for-byte.@Aggaccepts nested parentheses (@Agg(c{t}^(-sigma))); the argument is scanned to its matching close paren. Leads/lags inside@Aggare rejected at parse time (previously mis-expanded silently).Bin indicators
<axis>_at_<j>resolve at expansion time to literal 0/1 by grid position – addressing a bin by position where the bare coordinate only carries its value (per-type income, e.g. the Bayer-Luetticke entrepreneur). Out-of-range indices are parse errors.Bracket window
@heterogeneity_axis(a, N, policy = ap, span = s)limits the live interpolation weights tosbrackets either side of each cell, cutting the expansion from O(N^2) to O(N) endogenous variables (measured: 7692 -> 1420 at N = 60). A window covering the grid reproduces the default expansion byte-identically.The parsed heterogeneity context (axes, cells, name maps, raw equation classification) is persisted to
model_data.heterogeneity; it is[]for models without heterogeneity constructs.
DSMH merged and corrected: ``rise_dsmh`` + ``rise_dsmh2`` are now one sampler (
classes/stats/mcmc/rise_dsmh.m;rise_dsmh2is REMOVED – its option names carry over unchanged, so a caller just renames the function). The merged implementation keeps the usrsmplr-compatible interface and fixes/adds the following:Striated-move acceptance is now the equi-energy ratio. The old
rise_dsmh2accepted a resample from the previous stage’s energy band with the plain tempered ratioexp(lambda_i * dlogp), although the proposal is drawn from the PREVIOUS tempered target restricted to the shared striation; the correct Hastings ratio isexp((lambda_i - lambda_{i-1}) * dell)(Kou-Zhou-Wong 2006 / Waggoner-Wu-Zha 2014). Wrong occupancy shares on multimodal targets under the old ratio. Striated jumps now also recycle the stored posterior values, so they cost zero new evaluations.Out-of-bounds proposals are rejected, never clamped (same defect fixed for rwmh/imh/apt on 2026-07-05): with
lb/ubsupplied, the raw proposal is tested BEFORE the frame is applied, which is exact MH on the bound-truncated target even when a legacy clamping frame is passed in.Covariance adaptation stores the lower Cholesky factor. Both old files assigned the upper
cholfactor to the variable used as a lower factor, so the adapted proposal had the right spectrum but a rotated orientation (efficiency loss only – the proposal stays symmetric, so no bias;rise_dramhad the same quirk and is fixed too). Between stages the scalar scale now also adapts toward a 0.234 acceptance target.Likelihood tempering (
logprioroption): the ladder tempers the likelihood only and the prior enters every stage untempered – the Waggoner-Wu-Zha construction; the default remains posterior tempering. The default ladder is now geometric(i/H)^psi(psi = 4, dense near lambda = 0) instead of uniform.Stepping-stone marginal-data-density by-product (
extras.log_mdd): with a lambda = 0 anchor (iid uniform-box draws givenlb/ubunder posterior tempering, or iid prior draws viaprior_samplerunder likelihood tempering) the ladder’s normalizing-constant increments are accumulated into a log-MDD estimate at no extra sampling cost beyond the anchor stage. Each increment is estimated two-sided (forward from the lower rung’s draws, reverse from the upper rung’s, averaged in the log domain), which cancels the leading-order Jensen bias of one-sided stepping-stone estimation.Exact checkpoint/resume (
stop_after_sweeps/stateoptions): the full sampler state including the RNG is returned and can be passed back; a resumed run reproduces the uninterrupted run draw for draw.burnin, previously ignored by both implementations, is now a per-stage burn-in.
All of it is locked by the new suite
RISE-unit-tests/infrastructure/samplers/mcmc/DsmhCorrectnessTest.m(analytic-moment targets, a mode-on-the-bound target with a clamping frame, a 0.7/0.3 bimodal mixture started in the minor mode with a plain-MH control, analytic-evidence checks for both tempering modes, and a draw-for-draw resume test).Fix: ``rise_dram`` adapted proposal used the upper Cholesky factor (same orientation quirk as item 3 above; efficiency, not bias). The adaptation now stores the lower factor, and the delayed-rejection correction
iLis consistent with it.Performance: ``rise_dates.dates`` arithmetic vectorized (
@dates/dateshift,@dates/double).dateshift(called byplus/minus/colon) anddoublelooped element-by-element, invoking MATLAB’s already-vectorizeddatetimedateshift/datenumonce per element. They now batch the underlyingdatetimecall over the whole array. Results are bit-identical across all frequencies (D/W/M/Q/H/Y; char, serial,+,-all verified against the prior implementation) and the 234-testinfrastructure/time_seriesarea stays fully green. Measured ~3.6x faster on a monthly range build +doubleand ~2.7x on a quarterlycolon. First cut of a broader effort to keep dates/time-series off the estimation hot path (the per-evaluation likelihood loop is already double/struct-only; the remaining date cost is one-time data assembly and filter-output serialization).Fix: stochastic regime draws in simulation restored (regression introduced 2026-06-12 by
45255f15, which made the OBC constrained likelihood deterministic by selecting the modal next regime incompute_transition– correct for reproducible mode-finding, but the routine is shared with plain simulation viaforecast_unconstrained, sosimulate()paths silently froze in their initial regime whenever chains are persistent). Regime transitions in simulation are drawn from the transition matrix again. Design: stochastic is now the DEFAULT semantics ofcompute_transition; the constrained/violation-check forecasts (forecast_with_constraints,forecast_with_constraints_functional) explicitly opt out (stochastic=false) to keep the OBC likelihood bit-reproducible (verified). New optionsimul_stochastic_regimes(defaulttrue) lets a user reproduce the deterministic modal path in simulation if desired. Note: GIRFs again average over stochastic regime futures, the textbook definition.Fix: numeric ``simul_regime`` honored again. The documented scalar/vector forms of
simul_regime(impose a regime path in simulation) were silently dropped (simul.load_optionsonly handled the function-handle/switch-rule forms;set_simulation_regimeshad become orphaned). A numeric path is now expanded inset_simulation_initial_conditionsand overrides the regime draw; imposed paths are reproduced exactly.Exact (Durbin-Koopman) diffuse initialization for the Kalman filters, selected by
kf_init_variance='exact'(the same option that takes[]for the unconditional/Lyapunov default or a positive scalar for Harvey big-kappa – exact is a third value there, not a separate option). The diffuse directions are resolved in a short exact diffuse phase, so the likelihood is kappa-free – it drops the spurious-q/2*log(2*pi*kappa)offset that big-kappa carries and that contaminates MLE, marginal data density and model comparison.initialization.mbuildsP_infon the nonstationary (unit-root) subspace of the state transition;imm.mruns a guarded two-covariance diffuse phase; single-regimeexactmodels are routed toimm, so it works for constant-parameter and regime-switching models alike, and pinning a non-immfilter withexactwarns. The default big-kappa path is unchanged (filtering 47/47, obc 23/23). Validatedll_exact = ll_bigk + q/2 log(kappa)at O(1/kappa). See the “Diffuse initialization” docs page and theEstimation/diffuse_initializationtutorial. Exact diffuse is available inimm(default) and in the GPB-family filtersimmn,kim_nelsonandgpbn(pin viakf_user_algo); all four give the same diffuse loglik. Pinning a filter that does not implement it (imm_o, the constrained cell filter) warns and falls back to big-kappa. The diffuse subspace is now the nonstationary invariant subspace (ordered real Schur), correct for multiple and defective unit roots – e.g. a local linear trend ([1 1;0 1]Jordan block, 2-D diffuse subspace, one eigenvector) – not just a random walk;P_infis carried through the filter’s state-space augmentation. Validated across all four filters on random-walk (q=1) and local-linear-trend (q=2) models (testDiffuseInit, 12 cases); default big-kappa path unchanged (GPB suite 13/13). Two guards keep exact diffuse within its valid scope (the regular, regime-invariant diffuse block): if the nonstationary invariant subspace differs across regimes (regime-DEPENDENT diffuse block), or if measurement noiseHis non-diagonal (the univariate diffuse cascade assumes diagonalH),initialization.mwarns and falls back to big-kappa rather than compute a silently-wrong likelihood. Exact-diffuse smoothing is wired into all four filters (imm, immn, kim_nelson, gpbn): the forward pass stores the predictedP_inffor the diffuse steps and the smoother (utils.filtering.gpbn.smootherfor imm/immn/gpbn,utils.filtering.smootherfor kim_nelson) runs a Durbin-Koopman dual-accumulator (r0,``r1``) backward recursion over the diffuse span, so smoothed states over the firstdperiods are exact (previously they were degraded). Guarded: the branch fires only whenP_infstorage is present, so every non-diffuse smoother is byte-identical.simple_kalman_stepnow returns the predictedP_infand the real diffuse-phase innovation. Validated: smoothed states match big-kappa at O(1/kappa) for all four filters (local linear trend, q=2);testDiffuseInit16/16.The default regime-switching filter is now the Interacting Multiple Model (IMM) algorithm (Blom-Bar-Shalom), replacing
constrained_regime_switching_kalman_filter_cellfor order-1 switching models. IMM’s mixing is more general than the Kim-Nelson collapse the old default used. To reach parity, the two features the old filter had andimmlacked were ported intoimmvia new shared helpers so any switching filter can reuse them:rise.engine.filtering.filter_exo_driver(the observed-exogenous time-varying-transition driver, threaded intoevaluate_filter_transition_matrix) andrise.engine.filtering.filter_cond_data(the real-time / observed-expectations conditioning slice, passed as the predict closure’s 5th argument).immalso now readsdata_ywith future pages and the real-timesystfields. Filtering, OBC, regime-switching, estimation (MLE) and reference-comparison suites are all green under the new default. The GPB-family filters (gpbn,imm_o,immn,kim_nelson) can adopt the same two helpers to gain these features. The previous filter remains available viakf_user_algo.Leads greater than one are now reduced without violating Jensen’s inequality – everywhere, by default. The parser’s lead reduction previously chose between two mechanisms via the
violate_jensen_inequalityoption: the default atomic chain (fast, butE[g(x)] -> g(E[x])for nonlinear leads) or a whole-equation backshift that closed each reduced equation with a martingale rowAUX{t+1}=0. The backshift was Jensen-correct but its martingale row has no contemporaneous variable, makingA0singular and breaking iterative solvers (cyclic reduction; themfioptimal-policy iteration) – so it could never be the default. Both are replaced by a single term-scoped reduction (get_rid_of_excess_leads_preserving_jensen): a term that is NONLINEAR in a forward variable is wrapped in an auxiliaryz{t}=shift(term,-1)and replaced byz{+1}(carrying the whole term’s one-period-ahead conditional expectation,E[g(x)]), while AFFINE leads use the ordinary atomic chain (chain_excess_leads). Every auxiliary keeps a contemporaneous variable, soA0stays non-singular. A recursive-descent classifier decides linearity; a lead scaled by a quantity known attstays affine, a lead inside a function/power or multiplied by another forward is wrapped. Models with no nonlinear leads (all linear models, and derived optimal-policy FOCs such as fm95) are reduced byte-for-byte as before. Theviolate_jensen_inequalityoption and the backshift reduction are removed. Full suite green (1004 tests), including the ten lead/lag regressions the backshift used to break. Details and the closed-formsigma^2derivation:development/jensen_memo/jensen_inequality.pdf.New ``rise.microfound`` – write the economics, not the algebra. A model definition builder: declare the atoms and each agent’s optimization problem (period objective, choice variables, named constraints) in MATLAB, and it derives the first-order conditions symbolically and produces a plain RISE model – no
@optimization_problemblock, nothing hidden. The derivation reuses the FOC engine’s beta-weighted differentiate-then-shift assembly via new shared primitivesrise.engine.foc.{change_symbols,symbolic_differentiate, attach_lagrange_multipliers}(byte-for-byte extracted from the optimal-policy engine). Hand the builder todsge_modelthree ways:dsge_model(p),dsge_model(code(p)), or write a.rswithrs(p,file). microfound builds the DEFINITION only – calibration (solve(m,'parameters',struct)) and solving aredsge_model’s responsibility. Derived multipliers are named<agent>_lambda_<constraint>. Switching parameters in an agent’s problem yield correct probability-weighted switching FOCs automatically. IMPORTANT: the steady state is NOT provided analytically (that would mean hand-deriving what the tool automates) –dsge_modelforms the steady-state system from the derived FOCs and solves it numerically;steady_state(...)supplies only a rough initial guess. Validated by re-authoring 9 standard example models (rbc, rbc_hf, rbc_cu, rbc_ts, rbc_ic, home_production, rbc_mc with household-SDF discounting, tc_rs two-country risk sharing, ttb time-to-build) – all derive and solve, and rbc_ts matches the reference steady state derived for it independently of RISE. Seeexamples/microfound/. A companion pre-pass auto-reduces lags > 1 before the FOCs (a control at lag k becomes a chain of co-state auxiliary controls with identity constraints; a non-control variable becomes auxiliary endogenous with model identities) so no manual auxiliary chain is needed – e.g. a 2-period time-to-buildK = (1-delta)*K{-1} + I{-2}derives and solves directly. Leads >= 2 in an agent constraint are reduced by a Jensen-preserving subexpression aux: an additive termTat lead >= 2 becomesz{+1}with the identityz = shift(T,-1), sozcarries the WHOLE (possibly nonlinear) term’s one-period-ahead conditional expectation (E[g(x)], notg(E[x])) and the constraint keeps its date (its multiplier coupling intact). Verified to reproduce the direct FOC(1/beta^2)*lambda_{t-2}*(dg/dx)exactly, and a nonlinear lead-2 model at second order matches the analytic Jensen gapexp(0.5*sig^2)(unit testmodels/dsge/microfound/testMicrofoundJensen). A time-varying (stochastic) discount factor is handled correctly: the backward multiplier weight uses the LAGGED one-period discount1/SDF_{t-1,t}(for a constant discount this equals1/beta, so the planner path is unchanged). HANK heterogeneity, Kuhn-Tucker inequality constraints, recursive (Epstein-Zin) preferences, and index-set templates are planned extensions.``fix_point_iterator`` now speaks plain MATLAB option names internally – the last ``fix_point_*`` names are gone. The shared fixed-point engine used to rename incoming options to internal
fix_point_TolFun/fix_point_maxiter/fix_point_verbose/fix_point_explosion_limit/fix_point_valid_funcfields. It now reads plain names directly:TolFun,MaxIter,Display('iter'``|’none’|’final’, with the optimset ``'off'and a logical still accepted for back-compat),ObjectiveLimit,ValidFunc. Behavior at every call site is unchanged (the options structs already carried the plain names); the internalupdate_fix_point_optionsrename step is removed. Callers that constructedfix_point_*fields (the Maih-Waggonerupdate_options, the LyapunovdoublingFixIter) and the solver unit tests were updated to the plain names. Verified: solvers_generic 195/195, steady-state 262/262, and the Kalman/Lyapunov path (filter) unchanged.New MSRE solver ``mafia`` – Multisecant-Accelerated Functional Iteration Algorithm. The Picard iteration behind
mficonverges only on a contractive fixed-point map; on a genuinely non-contractive map (one Jacobian eigenvalue > 1) it diverges, returning retcode 21, even where a stable solution exists andmnk/mn/fwzfind it.mafia(solve(m,'solver','mafia')) iterates the SAME map asmfi– so it keepsmfi’s tendency to land on the stable minimum-state-variable solution rather than an explosive one – but accelerates it with self-tuning windowed Anderson acceleration (a multisecant/quasi-Newton scheme using only evaluations of the map, no Jacobian, with QR condition-based regularization and a non-monotone-bounded safeguard). It has NO tuning knobs: one fixed configuration converges the easy-contracting, non-contractive and slow/ill-conditioned regimes alike, so it can be pointed at estimation and adapt per parameter draw without the caller knowing which regime each draw is in. Onfin_frics_switch(Picard-map spectral radius 1.0163) plainmfireturns retcode 21 whilemafiarecovers themnksolution to ~1e-7, and it is faster thanmfion the mapsmfialready solves.mfiandfix_point_iteratorare unchanged (byte-for-byte). Theory and the parameter-free three-regime validation:development/MFI_Anderson_Acceleration_Note.pdf,development/ADAPTIVE_AFI_VALIDATION.md; regression:RISE-unit-tests/.../solvers_generic/testMafiaSolver.m.New option ``sstate_warm_start`` (default ``false``): warm-start the numerical steady-state solve from the last successful solution. Profiling shows the numerical steady-state search (
rise.engine.rstst.solve_blocks) is 42-69% of every model re-solve, and estimation re-solves the steady state from scratch on every draw even though successive draws are ~0.1% apart in parameter space. Withsstate_warm_start=true, the search is seeded with the last successful steady state of the same model (persistent cache keyed by a stable model fingerprint — the object itself is re-created per draw); the current draw’s parameters always prevail, and a failed warm-started solve is automatically retried once from the cold default, so a stale cache entry can never make a solvable draw fail. With a unique steady state the warm and cold solves land on the same solution (verified to <1e-8 in the tests). Measured on 20 jittered re-solves (MCMC-like): fs2000 solves 2.2x faster end-to-end (order 2); models whose cold default already sits at the steady state (e.g. linear switching models with a zero steady state) see no change. Reset the cache withrise.engine.rstst.warm_start_cache('clear'). Default OFF: behavior is unchanged unless the option is set.Retired the global ``fix_point_*`` options (
fix_point_TolFun,fix_point_maxiter,fix_point_verbose,fix_point_explosion_limit,fix_point_valid_func). These were a single shared knob that silently affected every consumer of the internal fixed-point iterator (MSRE solvers, optimal policy, Lyapunov doubling, linear-systems solves, the mdd bridge sampler, …). Each call site now reads its own scoped option with unchanged defaults: the solver options cell (solver={'mfi','MaxIter',...,'TolFun',...};Display='iter'replacesfix_point_verbose),sstate_solver{2},solve_linsyst_solver{2},lyapunov_algo{2}, andmdd_bridge_TolFun/mdd_bridge_maxiterfor the bridge sampler. The discretion iteration cap issolve_discretion_maxiter. Passing afix_point_*option now errors as an unknown option.MCMC correctness fixes (three defects) + a procedural-correctness test suite. An audit of the sampling machinery for algorithmic correctness (acceptance ratios, proposal corrections, bounds handling, sign conventions) found and fixed three defects:
Independence MH drew from the wrong distribution.
one_step_mh(and the delayed-acceptance variant) proposed from a random walk centered at the current state while the acceptance ratio applied the independence-sampler density correction with the fixed proposal mean — the chain’s stationary distribution waspi(x)/q(x)instead ofpi(x)(inflated tails). IMH now draws from the fixed proposal distribution, as the correction assumes.Out-of-bounds proposals were clamped, not rejected. RWMH/IMH/APT proposals were clamped onto
[lb, ub]by the recentering frame and evaluated there, while the acceptance ratio assumed a symmetric, uncorrected proposal — piling probability mass on active bounds. Proposals now use a constraints-only frame (reframestyle 0) and out-of-bounds draws are rejected in the accept/reject step, which is exact MH on the bound-truncated target. Behavior is unchanged when the bounds do not bind (identical RNG stream, no redraws).DRAM’s delayed-rejection stage used a mis-scaled proposal density. In
rise_dram, the second-stage acceptance’sq_ratioomitted the1/adascale^2scaling of the first-stage proposal covariance, so the DR acceptance probability was wrong wheneveradascale ~= 1(the default is2.38/sqrt(d)).
All three are locked by the new suite
RISE-unit-tests/infrastructure/samplers/mcmc/McmcCorrectnessTest.m, which checks each sampler (RWMH, IMH, APT, slice, DRAM with the DR branch actually enabled, shortcut wrappers) against targets with analytic moments, including a target whose mode sits ON a bound.New option: ``sstate_file_is_authoritative`` (default ``false``). When a user-supplied steady-state file (or steady-state model) returns a nonzero retcode — “no solution for these parameters” — the engine used to ignore the verdict and fall through to the full numerical steady-state search, a 1-10 s tax per bad draw during MCMC estimation. With the option set to
true, the file’s verdict is trusted: its retcode propagates immediately and the numerical search is skipped. A large residual with a zero file retcode still triggers the numerical search as before. On thesstate_looppath the verdict is checked at the initial loop point only. Defaultfalsepreserves the previous behavior exactly.New: ``texreport(m)`` — paper-ready LaTeX model appendix (headliner 4, slice 2). One command writes a compilable
.tex(or an\input-ready fragment): the model equations rendered as mathematics by a new RISE-to-LaTeX translator (rise.engine.reporting.eq2tex— a recursive-descent parser emitting\fracfor divisions, braced powers, operator names for known functions, time subscriptsx_{t+1}from the{t+1}/{+1}forms,\bar{x}for{stst}, and greek symbols via the model’s tex names or a built-in table), plus calibration and steady-state tables per regime (booktabs). Auxiliary LEAD_/LAG_ equations omitted by default; translation failures fall back to verbatim rather than dying; multiple parameterizations are sliced into one appendix each;'compile', trueruns pdflatex. Unit-tested down to exact translator strings, all 16 fs2000 equations translate with balanced groups, and the compile test produces a real PDF.New: ``webreport(m)`` — a self-contained interactive HTML model report. One command produces ONE file — no external assets, no server, opens offline in any modern browser, shareable with coauthors who do not have MATLAB. Tabs: overview (regimes, solver, root moduli for constant-parameter models), the model equations, calibration and steady state per regime, an interactive IRF explorer (shock selector, variable picker, one panel per variable with the regimes as series, crosshair hover reading out every regime at the hovered horizon, regime legend and end-of-line labels), and a data-table tab carrying every plotted number. Light and dark mode follow the system preference; charts use a colorblind-validated palette. Engine:
@rise_model/webreport.m+ the template in+rise/+engine/+reporting/webreport_template.html; numbers are embedded as JSON inside the file. First slice of wahoo headliner 4 — posterior/estimation panels and a LaTeX model-appendix export are the planned follow-ups.Failure diagnosis phase D5 — the return-code registry now speaks. The terse registry messages behind
decipherwere rewritten to state the cause and the next step:'System unstable'became “No mean-square-stable solution: the switching system’s second moments explode under the regime process (this is the MSS test, not an eigenvalue count) — run diagnose(m) for the MSS radius and the culprit regime”;'Explosive solution','Nans in solution or no solution', the steady-state and simulation codes similarly. Codes, names and categories are unchanged — only the human-facing text. A Failure diagnosis chapter joins the docs (Working with a model) and a runnable tutorial joins rise-modern-tutorials (three deliberately broken models, the homotopy stall-as-diagnosis, and the MSS-vs-conditional-explosiveness lesson).New: failure diagnosis phase D4b — perfect-foresight shock-size continuation. A new
simul_homotopyoption (default false): when the stacked perfect-foresight solve fails at the full shock size, the exogenous path is walked up from zero (adaptive step, each trial warm-starting the free endogenous cells from the previous step’s path; initial/terminal conditions untouched), so the full-size problem is approached from a nearby solution instead of the steady-state guess it just failed from. If even the ladder stalls, the reached share of the shock size is reported (“solvable up to 60% of the shock size”), surfaced throughdiagnostics_on_failure. It localizes the failure; it does not prove that no bounded path exists at full size, since the ladder follows one path and can stop at a fold. Inner ladder trials keep their per-step diagnostics silent. Also fixes an edge case in the D3 worst-cell analyzer when every period’s residual is non-finite. Honest test note: the mechanism is verified by traced runs and a no-interference test; a genuine cold-failure integration fixture is still missing because the stacked Newton solves the available smooth models even at absurd shock sizes.New: failure diagnosis phase D2 — the stability analyzer, with the right vocabulary per model class. When the solve fails,
diagnose(m)now explains why in the language that applies: for CONSTANT-PARAMETER models, Blanchard-Kahn root counting — “6 stable roots but only 5 predetermined variables: indeterminacy”, with the root table (the failed solve now retains its eigenvalues for exactly this purpose) and a clearly-labeled Taylor-principle heuristic; for REGIME-SWITCHING models, MEAN-SQUARE STABILITY only — the MSS spectral radius vs the criterion, per-regime conditional radii and persistence, and the culprit regime (“regime 2 is conditionally explosive and too persistent”) — never an eigenvalue count. Iterative MSRE solver failures (no convergence / NaNs / divergence) get their own narrative with solver alternatives. Engine:rise.engine.diagnose.stability;model_datagains a template-declareddiagnosticsfield (keeps struct arrays homogeneous under estimation).New: failure diagnosis phases D3+D4a — no more silent NaNs, and a homotopy fix-action.
The silent-NaN era ends. A diverging simulation used to return a NaN-filled database without a word. Now the failure site reports the first non-finite value — period, variable(s), regime — the growth profile of the run-up, and the pruning hint when running above order 1 unpruned (
rise.engine.diagnose.simulation). A newdiagnostics_on_failureoption ({‘warn’} | ‘error’ | ‘off’) governs surfacing everywhere; ‘off’ restores the legacy silence.Perfect-foresight worst cells. When the stacked solver fails to converge, the stacked residual at its final iterate is reshaped to (equation x period) and the worst violations are reported, plus the periods carrying 80% of the residual mass — localizing the failure to, say, “equation 3 around periods 12–15” instead of “did not converge” (
rise.engine.diagnose.perfect_foresight_stack; the existingmultiplicity_diagnosticis suggested for uniqueness questions).Homotopy fix-action. Every successful steady-state solve now remembers its calibration;
[report, mfixed] = diagnose(m, 'fix', "homotopy")walks the parameters gradually from that last working calibration to the failing target, warm-starting each step from the previous solution (with a cold fallback when a warm start is unusable, e.g. a log variable whose steady state went non-positive). On success the model comes back solved at the target; on stall the report gives the breakpoint (“stalled at 47% of the way”) and the model is returned solved at the breakpoint mix for inspection. The breakpoint localizes the failure; it does not prove that the target calibration has no steady state.
New: ``diagnose(m)`` — failure diagnosis, phase 1 (steady state). The first slice of the failure-diagnosis suite (
development/FAILURE_DIAGNOSIS_MEMO.md): instead of a bareSteady state could not solve,diagnose(m)reports the worst equations (per-equation residuals against the engine’s 1e-6 acceptance floor, labeled by equation tag or the equation text itself), the variables and parameters entering them, a structural-rank check of the steady-state incidence (a declared-but-never-used variable is named outright), and concrete next steps. Diffuse failures (most equations above the floor) are called out as such — one global culprit is more likely than the top-ranked equations — rather than overattributed. When the steady state is fine but the solve fails, the deciphered return code is surfaced with model-class-aware stability language (eigenvalue/Blanchard-Kahn reasoning only for constant-parameter models; mean-square stability for regime-switching ones); the full stability analyzer is the next phase. Engine:rise.engine.diagnose.steady_state.Fix: ``load_solution`` errored when called with a model object.
rise.engine.dsge_tools.solve.load_solutiondocuments that it accepts a model object or amodel_datastruct, but it readobj.topology(and, further down,obj.exogenous) — fields the class facade does not forward as dependent properties — so a direct call on adsge_modelerrored. The function now normalizes a model object to itsmodel_dataafter the solve step; both calling conventions are regression-tested and deliver identical solutions.New: unified ``sensitivity()`` front-end — one design, three GSA views. A
sensitivitymethod on all model classes (engine:rise.engine.surrogates.sensitivity_report) runs the whole global-sensitivity toolbox on ONE evaluated design: analytic PCE-Sobol’ main/total indices (who drives the variance of the log posterior over the prior), HDMR first-order indices from an independently fitted metamodel on the same design (a built-in cross-check, validated against analytic benchmarks), and Monte-Carlo filtering (who decides whether a draw lands in the top region of the target, measured by per-parameter Kolmogorov-Smirnov separation with asymptotic p-values — the fullmcfobject is returned for its plots). Everything lands in one table; HDMR/MCF recycle the emulation design rather than sampling again. Note: only HDMR’s first-order column is reported — the legacy engine’s level-2+ aggregates were found to carry systematic leakage/overcounting at realistic sample sizes (e.g. reading 0.24 on a null pair, 1.19 on a pure pair with share 1.0); investigating that estimator is left as a follow-up, and interaction/total readings come from the PCE columns.New: adaptive surrogate tools — refinement, EGO mode finding, active subspaces. Three tools close the surrogate lifecycle on the same
fit/predictcontract.refine(s, f, nadd)adds true evaluations where the emulator is least sure (the GP’s pointwise sd; space-filling for the PCE) and refits in rounds.rise.engine.surrogates.ei_maximizeruns the classic EGO loop (Jones-Schonlau-Welch expected improvement) to locate the optimum of an expensive function — e.g. a posterior mode — in a few dozen true evaluations (finds the Branin optimum within a 60-evaluation budget in the test suite), returning the fitted GP for reuse as a delayed-acceptance screen.active_subspace(s)estimates the gradient-covariance eigendecomposition under the prior with gradients taken on the surrogate (zero additional true evaluations), exposing the few linear parameter combinations the posterior actually responds to, plus per-parameter activity scores.New: Gaussian-process (Kriging) emulator with model-based pointwise uncertainty.
emulate(m, 'method', "gp")— the second emulator on the samefit/predictsurrogate contract. Detrended (universal) Kriging: a polynomial mean (trendoption;emulateuses"quadratic", the natural shape of a log posterior) plus an anisotropic squared-exponential GP on the residuals, inputs standardized by the design data (robust to fat-tailed priors whose mass is a sliver of the bound box), hyperparameters by marginal likelihood with restarts, analytic leave-one-outQ2diagnostics. Unlike the PCE’s single global uncertainty number,predict’s second output is pointwise: small near design points, growing away from them — the ingredient for adaptive designs and surrogate-guided optimization. Onfs2000:Q2~0.92 from 135 design points (order-2 PCE: ~0.81 from 165). No analytic Sobol’ (use the PCE for sensitivity); both emulators work as delayed-acceptance screens.New: chain checkpointing and resume for the MH samplers.
rwmhandimhacceptstore_file/store_every/resume: the complete chain state (draws, current position, rng state, adaptive-tuning state, and the delayed-acceptance surrogate value when active) is checkpointed atomically to MAT v7.3 (HDF5), so long runs survive crashes. Resuming restores the rng and tuning states exactly, making the continued chain bit-for-bit identical to the uninterrupted one (unit-tested); a completed run can be extended by resuming with a largerN. Withnchain > 1a per-chain suffix is appended.apt/slicereject the option explicitly.New: delayed-acceptance MCMC — exact posterior at a fraction of the true-likelihood cost. The Metropolis-Hastings samplers (
rwmh,imh) gained ada_surrogateproperty: every proposal is first screened with a cheap surrogate of the log posterior (e.g.@(x)predict(s,x)fromemulate); only survivors pay for a true posterior evaluation, and a second accept/reject step (Christen & Fox, 2005) keeps the chain’s stationary distribution exactly the true posterior — a poor surrogate costs acceptance rate, never correctness (unit-tested with a deliberately biased surrogate). Composes with the existing adaptive tuning and constraint machinery, andstats.funevalsreports the true evaluations actually paid for. Onfs2000, ~70% of iterations are settled by the screen and wall time drops ~3x with indistinguishable posteriors. A surrogate that fails at the chain’s initial point disables the screen for that chain (with a warning) instead of freezing it; theaptandslicesamplers reject the option explicitly. Example:rise-modern-tutorials/Estimation/surrogate_accelerated_mcmc/howto.m; docs: the Surrogates page. Phase 1b of the surrogate-accelerated-estimation roadmap.New: surrogate (emulator) layer — polynomial chaos with analytic Sobol’ indices. A new
rise.engine.surrogatespackage (pce,doe, abstractsurrogatecontract) plus anemulatemethod on all model classes. One call —[s, design] = emulate(m)— fits a polynomial-chaos expansion of the log posterior kernel (or of any user function of the parameters) from a few hundred true evaluations; afterwardspredict(s, theta)approximates it in microseconds (~1500x per evaluation onfs2000). The polynomial basis is derived per parameter from its prior (Hermite for normal priors, cdf-transformed Legendre otherwise), the design of experiments is drawn from the priors’ inverse cdfs, and — because the basis is orthonormal under the prior, the product of the parameters’ independent priors (the components of a dirichlet block are treated as independent uniforms on their bounds) —sobol(s)returns the exact variance decomposition of the fitted expansion (main and total Sobol’ indices) analytically from its coefficients, with no additional sampling. Leave-one-out cross-validatedQ2and hold-out validation helpers included. Example:rise-modern-tutorials/GSAandUQ/UQ_surrogates/howto.m; docs: the Surrogates page of the GSA/UQ chapter. This is Phase 1a of the surrogate-accelerated-estimation roadmap (development/WAHOO_ROADMAP.md); delayed-acceptance MCMC and a Gaussian-process emulator on the same contract come next.Perfect-foresight solver: faster and more robust. The deterministic (
perfect_foresight) solver gained several improvements, all behavior-preserving at their defaults:the default
sparsesolver (rise_newton) now judges convergence on the max-abs (infinity-norm) residual instead of the 2-norm. The 2-norm of a stacked residual grows likesqrt(periods*endo_nbr), so a fixed tolerance was unreachable for long horizons even when every equation residual was tiny; the max-abs criterion is per-equation and size-independent.a new ``JacobianUpdate`` option on the
sparsesolver enables modified-Newton factorization reuse: factorize the stacked Jacobian once and reuse the LU factors (inf), or refresh everyKiterations (K>1);1(default) is full Newton. Reuse refreshes adaptively when the line search backtracks, and retries with a fresh factorization on a stall. On transition problems this leaves the solution unchanged while substantially cutting the time spent in the linear solve.the per-period Jacobian block is now assembled directly as sparse (dropping a dense scatter +
find), and the line search no longer rebuilds the Jacobian on every backtracking trial.a new ``simul_reuse_sstate`` option (default
false) skips the internal steady-state re-solve when the model is already solved, for pre-solved / repeated / extended-path runs.
Steady-state solve: false “could not solve” failures fixed. The steady-state success verdict compared the residual against the solver’s iterate tolerance (
sqrt(eps)), which sits right at the achievable residual floor — so well-converged solutions on some models (e.g. the canonicalramst) were falsely reported as failures. The acceptance verdict is now decoupled from the solver tolerance via a floor (1e-6, still tighter than typical practice and well above the floor), judged on the max-abs residual; a deliberately looser solver tolerance is still honored, and achieved precision is unchanged. Separately, the engine now refreshes the parameter / definition slots from the current values on every solve, so parameter changes (estimation, calibration) correctly propagate into the steady-state solve — fixing a wrong-likelihood regression in estimation. A parameter solved in the steady state (sstate_endo_param_swap) is now seeded with a finite initial guess instead of leaving its NaN placeholder, and the parameter refresh skips NaN entries, so the solve no longer fails with “Objective function is returning Inf or NaN values at initial point” on parameter-constraint models (e.g. the canonicalramst).Steady-state engine replaced. The previous (legacy) steady-state engine has been removed in favor of a new constraint-based engine built on the
+rstst/package. The new engine was validated against the legacy one over: 55 example/OBC models (rise+solve, 0 rstst-only failures), order {1, 2, 3} perturbation (18/18 byte-identical), optimal policy including MPE (byte-identical where models parse), and end-to-endhowto.mscripts (5/7 pass; the 2 failures are pre-existing bugs in the howto scripts themselves and fail identically under the old engine). The transientsstate_engineoption that selected between the two during validation has been removed; there is now only one engine. User-visible behavior should be byte-identical for working models; the new engine additionally handles occasionally-binding constraints combined withsstate_imposedcorrectly (the previous engine required a workaround).
3.3. Where the canonical changelog lives
The single source of truth for these release notes is CHANGELOG.md
in the modern toolbox root, next to README.md. This page is
rendered from it. New entries are added to CHANGELOG.md first, then
reflected here – not the other way around, and never into
rise-stable-docs, which documents the legacy toolbox.
In MATLAB, the most recent entries are surfaced by rise.whatsnew
(or its shortcut rise_whatsnew):
rise.whatsnew % print the entire CHANGELOG
rise.whatsnew(3) % print the 3 most recent dated/Unreleased sections
rise_whatsnew(1) % shortcut, same semantics
The function lives at +rise/whatsnew.m in the toolbox; the shortcut
at m/shortcuts/rise_whatsnew.m mirrors the pattern of rise_demo
/ rise_doc.