SyntheticHousingMarket¶
The SyntheticHousingMarket class is a container for preprocessed housing market data that organizes housing units and their relationships with households. It handles the initial state of housing ownership and rental relationships for model initialization.
Core Functionality¶
The class handles:
-
Housing Unit Data:
- Property identification and valuation
- Rental status and rates
- Owner-occupancy classification
- Property characteristics
-
Housing-Household Relationships:
- Owner-property matching
- Renter-property matching
- Vacant property tracking
- Social housing allocation
-
Market Structure:
- Rental market availability
- Property value distribution
- Geographic clustering (if applicable)
- Market segment classification
Key Attributes¶
country_name: Country identifier for data collectionhousing_market_data: DataFrame containing:- House ID: Unique identifier for each housing unit
- Is Owner-Occupied: Boolean flag for owner-occupied properties
- Corresponding Owner Household ID: ID of the owning household
- Corresponding Inhabitant Household ID: ID of the residing household
- Value: Property value in local currency units
- Rent: Monthly rental amount (if applicable)
- Up for Rent: Boolean flag for rental market availability
- Newly on the Rental Market: Tracks new rental listings
Implementation¶
Module for preprocessing synthetic housing market data.
This module provides a framework for preprocessing and organizing housing market data that will be used to initialize behavioral models. It focuses on establishing the initial state of housing ownership and rental relationships between housing units and households. Key preprocessing tasks include:
- Housing Unit Data:
- Property identification and valuation
- Rental status and rates
- Owner-occupancy classification
-
Property characteristics
-
Housing-Household Relationships:
- Owner-property matching
- Renter-property matching
- Vacant property tracking
-
Social housing allocation
-
Market Structure:
- Rental market availability
- Property value distribution
- Geographic clustering (if applicable)
- Market segment classification
Note
This module is NOT used for simulating housing market behavior. It only handles the preprocessing and organization of housing market data that will later be used to initialize behavioral models in the simulation package. The actual housing market dynamics (buying, selling, renting) are implemented elsewhere.
SyntheticHousingMarket
¶
Container for preprocessed housing market data.
This class organizes data about housing units and their relationships with households (both owners and renters). It processes and structures data about property ownership, rental arrangements, and market availability. It does NOT implement any market behavior - it only handles data preprocessing.
The preprocessing workflow includes: 1. Property Data Processing: - Housing unit identification - Property valuation - Rental rate calculation - Occupancy status tracking
- Relationship Mapping:
- Owner-property associations
- Renter-property matches
- Social housing assignments
-
Vacancy tracking
-
Market Status:
- Rental availability flags
- New market entry tracking
- Market segment labeling
- Geographic clustering (if applicable)
The housing market data is stored in a pandas DataFrame with columns
- House ID: Unique identifier for each housing unit
- Is Owner-Occupied: Boolean flag for owner-occupied properties
- Corresponding Owner Household ID: ID of the owning household
- Corresponding Inhabitant Household ID: ID of the residing household
- Value: Property value in local currency units
- Rent: Monthly rental amount (if applicable)
- Up for Rent: Boolean flag for rental market availability
- Newly on the Rental Market: Tracks new rental listings
Attributes:
| Name | Type | Description |
|---|---|---|
country_name |
str
|
Country identifier for data collection |
housing_market_data |
DataFrame
|
Preprocessed housing market data containing property details and household relationships |
Default Implementation¶
The DefaultSyntheticHousingMarket class provides a standard implementation for processing housing market data using common data sources.
Data Processing¶
The default implementation handles:
-
Data Collection:
- Household survey data
- Property registration records
- Rental market statistics
- Social housing records
-
Property Matching:
- Owner-occupied property identification
- Rental property classification
- Social housing allocation
- Vacancy tracking
-
Market Initialization:
- Property value assignment
- Rental rate calculation
- Market availability flags
- New listing identification
Factory Methods¶
The class provides a factory method init_from_datadict that creates a DefaultSyntheticHousingMarket instance by:
- Converting dictionary data to DataFrame format
- Setting initial rental market availability
- Establishing property-household relationships
Implementation¶
Module for preprocessing default synthetic housing market data.
This module provides a default implementation for preprocessing housing market data using standard household survey data and property records. It handles the organization of housing ownership and rental relationships using commonly available housing statistics.
DefaultSyntheticHousingMarket
¶
Default implementation for preprocessing housing market data.
This class provides a standard implementation for processing housing market data using common data sources like household surveys and property records. It organizes data about housing units and their relationships with households using widely available housing statistics.
The preprocessing workflow includes: 1. Data Collection: - Household survey data - Property registration records - Rental market statistics - Social housing records
- Property Matching:
- Owner-occupied property identification
- Rental property classification
- Social housing allocation
-
Vacancy tracking
-
Market Initialization:
- Property value assignment
- Rental rate calculation
- Market availability flags
- New listing identification
Note
This implementation uses default data sources and standard preprocessing methods. For specialized preprocessing needs, create a new implementation of the base SyntheticHousingMarket class.
init_from_datadict(country_name: str, housing_data_dict: dict)
classmethod
¶
Create preprocessed housing market data from a dictionary source.
This method processes housing market data from a dictionary containing property and household relationship information. It initializes the market state by: 1. Converting dictionary data to DataFrame format 2. Setting initial rental market availability 3. Establishing property-household relationships
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
country_name
|
str
|
Country to process data for |
required |
housing_data_dict
|
dict
|
Dictionary containing housing market data with keys matching the required DataFrame columns |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DefaultSyntheticHousingMarket |
Container with preprocessed housing market data ready for model initialization |