Skip to content

A fast and modular Julia implementation of the macroeconomic ABM of [Poledna et al., European Economic Review (2023)]

License

Notifications You must be signed in to change notification settings

bancaditalia/BeforeIT.jl

Repository files navigation

Aqua QA

Logo adapts to light and dark modes *

Behavioural agent-based economic forecasting

Welcome to BeforeIT.jl, a package for Behavioural agent-based economic forecasting, from the IT research unit of the Bank of Italy.

BeforeIT.jl is a Julia-based implementation of the agent-based model presented in Economic forecasting with an agent-based model, the first ABM matching the forecasting performance of traditional economic tools.

With BeforeIT.jl, you can perform economic forecasting and explore different counterfactual scenarios. Thanks to its modular design, the package is also a great starting point for anyone looking to extend its capabilities or integrate it with other tools.

Developed in Julia, a language known for its efficiency, BeforeIT.jl is both fast and user-friendly, making it accessible whether you’re an expert programmer or just starting out.

The package currently contains the original parametrisation for Austria, as well as a parametrisation for Italy. Recalibrating the model on other nations is possible of course, but currently not easily supported. So get in contact if you are interested!

Julia installation

To run this software, you will need a working Julia installation on your machine. If you don't have Julia installed already, simply follow the short instructions available here.

Installation

To be able to run the model, you can activate a new Julia environment in any folder from the terminal by typing

julia --project=.

Then, whithin the Julia environment, you can install BeforeIT.jl as

using Pkg
Pkg.add("BeforeIT")

You can ensure to have installed all dependencies via

Pkg.instantiate()

Now you should be able to run the the following code

using BeforeIT

parameters = BeforeIT.AUSTRIA2010Q1.parameters
initial_conditions = BeforeIT.AUSTRIA2010Q1.initial_conditions

T = 20
model = BeforeIT.init_model(parameters, initial_conditions, T)
data = BeforeIT.run_one_sim!(model)

This will simulate the model with the original Austrian parametrisation for 20 quarters and save the results in the data object. To plot the time series within the data object, make sure you install Plots.jl in the same environment using

Pkg.add("Plots")

and then try running

using Plots

plot(data.real_gdp)

In you want to run the script without opening a REPL, you can copy and paste the above lines into a file, say main.jl, and run it directly from the terminal by typing

julia --project=. main.jl

Docs

Extensive documentation on how to use the package is available here. We suggest following the steps in this tutorial to quickly learn the basics.

Download Source Code and Run Tests

Clone the Repository

git clone https://github.com/bancaditalia/BeforeIT.jl.git
cd BeforeIT.jl

Activate and Instantiate the Environment

julia -e 'using Pkg; Pkg.activate("."); Pkg.instantiate();'

Run Tests

julia --proj test/runtests.jl

Current Authors

Aldo Glielmo
Aldo Glielmo

Banca d'Italia

Email: [email protected]

Mitja Devetak
Mitja Devetak

Paris 1: Pantheon - Sorbonne

Adriano Meligrana
Adriano Meligrana

University of Turin

Email: [email protected]

Disclaimer

This package is an outcome of a research project. All errors are those of the authors. All views expressed are personal views, not those of Bank of Italy.


* Credits to Sara Corbo for the logo and to Andrea Gentili for the name suggestion.