Skip to content

A Canadian Stock Flow Consistent (SFC) Macroeconomic Model based on the Italy SFC Model by Marco Veronese Passarella.

License

Notifications You must be signed in to change notification settings

roguetrainer/Canada-SFC-Model

Repository files navigation

Canadian Stock-Flow Consistent (SFC) Model

Overview

This repository contains an empirical Stock-Flow Consistent (SFC) macroeconomic model for Canada, implemented in R using the Bimets package.

image

Important Attribution: This Canadian model is based very closely on the Italian SFC Model developed by Rosa Canelli and Marco Veronese Passarella. The original Italian model and its complete documentation can be found at:

Original Repository: https://github.com/marcoverpas/Italy-SFC-Model

Acknowledgments

The structure, methodology, and core equations of this Canadian model are adapted from the Italian SFC Model created by:

  • Rosa Canelli (University of L'Aquila)
  • Marco Veronese Passarella (University of L'Aquila)

The Italian model replicates the baseline scenarios and experiments discussed in the following publications:

  1. Canelli, R., Fontana, G., Realfonzo, R. and Veronese Passarella, M. (2024) "Energy crisis, economic growth and public finance in Italy", Energy Economics (forthcoming).

  2. Canelli, R., Fontana, G., Realfonzo, R. and Veronese Passarella, M. (2022) "Is the Italian government debt sustainable? Scenarios after the Covid-19 shock", Cambridge Journal of Economics, 46(3), pp. 581-605.

  3. Canelli, R., Fontana, G., Realfonzo, R. and Veronese Passarella, M. (2021) "Are EU policies effective to tackle the Covid-19 crisis? The case of Italy", Review of Political Economy, 33(3), pp. 432-461.

We are deeply grateful to the original authors for making their code publicly available and for their pioneering work in empirical SFC modeling.

Adaptation for Canada

This Canadian version maintains the same theoretical framework and modeling structure as the Italian model but:

  1. Uses Canadian data sourced from Statistics Canada
  2. Adapts institutional features to reflect Canadian fiscal and monetary policy structures
  3. Calibrates parameters based on Canadian economic conditions
  4. Focuses on Canadian policy questions including fiscal sustainability and Bank of Canada policy

Key Modifications

  • Data extraction from Statistics Canada API instead of Eurostat
  • Central bank modeling adapted to reflect Bank of Canada operations
  • Exchange rate modeling relative to US Dollar (USD/CAD) instead of Euro
  • Trade modeling focused on US-Canada economic relationship
  • Government sector adapted to Canadian federal-provincial fiscal structure

Model Structure

The model consists of six sectors:

  1. Households - Consumption, savings, portfolio allocation
  2. Production Firms - Investment, production, profits
  3. Government - Fiscal policy, debt dynamics
  4. Commercial Banks - Credit creation, interest rates
  5. Central Bank (Bank of Canada) - Monetary policy, reserves
  6. Foreign Sector - Trade, capital flows

The model tracks six financial assets:

  • Cash
  • Deposits
  • Government securities
  • Loans
  • Shares
  • Other net financial assets

Files

Core Model Files

  • Canada_SFC_model.r - Main model file containing all equations and model structure
  • statcan_data_extraction.r - Data extraction script for Statistics Canada API
  • canadian_sfc_data.csv - Extracted and processed Canadian data (generated)

Documentation

  • README.md - This file
  • CITATION.md - How to cite this model and the original Italian model

Installation and Requirements

R Package Requirements

install.packages(c("bimets", "knitr", "httr", "jsonlite", "dplyr", "tidyr"))

Required Packages

  • bimets - For time series econometric modeling
  • knitr - For generating reports
  • httr - For API calls to Statistics Canada
  • jsonlite - For JSON data handling
  • dplyr - For data manipulation
  • tidyr - For data tidying

Usage

1. Extract Canadian Data

First, run the data extraction script to fetch data from Statistics Canada:

source("statcan_data_extraction.r")
DataCA <- extract_canadian_data(start_year = 1995, end_year = 2021)

Note: The current implementation includes a demonstration version with synthetic data that follows Canadian economic patterns. For production use, you should implement actual Statistics Canada API calls using the documented endpoints.

2. Load and Run the Model

source("Canada_SFC_model.r")

This will:

  • Load the model structure
  • Associate the Canadian data with model variables
  • Estimate model coefficients using historical data (1998-2019)

3. Run Simulations

After estimation, you can simulate various scenarios:

# Baseline scenario
baseline <- SIMULATE(Canada_model, 
                     TSRANGE = c(2020, 1, 2028, 1),
                     simType = 'DYNAMIC')

# Policy scenarios can be defined by modifying exogenous variables

Data Sources

Statistics Canada Tables Used

The model uses data from the following Statistics Canada tables (or their equivalents):

  • 36-10-0104-01 - GDP at basic prices, by industry
  • 36-10-0222-01 - GDP, expenditure-based
  • 14-10-0287-01 - Labour force characteristics
  • 36-10-0480-01 - Compensation of employees
  • 18-10-0005-01 - Consumer Price Index (CPI)
  • 36-10-0106-01 - Implicit price indexes, GDP
  • 36-10-0580-01 - National balance sheet and financial flow accounts
  • 10-10-0122-01 - Financial market statistics
  • 10-10-0147-01 - Government finance statistics
  • 12-10-0011-01 - International merchandise trade

API Access

Statistics Canada provides free access to their data through the Web Data Service (WDS):

Model Validation

The model satisfies key stock-flow consistency conditions:

  1. Horizontal consistency - All flows between sectors sum to zero
  2. Vertical consistency - All stocks are accounted for across sectors
  3. Budget constraints - Each sector's budget constraint is satisfied
  4. Accounting identities - GDP identity and other macro identities hold

Potential Applications

This model can be used to analyze:

  • Fiscal sustainability - Long-term government debt dynamics
  • Monetary policy - Bank of Canada interest rate effects
  • Financial stability - Household and corporate debt levels
  • External shocks - Impact of US economic conditions
  • Energy transition - Effects of energy price shocks
  • COVID-19 recovery - Post-pandemic fiscal and monetary policy

Limitations

  • The model is demand-driven (post-Keynesian framework)
  • Supply constraints are modeled through accelerator effects
  • No explicit modeling of provincial-federal fiscal transfers
  • Simplified treatment of the banking sector
  • Limited sectoral disaggregation

Future Development

Potential extensions include:

  • Multi-regional model (provinces)
  • Energy sector disaggregation
  • Housing market module
  • Climate policy scenarios
  • Financial sector detail
  • Indigenous economy integration

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request with clear documentation

License

This project is released under the same license as the original Italian SFC Model. Please check with the original authors regarding licensing terms.

When using this model, please cite both:

  1. This Canadian adaptation
  2. The original Italian model and associated publications (see CITATION.md)

References

Original Italian Model

Canelli, R., Fontana, G., Realfonzo, R. and Veronese Passarella, M. (2024) "Energy crisis, economic growth and public finance in Italy", Energy Economics.

Canelli, R., Fontana, G., Realfonzo, R. and Veronese Passarella, M. (2022) "Is the Italian government debt sustainable? Scenarios after the Covid-19 shock", Cambridge Journal of Economics, 46(3), pp. 581-605.

Stock-Flow Consistent Modeling

Godley, W. and Lavoie, M. (2007) Monetary Economics: An Integrated Approach to Credit, Money, Income, Production and Wealth, Palgrave Macmillan.

Nikiforos, M. and Zezza, G. (2017) "Stock-Flow Consistent Macroeconomic Models: A Survey", Journal of Economic Surveys, 31(5), pp. 1204-1239.

Veronese Passarella, M. (2019) "From abstract to concrete: some tips to develop an empirical SFC model", European Journal of Economics and Economic Policies: Intervention, 16(1), pp. 55-93.

Contact

For questions about this Canadian adaptation, please open an issue on this repository.

For questions about the underlying methodology and original model, please contact the original authors:

Disclaimer

This model is provided for research and educational purposes. Policy recommendations should be made with caution and proper validation. The authors are not responsible for any policy decisions made based on model outputs.


Last Updated: October 29, 2025

About

A Canadian Stock Flow Consistent (SFC) Macroeconomic Model based on the Italy SFC Model by Marco Veronese Passarella.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages