π ____ _____ _____ _____ π
| _ \ | __ \| __ \ _|
| |_) | __ _| |__) | |__) | |
| _ < / _` | ___/| ___/| |
| |_) | (_| | | | | _| |_
|____/ \__,_|_| |_| |_____|
π π
BaPPI is a hierarchical Bayesian inference framework designed to analyse simulated real estate markets in London and determine whether rental listings are more likely managed directly by property owners or by third-party agents.
The engine models how structural property characteristics influence pricing whilst accounting for the additional pricing effects introduced by intermediaries. Using probabilistic inference and Sequential Monte Carlo sampling, BaPPI estimates posterior distributions over pricing parameters and evaluates competing generative explanations for observed property datasets.
The framework is particularly focused on:
- Bayesian market modelling
- Hierarchical market uncertainty
- Agent commission effects
- Bayesian model comparison
- Synthetic real estate market simulation
BaPPI executes a full end-to-end Bayesian analysis pipeline:
Synthetic real estate data is generated with configurable:
- Property types (houses/flats)
- Room counts
- Distance from city centre
- Outdoor amenities
- Underground station proximity
- Market volatility
- Agent premiums
The simulation produces both owner-managed and agent-managed listings.
The engine performs hierarchical Bayesian inference over the pricing parameters governing the simulated market using:
- Sequential Monte Carlo (SMC)
- Market-level priors
- Hierarchical uncertainty modelling
- Property-level structural information
Rather than analysing properties independently, BaPPI jointly analyses a collection of properties simultaneously under two competing market hypotheses:
- Owner Model β prices are generated without agent intervention
- Agent Model β prices include an additional agent premium contribution
BaPPI runs its analysis while accounting for structural variables such as:
- Number of rooms
- Property type
- Distance from the city centre
- Outdoor amenities
- Underground station proximity
For a jointly analysed collection of properties, BaPPI estimates:
- Posterior distributions over the pricing parameters
- Posterior uncertainty in the pricing model
- Log marginal likelihoods for competing hypotheses
- A Bayes factor comparing the Owner and Agent models
The analysis is performed collectively across multiple properties rather than independently for each listing.
The bulk of the post-analysis stage includes:
- Diagnostic outputs
- Posterior summaries
- Bayesian convergence information
- Market parameter estimates
- Model comparison statistics
Before running the project, the user should first configure the simulation and analysis settings in:
app/config.iniThis file controls all major aspects of the framework.
Controls execution mode and reproducibility.
mode="hierarchical"
seed=14Currently, the full pipeline only supports:
mode="hierarchical"Controls synthetic market generation:
- Number of properties
- Flat/house ratios
- Room distributions
- Distance distributions
- Amenity probabilities
- Underground proximity
Example:
num_properties=1000
flat_house_ratio=3
room_exp_num=2.5Defines the pricing model used during simulation and inference.
Includes:
- Base property value
- Room pricing coefficients
- Distance penalties
- House premiums
- Garden/Balcony/Terrace fees
- Agent premium
- Market volatility
Example:
agent_premium=0.15
market_vol=0.02Controls the Bayesian inference stage:
- Number of analysed properties
- Prior scaling
- Fixed parameters
- Known market-level parameters
- Monte Carlo draws
- Number of chains
Example:
mc_draws=1000
chains=4- Python
- PyMC
- ArviZ
- NumPy
- SciPy
- Pandas
- Statsmodels
- Matplotlib
- Seaborn
- Hierarchical Bayesian Modelling
- Sequential Monte Carlo (SMC)
- Posterior Probability Estimation
- Bayesian Model Comparison
Clone the repository and install dependencies:
pip install -r requirements.txtEdit:
app/config.iniAdjust the simulation and Bayesian analysis parameters according to your experiment.
Launch the framework with:
python app/main.pyThe main execution script automatically performs:
- Property data generation
- Hierarchical Bayesian analysis
- Post-analysis diagnostics
Execution flow:
Generate synthetic market β
Run Bayesian inference β
Perform post-analysis
Unlike traditional regression or binary classification systems, BaPPI treats market behaviour probabilistically and evaluates competing market-wide pricing hypotheses.
Rather than independently classifying individual properties, the framework jointly analyses a collection of listings under two competing generative models:
- An Owner Model
- An Agent Model containing an additional pricing premium
The Bayesian framework then evaluates which model better explains the observed dataset using posterior inference and Bayes factor comparison.
This approach allows the engine to:
- Explicitly model uncertainty
- Incorporate market-level volatility
- Compare competing market hypotheses probabilistically
- Measure how strongly the observed data support one market model relative to another through the computation of the Bayes factor
Each property may include:
| Feature | Type |
|---|---|
| Property Type | Categorical |
| Number of Rooms | Numerical |
| Distance to Centre | Numerical |
| Underground Access | Binary |
| Garden | Binary |
| Balcony | Binary |
| Terrace | Binary |
| Price | Numerical |
BaPPI can be extended towards:
- Rental market anomaly detection
- Agent markup estimation
- Urban economics simulations
- Housing market forecasting
- Probabilistic pricing systems
- Bayesian market microstructure analysis
If you are interested in using, extending, or experimenting with BaPPI, the author is happy to help with setup, methodology, or implementation questions.
Researchers, students, and developers working on Bayesian modelling, probabilistic inference, or real estate market analysis are welcome to get in touch.
Nikolaos Kouvatsos
May 2026
This project is licensed under the MIT License.