Model object: Scenario gap decomposition
Posted: Sat Sep 27, 2025 3:29 am
The EViews team should implement a built-in scenario gap decomposition within the Model object. The feature would attribute differences between a counterfactual and a baseline scenario for selected endogenous targets to specific drivers, covering both exogenous variables and add-factors over a user-defined sample. It should integrate seamlessly with existing solution controls and add-factor conventions, leveraging the Model object’s ability to solve non-linear systems. For instance, within a macroeconomic model, the routine could rapidly quantify how much of a change in the interest rate is driven by international price impulses, international demand, or shifts in public consumption.
To illustrate, consider a model Y = f(Y, X, e), where Y is endogenous, X denotes selected exogenous drivers, and e is an add-factor. Let Y_C and Y_B denote the counterfactual and baseline paths, respectively, over a chosen sample, and define DeltaY = Y_C - Y_B. For each driver j in X or e, construct a partial-counterfactual solution Y^(j) by holding all variables at their baseline paths except driver j, which follows its counterfactual path. The contribution is then C_j = Y^(j)-Y_B, computed period by period.
For the joint effect, construct Y_all by setting all selected drivers to their counterfactual paths while keeping all others at baseline, and define C_all = Y_all-Y_B, and C_other = DeltaY - C_all. This yields an additive decomposition in either levels or percentage changes.
If the counterfactual is set to the lagged baseline, Y_C = Y_(t-1), the same machinery delivers a historical decomposition: the change in Y at time t relative to its lag is attributed to deviations in X and e, with non-linear interactions preserved by solving the Model under the Y^(j) and Y_all constructions.
Conceptually, this parallels a historical shock decomposition, but is executed entirely within the Model object by re-solving counterfactuals where selected components of X and e act as the “shocks” driving the scenario gap. The feature should display baseline and counterfactual paths side by side, report their gap in levels and percentage changes, and offer grouping and sorting of drivers so users can highlight the largest contributors or user-defined categories while maintaining a transparent link to the model’s solution settings.
Building this functionality directly into the Model object would make it far faster and easier to use than relying on a user-written add-in. An in-built routine would also ensure consistency with EViews’ solver and reporting framework, avoiding the inefficiencies and maintenance costs of external workarounds.
To illustrate, consider a model Y = f(Y, X, e), where Y is endogenous, X denotes selected exogenous drivers, and e is an add-factor. Let Y_C and Y_B denote the counterfactual and baseline paths, respectively, over a chosen sample, and define DeltaY = Y_C - Y_B. For each driver j in X or e, construct a partial-counterfactual solution Y^(j) by holding all variables at their baseline paths except driver j, which follows its counterfactual path. The contribution is then C_j = Y^(j)-Y_B, computed period by period.
For the joint effect, construct Y_all by setting all selected drivers to their counterfactual paths while keeping all others at baseline, and define C_all = Y_all-Y_B, and C_other = DeltaY - C_all. This yields an additive decomposition in either levels or percentage changes.
If the counterfactual is set to the lagged baseline, Y_C = Y_(t-1), the same machinery delivers a historical decomposition: the change in Y at time t relative to its lag is attributed to deviations in X and e, with non-linear interactions preserved by solving the Model under the Y^(j) and Y_all constructions.
Conceptually, this parallels a historical shock decomposition, but is executed entirely within the Model object by re-solving counterfactuals where selected components of X and e act as the “shocks” driving the scenario gap. The feature should display baseline and counterfactual paths side by side, report their gap in levels and percentage changes, and offer grouping and sorting of drivers so users can highlight the largest contributors or user-defined categories while maintaining a transparent link to the model’s solution settings.
Building this functionality directly into the Model object would make it far faster and easier to use than relying on a user-written add-in. An in-built routine would also ensure consistency with EViews’ solver and reporting framework, avoiding the inefficiencies and maintenance costs of external workarounds.