This repository contains an empirical Stock-Flow Consistent (SFC) macroeconomic model for Canada, implemented in R using the Bimets package.
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
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:
-
Canelli, R., Fontana, G., Realfonzo, R. and Veronese Passarella, M. (2024) "Energy crisis, economic growth and public finance in Italy", Energy Economics (forthcoming).
-
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.
-
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.
This Canadian version maintains the same theoretical framework and modeling structure as the Italian model but:
- Uses Canadian data sourced from Statistics Canada
- Adapts institutional features to reflect Canadian fiscal and monetary policy structures
- Calibrates parameters based on Canadian economic conditions
- Focuses on Canadian policy questions including fiscal sustainability and Bank of Canada policy
- 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
The model consists of six sectors:
- Households - Consumption, savings, portfolio allocation
- Production Firms - Investment, production, profits
- Government - Fiscal policy, debt dynamics
- Commercial Banks - Credit creation, interest rates
- Central Bank (Bank of Canada) - Monetary policy, reserves
- Foreign Sector - Trade, capital flows
The model tracks six financial assets:
- Cash
- Deposits
- Government securities
- Loans
- Shares
- Other net financial assets
Canada_SFC_model.r- Main model file containing all equations and model structurestatcan_data_extraction.r- Data extraction script for Statistics Canada APIcanadian_sfc_data.csv- Extracted and processed Canadian data (generated)
README.md- This fileCITATION.md- How to cite this model and the original Italian model
install.packages(c("bimets", "knitr", "httr", "jsonlite", "dplyr", "tidyr"))- 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
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.
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)
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 variablesThe 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
Statistics Canada provides free access to their data through the Web Data Service (WDS):
- API Documentation: https://www.statcan.gc.ca/en/developers/wds/user-guide
- Data Tables: https://www150.statcan.gc.ca/n1/en/type/data
The model satisfies key stock-flow consistency conditions:
- Horizontal consistency - All flows between sectors sum to zero
- Vertical consistency - All stocks are accounted for across sectors
- Budget constraints - Each sector's budget constraint is satisfied
- Accounting identities - GDP identity and other macro identities hold
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
- 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
Potential extensions include:
- Multi-regional model (provinces)
- Energy sector disaggregation
- Housing market module
- Climate policy scenarios
- Financial sector detail
- Indigenous economy integration
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request with clear documentation
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:
- This Canadian adaptation
- The original Italian model and associated publications (see CITATION.md)
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.
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.
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:
- Marco Veronese Passarella: [email protected]
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
