inhabit_matrix
Combine dwellings and households function to inhabit matrix.
This module creates a cross-tabulated inhabit matrix by matching household demographics to dwelling characteristics. It processes SOEP (Socio-Economic Panel) survey data to model housing occupancy patterns over time.
To completely run this script, you need access to the SOEP Core panel data. Apply for data access here: https://www.diw.de/en/diw_01.c.601584.en/data_access.html
You can run the script without access to the SOEP Core panel data, relying on pre-computed data which you will find in data/evidence.
Functions
|
Add NaN handling to inhabit by upweighting records and including missing. |
|
Synchronize inhabit matrix with household and dwelling stocks. |
|
Update stocks with external data and synchronize with inhabit matrix. |
Load SOEP-csvs and attach all variables needed to household/dwelling/wum. |
|
|
Create boolean mask for filtering household stock by characteristics. |
|
Create dataframe from dwelling data to be included in inhabit matrix. |
|
Expand sparse inhabit matrix to full dimensional space with aggregations. |
|
Get matching households in inhabit for a given household segment. |
|
Create dataframe from household data to be included in inhabit matrix. |
|
Run yearly projection loop for housing market simulation. |
|
Combine household and dwelling data into inhabit matrix. |
|
Main model execution orchestrating inhabit matrix creation. |
|
Save and update weighted mean living space across stocks and inhabit. |
|
Set dwelling occupation value and calculate leftover occupancy. |
Update mean living space in inhabit matrix from household/dwelling stocks. |
|
|
Process single year's household and dwelling data into inhabit matrix. |