## Preface

## Source details

**Canonical URL:** [Preface](https://www.imf.org/-/media/files/publications/tar/2025/english/tarea2025094-source-pdf.pdf)

## Other formats

- [Markdown version](/-/media/files/publications/tar/2025/english/tarea2025094-source-pdf.pdf.md)
- [Structured JSON version](/-/media/files/publications/tar/2025/english/tarea2025094-source-pdf.pdf.json)

---

### Mission overview
- At the request of Bank of Mozambique (BM), a Monetary and Capital Markets (MCM) Department mission provided technical assistance from March 31 – April 11, 2025, to assist BM staff in building autonomy in the use of the new version of QPM (core-QPM) for forecasting and policy analysis purposes.
- The mission team (MT) comprised of Ørjan Robstad and Erlend Njølstad, both from Norges Bank.
- The mission was part of the Norwegian-funded, multi-year, central bank modernization program covering the main areas of central banking activities.
- Purpose: make adjustments to the model and model output to make it ready for practical use in the policy process; build competence and autonomy on the use, maintenance, and further development of core-QPM for forecasting and policy analysis.

### Activities during the mission
- Hands-on mock forecasting and policy analysis process run with a small group of Economic Research Department (DEE) staff based on data from the March policy round.
- Continued work building on previous missions that developed, estimated and provided MATLAB training in core-QPM.

### Key outputs delivered
- Core-QPM model enhancements and new output reports to improve transparency and usability in the policy process.
- A user manual for the core-QPM version provided to BM to reduce dependence on single individuals and increase organizational resilience.
- Practical improvements to model reporting and presentation for MPC members and DEE staff.

### Executive summary — main points
- Core-QPM is a simpler, more transparent core of old-QPM capturing transmission channels of the Mozambiquan economy and estimated using Mozambiquan data.
- For the past year BM staff have used core-QPM in parallel with old-QPM.
- Recommendation that BM move to core-QPM as the main policy model because the current version of QPM is unnecessarily complex and lacks transparency, which hampers staff autonomy and long-run relevance.

### Forecasting and policy analysis (simplified framework)
- Mission objectives: enhance competence and autonomy on the use of core macro models; run shadow forecasting and policy processes; improve model output for MPC use.
- Important model adjustments discussed and implemented with DEE staff:
  - Neutral level adjustments for the real exchange rate and the policy rate.
  - Trend in the real exchange rate adjusted to a constant with a shift in 2015 when the exchange rate depreciated substantially.
  - Neutral level for the real policy rate set slightly higher in the forecast horizon than its historical average.
  - New trend assessments for foreign variables to ensure gaps are close to zero by the end of the forecast horizon.
- Shadow forecasting exercise used data and conditional assumptions from the policy process leading up to the MPC decision in March 2025 and produced benchmark forecasts and alternative scenarios.
- Model output improvements:
  - Added more forecasted variables to reporting and different transformations for variables.
  - Added graphs and tables in a presentable format.
  - Reports include raw and transformed observable data and present variables as gaps to aid assessment (example: interest rate gap and real exchange rate gap shown in figure 1).

### Specific refinements, suggestions and comments
- MT suggested continued capacity-building to ensure DEE staff autonomy to amend the preferred model and produce medium-term forecasts and policy analysis.
- Strong recommendation that DEE adopts core-QPM developed in 2023 and 2024 as the main framework for medium-term forecasting and policy analysis.
- BM should take stronger ownership of core-QPM and the surrounding FPAS framework:
  - User manual provided; BM should take ownership of the manual and operational maintenance of run-scripts and model.
  - Regular maintenance and updates of tools surrounding core-QPM are required.
- Increase analytical capabilities using core-QPM and satellite models:
  - Potential satellite models include:
    - A model suite for the output gap to incorporate other sources of information into gap judgment.
    - Models for assessing trends such as the trend in the real interest rate and real exchange rate to enhance decomposition into gap, trend and noise.

### Recommendations (Table 1 summary)
- Implementation of core-QPM and accompanying scripts as the main model for forecasting and policy analysis during the monetary policy process.
  - Priority: High
  - Timeframe: Near term
- Take ownership and spend time on maintaining the FPAS-framework surrounding the core-QPM.
  - Priority: High
  - Timeframe: Near-term
- Increase analytical capabilities using core-QPM and expanding with satellite models for the output gap and neutral real policy rate.
  - Priority: Medium
  - Timeframe: Near-term

- Note on timeframes: Near term: < 12 months; Medium term: 12 to 24 months.

### Annex material and reporting produced
- Three new output reports from core-QPM produced during the mission:
  - Annex 1 — Main output report: historical data and baseline forecasts for policy rate, inflation, exchange rate, real activity; variables reported at different frequencies (QoQ, YoY); uncertainty bands based on empirical estimates.
  - Annex 2 — Scenario report: differences between model runs illustrating impacts of alternative assumptions; includes example scenarios labeled “Maligno” (exchange rate depreciates) and “Benigno” (currency appreciates slightly).
  - Annex 3 — Filter report: technical report including all model variables and assumptions, intended for DEE staff.

### Annex III. Filter report from core-QPM model (selected figures)

### Purpose and scope
- Purpose: detailed exposition of the steps involved in running the script run_mini_qpm_moz.m which:
  - parses the model into a model object,
  - reads the data and makes necessary transformations,
  - runs the Kalman filter to create initial values for all model variables,
  - makes unconditional and conditional forecasts and corresponding forecast decompositions,
  - reports output in Excel-files and PDF’s.
- Context: user manual (“Cook book”) from mission in February 2024.

### Preliminaries and required files
- Working folder: miniQPM (open a new Matlab session and ensure current folder is ...\miniQPM).
- Required data files (must be updated with historical data and conditioning forecasts):
  - db_monthly.csv
  - db_quarterly.csv
  - db_yearly.csv
  - db_quarterly_external.csv
- Main run-file: run_mini_qpm.m (open in MATLAB editor via Current folder).
- No additional search paths required.

### Main structure of run_mini_qpm.m
- The run-script is divided into the following steps:
  1. Setting general options linked to sample range, forecast range etc.
  2. Parsing and solving model
  3. Running the ‘load_data_miniQPM.m’ script, which loads and transforms data, and creates the observable variables that are specified in the .mod-file.
  4. Running Kalman filter to estimate starting values for all variables, including unobservables
  5. Making unconditional forecasts
  6. Making conditional forecasts
  7. Making forecasts charts both unconditional and conditional forecasts, making forecast comparisons
  8. Saving forecasts to .csv and .mat files
  9. Estimating Bayesian AR(1)-models used as starting point to construct asymmetric fan charts
  10. Making asymmetric fan charts
  11. Making historical and forecast decompositions.

### Section 1: Date objects and options
- Define startDate and endDate for domestic data: end-date should refer to the last date treated as history (including near-term forecasts), typically the current quarter.
- Set forecast horizon: fcastHor.
- Calculate additional date objects used throughout the script.

### Section 2: Parsing and solving the model
- Use model() function to parse .mod file into Matlab.
- Check steady state: for this gap-model, the steady state should be zero for all model variables.

### Section 3: Loading and transforming data (load_data_miniqpm.m)
- First section: load required csv-files (must include near-term forecasts and medium-term assumptions for external variables).
- Rename national accounts variables that are mislabeled with _sa (not actually seasonally adjusted).
- Data processing steps:
  - Seasonal adjustment where appropriate using x12() in IRIS which draws on the X13-ARIMA-SEATS filter.
  - Convert monthly and yearly data into quarterly using convert() in IRIS.
    - Monthly → quarterly: 3-month averages within quarters (default: high to low frequency).
    - Annual → quarterly: quadratic interpolation preserving low frequency mean (method=quadsum).
  - Detrend/demean observables to construct gap-variables (db_model → db_obs).
    - Non-stationary variables: detrend using hp-filter to obtain trend (y_t^trend) and gap y_t^gap = y_t - y_t^trend.
    - Stationary variables: subtract sample mean to obtain gap.
    - CPI: allow for break in mean — sample average until 2018, then assume inflation target of 4 percent in period thereafter (i.e. the mid-point of interval 2 to 6).
- Save trends for forecasting.
- Plot all observables and visually inspect gap variables.

### Section 4: Run filter
- Run Kalman filter via filter() with inputs:
  - model object m,
  - observable data db_obs,
  - forecasting range.
- Outputs:
  - db_filt: filtered data including initial values and smoothed shocks (used to generate forecasts).
  - m_filt: updated model object (changes only if `Relative=` is true and/or `OutOfLik=` is non-empty — not the case here).
- Reference: doc model/filter.

### Section 5: Unconditional forecasts
- Use jforecast() to produce forecasts. Note:
  - “Unconditional forecasts” here are conditional on short-term forecasts and medium-term external forecasts included in csv data files.
- Key options and steps:
  - Provide model object, initial values and smoothed shocks from db_filt, and forecast range.
  - Use anticipate= false to use unanticipated shocks.
  - Add forecasted standard deviations and mean projections to historical smoothed values (stored in uncert and db_fcast).
  - Call reporting_miniQPM script to transform model variables back to levels and growth rates, adding estimated hp-trend or sample average to gaps.
- Example: potential GDP growth over projection horizon is set to a fixed growth rate (tnd_gdp) — user must choose this number. Historical quarterly potential growth based on hp-filter stored from Kalman filter (db3); potential growth for forecast horizon stacked in db4; combined in db5 to compute overall growth as trend + gap growth.
- Confidence bands for fan charts calculated in report_miniQPM.

### Section 6: Conditional forecasts
- Conditioning information sources:
  - Near-term forecasts (NTFs) up to one quarter ahead mapped to active shocks.
  - Medium-term forecasts for external variables (external variables modelled as AR-processes → unique mapping to corresponding shock).
- Constructing scenarios:
  - Example: policy rate held constant for entire forecast period (procrastination exercise).
    - Discussion: distinguishing whether constant rate reflects demand, cost-push, or deviation by central bank — recommend attributing deviation to monetary policy shocks if representing central bank deviation, keeping other implied shocks constant.
  - Implementation steps:
    - Create a cell table with dates and values for the conditioned variable(s) (e.g., policy rate, real exchange rate).
    - Convert table to array; define scenario dates (range), cond_var (endogenous variables to condition on), and cond_shock (shocks to explain conditioning assumptions).
    - Fetch smoothed values for model variables and shocks from Kalman filter and add conditioning values for forecasting horizon.
    - Define simulation plan via plan() and specify endogenous/exogenous variables (sp, cond_var, cond_shock).
    - Run jforecast() with simulation plan.
- Outputs:
  - db_cond_fcast: mean forecasts under conditioning.
  - uncert_cond: corresponding uncertainty.
  - Transform model variables back to reporting variables after forecasting.

### Section 7: Forecast charts
- Set plotting options and legends in rep object.
- Create cells of variable subsets to plot; each chart can contain up to four subplots.
- Collect settings in rep and run rep.produce() to generate reports via IRIS report class.
  - publish must be true; if visible true, charts are displayed.

### Section 8: Saving results
- Save db_fcast variables to results folder as db_fcast_mini_qpm.csv (example).
- Can save incrementally in preceding sections as needed.

### Section 9: Save a forecast report
- Save quarterly forecasts for selected variables to an excel file and pdf.
- Use tableList cell with variable name, description and transformation.
- Table reports forecasts for entire forecast period.

### Section 10: Creating fan charts — step 1 (estimate AR-models)
- Rationale: construct asymmetric fan charts reflecting out-of-sample forecast errors using Bayesian AR models for selected variables (practical alternative when asymmetric shocks are a conditional assumption).
- Procedure:
  - List variables to produce fan charts for (from db_fcast).
  - Loop over variables and estimate Bayesian AR model for each.
  - Produce forecasts 1 to 40 periods ahead using 5,000 draws from posterior (stored in AR_mod.forecasts.with_shocks).
  - Assume normal distribution at each horizon; calculate median and 1 standard deviation (15.866 percent quantile relationship).
  - Save estimated standard deviations of forecasts in sd_ar.mat (file name used in script: ‘sd_ar’).

### Section 11: Asymmetric fan charts — step 2
- Construct skewed fan charts using two-piece truncated normal distributions (approach used by Bank of England).
  - Combine two normal distributions truncated at their median to create skewness while keeping overall standard deviation equal to that from AR model.
- Implementation:
  - Create charts1 struct: list of variable names and skewness parameter gamma ∈ [-1, 1] (gamma=0 symmetric).
  - Define probability bands sizes (example: 30%, 60%, 90%).
  - Load sd_ar1.mat (estimated standard deviations), set forecast range and variables list.
  - For each variable and horizon:
    - Use sigma (overall sd), gamma (skewness), and mode forecasts.
    - Compute sigma1 and sigma2 via splitNormal() given sigma and gamma.
    - Use splitNormal() to calculate percentiles for colored bands and produce fan charts.

### Section 12: Historical and forecast shock decomposition
- Purpose: decompose endogenous variable movements into contributions from structural shocks (historical and projections).
- Procedure:
  - Use db_fcast (filtered historical variables + forecasts) as data input (decompositions cover both history and projections by default).
  - Choose shock groups and individual shocks to display.
    - Example grouping in policy-rate decomposition:
      - Demand: shocks to IS-curve.
      - Prices: shocks to two Phillips curves and admin prices process (collected under ‘Prices’).
      - shock_rn_tar: monetary policy shock.
      - External shocks: oil price shock, risk premium shock in UIP.
      - Remaining shocks not listed appear under ‘rest’.
  - Run moz_shockDecomp to produce marginal shock contributions.
  - Specify chart settings and plot using plotter function in nb_toolbox.

*IMF Technical Assistance Report — Preface*

### Preface ................................................................................................................

### Preface

### Mission overview
- At the request of Bank of Mozambique (BM), a Monetary and Capital Markets (MCM) Department mission provided technical assistance from March 31 – April 11, 2025, to assist BM staff in building autonomy in the use of the new version of QPM (core-QPM) for forecasting and policy analysis purposes.
- The mission team (MT) comprised of Ørjan Robstad and Erlend Njølstad, both from Norges Bank.
- The mission was part of the Norwegian-funded, multi-year, central bank modernization program covering the main areas of central banking activities.
- Purpose: make adjustments to the model and model output to make it ready for practical use in the policy process; build competence and autonomy on the use, maintenance, and further development of core-QPM for forecasting and policy analysis.

### Activities during the mission
- Hands-on mock forecasting and policy analysis process run with a small group of Economic Research Department (DEE) staff based on data from the March policy round.
- Continued work building on previous missions that developed, estimated and provided MATLAB training in core-QPM.

### Key outputs delivered
- Core-QPM model enhancements and new output reports to improve transparency and usability in the policy process.
- A user manual for the core-QPM version provided to BM to reduce dependence on single individuals and increase organizational resilience.
- Practical improvements to model reporting and presentation for MPC members and DEE staff.

### Executive summary — main points
- Core-QPM is a simpler, more transparent core of old-QPM capturing transmission channels of the Mozambiquan economy and estimated using Mozambiquan data.
- For the past year BM staff have used core-QPM in parallel with old-QPM.
- Recommendation that BM move to core-QPM as the main policy model because the current version of QPM is unnecessarily complex and lacks transparency, which hampers staff autonomy and long-run relevance.

### Forecasting and policy analysis (simplified framework)
- Mission objectives: enhance competence and autonomy on the use of core macro models; run shadow forecasting and policy processes; improve model output for MPC use.
- Important model adjustments discussed and implemented with DEE staff:
  - Neutral level adjustments for the real exchange rate and the policy rate.
  - Trend in the real exchange rate adjusted to a constant with a shift in 2015 when the exchange rate depreciated substantially.
  - Neutral level for the real policy rate set slightly higher in the forecast horizon than its historical average.
  - New trend assessments for foreign variables to ensure gaps are close to zero by the end of the forecast horizon.
- Shadow forecasting exercise used data and conditional assumptions from the policy process leading up to the MPC decision in March 2025 and produced benchmark forecasts and alternative scenarios.
- Model output improvements:
  - Added more forecasted variables to reporting and different transformations for variables.
  - Added graphs and tables in a presentable format.
  - Reports include raw and transformed observable data and present variables as gaps to aid assessment (example: interest rate gap and real exchange rate gap shown in figure 1).

### Specific refinements, suggestions and comments
- MT suggested continued capacity-building to ensure DEE staff autonomy to amend the preferred model and produce medium-term forecasts and policy analysis.
- Strong recommendation that DEE adopts core-QPM developed in 2023 and 2024 as the main framework for medium-term forecasting and policy analysis.
- BM should take stronger ownership of core-QPM and the surrounding FPAS framework:
  - User manual provided; BM should take ownership of the manual and operational maintenance of run-scripts and model.
  - Regular maintenance and updates of tools surrounding core-QPM are required.
- Increase analytical capabilities using core-QPM and satellite models:
  - Potential satellite models include:
    - A model suite for the output gap to incorporate other sources of information into gap judgment.
    - Models for assessing trends such as the trend in the real interest rate and real exchange rate to enhance decomposition into gap, trend and noise.

### Recommendations (Table 1 summary)
- Implementation of core-QPM and accompanying scripts as the main model for forecasting and policy analysis during the monetary policy process.
  - Priority: High
  - Timeframe: Near term
- Take ownership and spend time on maintaining the FPAS-framework surrounding the core-QPM.
  - Priority: High
  - Timeframe: Near-term
- Increase analytical capabilities using core-QPM and expanding with satellite models for the output gap and neutral real policy rate.
  - Priority: Medium
  - Timeframe: Near-term

- Note on timeframes: Near term: < 12 months; Medium term: 12 to 24 months.

### Annex material and reporting produced
- Three new output reports from core-QPM produced during the mission:
  - Annex 1 — Main output report: historical data and baseline forecasts for policy rate, inflation, exchange rate, real activity; variables reported at different frequencies (QoQ, YoY); uncertainty bands based on empirical estimates.
  - Annex 2 — Scenario report: differences between model runs illustrating impacts of alternative assumptions; includes example scenarios labeled “Maligno” (exchange rate depreciates) and “Benigno” (currency appreciates slightly).
  - Annex 3 — Filter report: technical report including all model variables and assumptions, intended for DEE staff.

*IMF Technical Assistance Report — Preface*

### Annex III  .  Filter report from core-QPM model

### Annex III  .  Filter report from core-QPM model (selected figures)

### Purpose and scope
- Purpose: detailed exposition of the steps involved in running the script run_mini_qpm_moz.m which:
  - parses the model into a model object,
  - reads the data and makes necessary transformations,
  - runs the Kalman filter to create initial values for all model variables,
  - makes unconditional and conditional forecasts and corresponding forecast decompositions,
  - reports output in Excel-files and PDF’s.
- Context: user manual (“Cook book”) from mission in February 2024.

### Preliminaries and required files
- Working folder: miniQPM (open a new Matlab session and ensure current folder is ...\miniQPM).
- Required data files (must be updated with historical data and conditioning forecasts):
  - db_monthly.csv
  - db_quarterly.csv
  - db_yearly.csv
  - db_quarterly_external.csv
- Main run-file: run_mini_qpm.m (open in MATLAB editor via Current folder).
- No additional search paths required.

### Main structure of run_mini_qpm.m
- The run-script is divided into the following steps:
  1. Setting general options linked to sample range, forecast range etc.
  2. Parsing and solving model
  3. Running the ‘load_data_miniQPM.m’ script, which loads and transforms data, and creates the observable variables that are specified in the .mod-file.
  4. Running Kalman filter to estimate starting values for all variables, including unobservables
  5. Making unconditional forecasts
  6. Making conditional forecasts
  7. Making forecasts charts both unconditional and conditional forecasts, making forecast comparisons
  8. Saving forecasts to .csv and .mat files
  9. Estimating Bayesian AR(1)-models used as starting point to construct asymmetric fan charts
  10. Making asymmetric fan charts
  11. Making historical and forecast decompositions.

### Section 1: Date objects and options
- Define startDate and endDate for domestic data: end-date should refer to the last date treated as history (including near-term forecasts), typically the current quarter.
- Set forecast horizon: fcastHor.
- Calculate additional date objects used throughout the script.

### Section 2: Parsing and solving the model
- Use model() function to parse .mod file into Matlab.
- Check steady state: for this gap-model, the steady state should be zero for all model variables.

### Section 3: Loading and transforming data (load_data_miniqpm.m)
- First section: load required csv-files (must include near-term forecasts and medium-term assumptions for external variables).
- Rename national accounts variables that are mislabeled with _sa (not actually seasonally adjusted).
- Data processing steps:
  - Seasonal adjustment where appropriate using x12() in IRIS which draws on the X13-ARIMA-SEATS filter.
  - Convert monthly and yearly data into quarterly using convert() in IRIS.
    - Monthly → quarterly: 3-month averages within quarters (default: high to low frequency).
    - Annual → quarterly: quadratic interpolation preserving low frequency mean (method=quadsum).
  - Detrend/demean observables to construct gap-variables (db_model → db_obs).
    - Non-stationary variables: detrend using hp-filter to obtain trend (y_t^trend) and gap y_t^gap = y_t - y_t^trend.
    - Stationary variables: subtract sample mean to obtain gap.
    - CPI: allow for break in mean — sample average until 2018, then assume inflation target of 4 percent in period thereafter (i.e. the mid-point of interval 2 to 6).
- Save trends for forecasting.
- Plot all observables and visually inspect gap variables.

### Section 4: Run filter
- Run Kalman filter via filter() with inputs:
  - model object m,
  - observable data db_obs,
  - forecasting range.
- Outputs:
  - db_filt: filtered data including initial values and smoothed shocks (used to generate forecasts).
  - m_filt: updated model object (changes only if `Relative=` is true and/or `OutOfLik=` is non-empty — not the case here).
- Reference: doc model/filter.

### Section 5: Unconditional forecasts
- Use jforecast() to produce forecasts. Note:
  - “Unconditional forecasts” here are conditional on short-term forecasts and medium-term external forecasts included in csv data files.
- Key options and steps:
  - Provide model object, initial values and smoothed shocks from db_filt, and forecast range.
  - Use anticipate= false to use unanticipated shocks.
  - Add forecasted standard deviations and mean projections to historical smoothed values (stored in uncert and db_fcast).
  - Call reporting_miniQPM script to transform model variables back to levels and growth rates, adding estimated hp-trend or sample average to gaps.
- Example: potential GDP growth over projection horizon is set to a fixed growth rate (tnd_gdp) — user must choose this number. Historical quarterly potential growth based on hp-filter stored from Kalman filter (db3); potential growth for forecast horizon stacked in db4; combined in db5 to compute overall growth as trend + gap growth.
- Confidence bands for fan charts calculated in report_miniQPM.

### Section 6: Conditional forecasts
- Conditioning information sources:
  - Near-term forecasts (NTFs) up to one quarter ahead mapped to active shocks.
  - Medium-term forecasts for external variables (external variables modelled as AR-processes → unique mapping to corresponding shock).
- Constructing scenarios:
  - Example: policy rate held constant for entire forecast period (procrastination exercise).
    - Discussion: distinguishing whether constant rate reflects demand, cost-push, or deviation by central bank — recommend attributing deviation to monetary policy shocks if representing central bank deviation, keeping other implied shocks constant.
  - Implementation steps:
    - Create a cell table with dates and values for the conditioned variable(s) (e.g., policy rate, real exchange rate).
    - Convert table to array; define scenario dates (range), cond_var (endogenous variables to condition on), and cond_shock (shocks to explain conditioning assumptions).
    - Fetch smoothed values for model variables and shocks from Kalman filter and add conditioning values for forecasting horizon.
    - Define simulation plan via plan() and specify endogenous/exogenous variables (sp, cond_var, cond_shock).
    - Run jforecast() with simulation plan.
- Outputs:
  - db_cond_fcast: mean forecasts under conditioning.
  - uncert_cond: corresponding uncertainty.
  - Transform model variables back to reporting variables after forecasting.

### Section 7: Forecast charts
- Set plotting options and legends in rep object.
- Create cells of variable subsets to plot; each chart can contain up to four subplots.
- Collect settings in rep and run rep.produce() to generate reports via IRIS report class.
  - publish must be true; if visible true, charts are displayed.

### Section 8: Saving results
- Save db_fcast variables to results folder as db_fcast_mini_qpm.csv (example).
- Can save incrementally in preceding sections as needed.

### Section 9: Save a forecast report
- Save quarterly forecasts for selected variables to an excel file and pdf.
- Use tableList cell with variable name, description and transformation.
- Table reports forecasts for entire forecast period.

### Section 10: Creating fan charts — step 1 (estimate AR-models)
- Rationale: construct asymmetric fan charts reflecting out-of-sample forecast errors using Bayesian AR models for selected variables (practical alternative when asymmetric shocks are a conditional assumption).
- Procedure:
  - List variables to produce fan charts for (from db_fcast).
  - Loop over variables and estimate Bayesian AR model for each.
  - Produce forecasts 1 to 40 periods ahead using 5,000 draws from posterior (stored in AR_mod.forecasts.with_shocks).
  - Assume normal distribution at each horizon; calculate median and 1 standard deviation (15.866 percent quantile relationship).
  - Save estimated standard deviations of forecasts in sd_ar.mat (file name used in script: ‘sd_ar’).

### Section 11: Asymmetric fan charts — step 2
- Construct skewed fan charts using two-piece truncated normal distributions (approach used by Bank of England).
  - Combine two normal distributions truncated at their median to create skewness while keeping overall standard deviation equal to that from AR model.
- Implementation:
  - Create charts1 struct: list of variable names and skewness parameter gamma ∈ [-1, 1] (gamma=0 symmetric).
  - Define probability bands sizes (example: 30%, 60%, 90%).
  - Load sd_ar1.mat (estimated standard deviations), set forecast range and variables list.
  - For each variable and horizon:
    - Use sigma (overall sd), gamma (skewness), and mode forecasts.
    - Compute sigma1 and sigma2 via splitNormal() given sigma and gamma.
    - Use splitNormal() to calculate percentiles for colored bands and produce fan charts.

### Section 12: Historical and forecast shock decomposition
- Purpose: decompose endogenous variable movements into contributions from structural shocks (historical and projections).
- Procedure:
  - Use db_fcast (filtered historical variables + forecasts) as data input (decompositions cover both history and projections by default).
  - Choose shock groups and individual shocks to display.
    - Example grouping in policy-rate decomposition:
      - Demand: shocks to IS-curve.
      - Prices: shocks to two Phillips curves and admin prices process (collected under ‘Prices’).
      - shock_rn_tar: monetary policy shock.
      - External shocks: oil price shock, risk premium shock in UIP.
      - Remaining shocks not listed appear under ‘rest’.
  - Run moz_shockDecomp to produce marginal shock contributions.
  - Specify chart settings and plot using plotter function in nb_toolbox.

*IMF Technical Assistance Report — Annex III. Filter report from core-QPM model (selected figures) / Annex IV user manual excerpts*

---


_Source: https://www.imf.org/-/media/files/publications/tar/2025/english/tarea2025094-source-pdf.pdf_
