Skip to content

SyntheticCentralBank

The SyntheticCentralBank module provides data structures and utilities for preprocessing and organizing central bank data that will be used to initialize behavioral models in the simulation package.

SyntheticCentralBank

The SyntheticCentralBank class is an abstract base class that provides a framework for collecting and organizing central bank data. It is not used for simulating central bank behavior - it only handles data preprocessing.

Key Features

  • Historical policy rate collection
  • Inflation and growth data aggregation
  • Parameter estimation from historical data
  • Data validation and organization
  • Country-specific data handling

Attributes

  • country_name (str): Country identifier for data collection
  • year (int): Reference year for data preprocessing
  • central_bank_data (pd.DataFrame): Preprocessed central bank data containing:
  • Policy rates
  • Additional metrics (implementation-specific)

DefaultSyntheticCentralBank

The DefaultSyntheticCentralBank class is a concrete implementation that preprocesses and organizes central bank data by estimating Taylor rule parameters from historical data.

Key Features

  • Taylor rule parameter estimation
  • Interest rate smoothing calculation
  • Response coefficients estimation
  • Natural rate computation
  • Zero lower bound enforcement

Attributes

The preprocessed data DataFrame contains:

  • policy_rate (float): Historical/initial policy rate
  • targeted_inflation_rate (float): Reference inflation target
  • rho (float): Estimated interest rate smoothing parameter
  • r_star (float): Estimated natural real interest rate
  • xi_pi (float): Estimated inflation response coefficient
  • xi_gamma (float): Estimated growth response coefficient

Factory Methods

from_readers

@classmethod
def from_readers(
    cls,
    country_name: str,
    year: int,
    quarter: int,
    readers: DataReaders,
    exogenous_data: ExogenousCountryData,
    central_bank_configuration: CentralBankDataConfiguration
) -> DefaultSyntheticCentralBank

Creates a preprocessed central bank data container using historical data.

Parameters:

  • country_name (str): Country to preprocess data for
  • year (int): Reference year for preprocessing
  • quarter (int): Reference quarter (1-4)
  • readers (DataReaders): Data source readers
  • exogenous_data (ExogenousCountryData): External economic data
  • central_bank_configuration (CentralBankDataConfiguration): Configuration settings

Returns:

  • DefaultSyntheticCentralBank: Container with preprocessed parameters

Parameter Estimation

The class estimates Taylor rule parameters using the form:

r_t = ρr_{t-1} + (1-ρ)[r* + π* + ξ_π(π_t - π*) + ξ_γγ_t]

where:

  • r_t: historical policy rate
  • ρ: smoothing parameter
  • r*: natural rate
  • π*: inflation target
  • π_t: historical inflation
  • γ_t: historical growth

Usage Example

from macro_data import DataReaders, ExogenousCountryData
from macro_data.configuration.dataconfiguration import CentralBankDataConfiguration
from macro_data.processing.synthetic_central_bank import DefaultSyntheticCentralBank

# Initialize data readers and configuration
readers = DataReaders.from_raw_data(...)
exogenous_data = ExogenousCountryData(...)
config = CentralBankDataConfiguration(inflation_target=0.02)

# Create central bank data for France in 2023 Q1
france_central_bank = DefaultSyntheticCentralBank.from_readers(
    country_name="FRA",
    year=2023,
    quarter=1,
    readers=readers,
    exogenous_data=exogenous_data,
    central_bank_configuration=config
)

# Access estimated parameters
policy_rate = france_central_bank.central_bank_data["policy_rate"]
inflation_response = france_central_bank.central_bank_data["xi_pi"]

Module for preprocessing synthetic central bank data.

This module provides an abstract base class for preprocessing and storing synthetic central bank data that will be used to initialize behavioral models in the simulation package. Key preprocessing includes:

  1. Data Collection:
  2. Historical policy rates
  3. Inflation data
  4. Growth indicators

  5. Data Organization:

  6. Policy rate preprocessing
  7. Parameter estimation
  8. Data validation

  9. Country-Specific Data:

  10. Currency area identification
  11. Policy rate histories
  12. Economic indicators
Note

This module is NOT used for simulating central bank behavior. It only handles the preprocessing and organization of data that will later be used to initialize behavioral models in the simulation package.

SyntheticCentralBank

Abstract base class for preprocessing and storing central bank data.

This class provides a framework for collecting and organizing central bank data that will be used to initialize behavioral models. It is NOT used for simulating central bank behavior - it only handles data preprocessing.

The central bank data is stored in a pandas DataFrame containing
  • Policy Rate: Historical/initial policy rates
  • Additional metrics may be added by concrete implementations
Note

This is a data container class. The actual central bank behavior (policy decisions, rate setting, etc.) is implemented in the simulation package, which uses this preprocessed data for initialization.

Attributes:

Name Type Description
country_name str

Country identifier for data collection

year int

Reference year for data preprocessing

central_bank_data DataFrame

Preprocessed central bank data

country_name = country_name instance-attribute
year = year instance-attribute
central_bank_data = central_bank_data instance-attribute
__init__(country_name: str, year: int, central_bank_data: pd.DataFrame) abstractmethod

Initialize the central bank data container.

Parameters:

Name Type Description Default
country_name str

Country identifier for data collection

required
year int

Reference year for data preprocessing

required
central_bank_data DataFrame

Initial central bank data to preprocess

required