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 collectionyear(int): Reference year for data preprocessingcentral_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 ratetargeted_inflation_rate(float): Reference inflation targetrho(float): Estimated interest rate smoothing parameterr_star(float): Estimated natural real interest ratexi_pi(float): Estimated inflation response coefficientxi_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 foryear(int): Reference year for preprocessingquarter(int): Reference quarter (1-4)readers(DataReaders): Data source readersexogenous_data(ExogenousCountryData): External economic datacentral_bank_configuration(CentralBankDataConfiguration): Configuration settings
Returns:
DefaultSyntheticCentralBank: Container with preprocessed parameters
Parameter Estimation¶
The class estimates Taylor rule parameters using the form:
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:
- Data Collection:
- Historical policy rates
- Inflation data
-
Growth indicators
-
Data Organization:
- Policy rate preprocessing
- Parameter estimation
-
Data validation
-
Country-Specific Data:
- Currency area identification
- Policy rate histories
- 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 |