SyntheticFirms¶
The SyntheticFirms class is an abstract base class that serves as a container for preprocessed firm-level data. It manages firm data including industry assignments, employment, wages, production, financial positions, and various economic indicators.
Core Functionality¶
The class stores firm data in a pandas DataFrame with the following key columns:
- Industry: The industry classification of the firm
- Number of Employees: Employee count
- Total Wages: Total wage bill
- Production: Production output (in local currency)
- Price: Product price (in local currency)
- Labour Inputs: Labor input quantities
- Inventory: Current inventory levels
- Demand: Current demand
- Deposits: Bank deposits
- Debt: Outstanding debt
- Equity: Firm equity
- Employees ID: List of employee IDs
- Corresponding Bank ID: Associated bank ID
- Taxes paid on Production: Production taxes
- Interest paid: Total interest payments
- Profits: Current profits
- Unit Costs: Production costs per unit
- Corporate Taxes Paid: Corporate tax payments
- Debt Installments: Scheduled debt payments
Key Attributes¶
country_name: Country identifier for data collectionscale: Scaling factor for synthetic datayear: Reference year for preprocessingindustries: List of industry classificationsnumber_of_firms_by_industry: Array of firm counts by industryfirm_data: Main DataFrame containing firm informationtotal_firm_deposits: Aggregate firm depositstotal_firm_debt: Aggregate firm debtcapital_inputs_productivity_matrix: Capital productivity parametersintermediate_inputs_productivity_matrix: Input productivity parameterscapital_inputs_depreciation_matrix: Capital depreciation rateslabour_productivity_by_industry: Labor productivity by industry
Main Methods¶
reset_function_parameters: Updates firm operational parametersset_additional_initial_conditions: Sets up initial conditions for firm operationstotal_emissions: Calculates total emissions from inputs and capitalnumber_of_firms: Property returning total number of firms
Implementation¶
Module for preprocessing synthetic firm data.
This module provides a framework for preprocessing and organizing firm-level data that will be used to initialize behavioral models. Key preprocessing includes:
- Firm Data Organization:
- Industry classification
- Employee allocation
- Financial data processing
-
Production parameters
-
Initial State Processing:
- Balance sheet data
- Production capacity
- Input requirements
-
Financial positions
-
Parameter Processing:
- Productivity metrics
- Cost structures
- Tax parameters
- Interest rates
Note
This module is NOT used for simulating firm behavior. It only handles the preprocessing and organization of firm data that will later be used to initialize behavioral models in the simulation package.
SyntheticFirms
¶
Container for preprocessed firm-level data.
The firm data is stored in a pandas DataFrame with the following columns
- Industry: The industry of the firm.
- Number of Employees: The number of employees of the firm.
- Total Wages: The total wages of the firm.
- Total Wages Paid: The total wages paid by the firm.
- Production: The production of the firm (in LCU).
- Price in USD: The price of the firm (in USD).
- Price: The price of the firm (in LCU).
- Labour Inputs: The labour inputs of the firm (in LCU).
- Inventory: The inventory of the firm (in LCU).
- Demand: The demand of the firm (in LCU).
- Deposits: The deposits of the firm (in LCU).
- Debt: The debt of the firm (in LCU).
- Equity: The equity of the firm (in LCU).
- Employees ID: The IDs of the employees of the firm.
- Corresponding Bank ID: The ID of the corresponding bank of the firm.
- Taxes paid on Production: The taxes paid on production of the firm (in LCU).
- Interest paid on deposits: The interest paid on deposits of the firm (in LCU).
- Interest paid on loans: The interest paid on loans of the firm (in LCU).
- Interest paid: The interest paid of the firm (in LCU).
- Profits: The profits of the firm (in LCU).
- Unit Costs: The unit costs of the firm (in LCU).
- Corporate Taxes Paid: The corporate taxes paid of the firm (in LCU).
- Debt Installments: The debt installments of the firm (in LCU).
Attributes:
| Name | Type | Description |
|---|---|---|
country_name |
str
|
Country identifier for data collection |
scale |
int
|
Scaling factor for synthetic data |
year |
int
|
Reference year for preprocessing |
industries |
list[str]
|
List of industry classifications |
number_of_firms_by_industry |
ndarray
|
Firm count by industry |
firm_data |
DataFrame
|
Main data container with firm information |
intermediate_inputs_stock |
ndarray
|
Initial intermediate input inventory |
used_intermediate_inputs |
ndarray
|
Initial input usage |
capital_inputs_stock |
ndarray
|
Initial capital stock |
used_capital_inputs |
ndarray
|
Initial capital usage |
total_firm_deposits |
float
|
Aggregate firm deposits |
total_firm_debt |
float
|
Aggregate firm debt |
capital_inputs_productivity_matrix |
ndarray
|
Capital productivity parameters |
intermediate_inputs_productivity_matrix |
ndarray
|
Input productivity parameters |
capital_inputs_depreciation_matrix |
ndarray
|
Capital depreciation rates |
labour_productivity_by_industry |
ndarray
|
Labor productivity by industry |
country_name = country_name
instance-attribute
¶
scale = scale
instance-attribute
¶
year = year
instance-attribute
¶
industries = industries
instance-attribute
¶
number_of_firms_by_industry = number_of_firms_by_industry
instance-attribute
¶
firm_data = firm_data
instance-attribute
¶
intermediate_inputs_stock = intermediate_inputs_stock
instance-attribute
¶
used_intermediate_inputs = used_intermediate_inputs
instance-attribute
¶
capital_inputs_stock = capital_inputs_stock
instance-attribute
¶
used_capital_inputs = used_capital_inputs
instance-attribute
¶
total_firm_deposits = total_firm_deposits
instance-attribute
¶
total_firm_debt = total_firm_debt
instance-attribute
¶
capital_inputs_productivity_matrix = capital_inputs_productivity_matrix
instance-attribute
¶
intermediate_inputs_productivity_matrix = intermediate_inputs_productivity_matrix
instance-attribute
¶
capital_inputs_depreciation_matrix = capital_inputs_depreciation_matrix
instance-attribute
¶
labour_productivity_by_industry = labour_productivity_by_industry
instance-attribute
¶
number_of_firms: int
property
¶
Returns the total number of firms.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The total number of firms. |
total_emissions
property
¶
__init__(country_name: str, scale: int, year: int, industries: list[str], number_of_firms_by_industry: np.ndarray, firm_data: pd.DataFrame, intermediate_inputs_stock: np.ndarray, used_intermediate_inputs: np.ndarray, capital_inputs_stock: np.ndarray, used_capital_inputs: np.ndarray, total_firm_deposits: float, total_firm_debt: float, capital_inputs_productivity_matrix: np.ndarray, intermediate_inputs_productivity_matrix: np.ndarray, capital_inputs_depreciation_matrix: np.ndarray, labour_productivity_by_industry: np.ndarray)
abstractmethod
¶
reset_function_parameters(capital_inputs_utilisation_rate: float, initial_inventory_to_input_fraction: float, intermediate_inputs_utilisation_rate: float, zero_initial_debt: bool, zero_initial_deposits: bool)
¶
set_additional_initial_conditions(industry_data: dict[str, pd.DataFrame], synthetic_banks: SyntheticBanks, long_term_loans: LongtermLoans, short_term_loans: ShorttermLoans, tax_data: TaxData) -> None
¶
DefaultSyntheticFirms¶
DefaultSyntheticFirms is a concrete implementation of SyntheticFirms that provides preprocessing of firm-level data using standard data sources (OECD, Eurostat, Compustat). This class handles the initialization and organization of data that will be used to initialize behavioral models in the simulation package.
Data Source Integration¶
The class integrates data from multiple sources:
- OECD economic indicators
- Eurostat business statistics
- Compustat firm-level data
- National accounts data
Initial State Processing¶
The class processes:
- Industry-level aggregates
- Firm size distributions
- Financial positions
- Production parameters
Parameter Estimation¶
Key parameters estimated include:
- Productivity metrics
- Input-output relationships
- Tax rates
- Interest rates
Factory Methods¶
The class provides a factory method from_readers that creates a DefaultSyntheticFirms instance by:
- Reading and processing data from various sources
- Initializing firm-level data based on industry statistics
- Setting up financial relationships and parameters
- Calculating initial conditions for firm operations
Additional Methods¶
set_taxes_paid_on_production: Sets production taxes based on ratesset_interest_paid: Calculates interest payments on deposits and loansset_firm_profits: Computes firm profits from sales and costsset_unit_costs: Calculates per-unit production costsset_corporate_taxes_paid: Computes corporate tax paymentsset_firm_debt_installments: Sets up debt payment schedules
Implementation¶
Module for preprocessing default synthetic firm data.
This module provides a concrete implementation for preprocessing firm-level data using standard data sources (OECD, Eurostat, Compustat). Key preprocessing includes:
- Data Source Integration:
- OECD economic indicators
- Eurostat business statistics
- Compustat firm-level data
-
National accounts data
-
Initial State Processing:
- Industry-level aggregates
- Firm size distributions
- Financial positions
-
Production parameters
-
Parameter Estimation:
- Productivity metrics
- Input-output relationships
- Tax rates
- Interest rates
Note
This module is NOT used for simulating firm behavior. It only handles the preprocessing and organization of data from standard sources that will later be used to initialize behavioral models in the simulation package.
DefaultSyntheticFirms
¶
Container for preprocessed firm data using standard data sources.
This class provides a concrete implementation for preprocessing firm-level data using standard data sources (OECD, Eurostat, Compustat). It processes and organizes data about firms' characteristics, financial positions, and production parameters. It does NOT implement any firm behavior - it only handles data preprocessing.
The preprocessing workflow includes: 1. Data Collection: - Reading from standard data sources - Handling missing data - Currency conversion - Scale adjustment
- Firm Structure:
- Industry classification
- Size distribution estimation
- Employee allocation
-
Bank relationship mapping
-
Financial Processing:
- Balance sheet construction
- Income statement elements
- Tax calculations
-
Interest computations
-
Production Parameters:
- Input requirements
- Productivity metrics
- Cost structures
- Initial inventory levels
Note
This is a data container class. The actual firm behavior is implemented in the simulation package, which uses this preprocessed data for initialization.