An interactive JavaScript simulation of housing market dynamics featuring Vickrey auctions, wealth distribution effects, and market turnover. Designed for economic research and educational use.
Simple Setup:
- Open
index.htmlin your web browser - The simulation will initialize automatically with default parameters
- Use the control buttons to start, pause, or step through the simulation
No server required - this is a client-side application that runs entirely in your browser.
This simulation models a discrete-time housing market where:
- People with varying wealth levels compete for houses through auctions
- Vickrey (sealed-bid, second-price) auctions determine house sales
- Market turnover occurs as people enter and exit the market
- Wealth inequality follows a power-law distribution similar to real economies
- House values combine intrinsic worth with market pricing
- Vickrey Auctions: Winners pay the second-highest bid, creating truthful bidding incentives
- Hybrid House Valuation:
value = 0.7 * intrinsic_value + 0.3 * last_selling_price - Upgrade Threshold Logic: Existing homeowners only bid on houses worth ≥1.5× their current home
- Power Law Wealth Distribution: Realistic wealth inequality (Gini coefficient ~60%)
- Vacant House Depreciation: Unoccupied houses lose 5% value per year
- Population Turnover: People enter and exit the market each tick
- Batch Auctions: Multiple auction rounds per tick for dynamic trading
- Initial Occupancy: Markets start with ~80% of houses occupied
- Market Analytics: Comprehensive statistics including inequality metrics
- Real-time Graphics: Interactive canvas showing houses and people
- Color-coded States: Houses show availability, recent trades, and ownership status
- Enhanced Tooltips: Hover over houses for detailed information
- Rich Statistics: Live market metrics including Gini coefficient and wealth concentration
- Historical Data Tracking: Complete time-series data for all market metrics
- Dual-Chart System: Separate views for percentage metrics (0-100% fixed scale) and financial metrics
- Market Trend Analysis: Housing rates, occupancy rates, wealth inequality over time
- Fixed Scaling: Percentage charts use consistent 0-100% Y-axis for accurate trend comparison
- Data Export: Historical data can be exported for external analysis
num_houses(100): Number of houses in the marketnum_people(100): Number of people in the market
wealth_mean($400,000): Average person wealthwealth_std($200,000): Wealth distribution spread
house_price_mean($300,000): Average initial house pricehouse_price_std($150,000): House price distribution spreadvalue_intrinsicness(0.7): Weight of intrinsic value vs. market price in house valuationvacant_depreciation(0.05): Yearly value loss for unoccupied houses (5%)
turnover_in(2): People entering market per tickturnover_out(2): People exiting market per tickupgrade_threshold(1.5): Minimum value multiplier for homeowner upgradesn_auction_steps(3): Number of auction batches per tick
simulation_speed(1000ms): Time between simulation ticksstarting_year(2025): Initial simulation year
- Light Red: Available for auction
- Light Orange: Just became available (recently vacated)
- Light Green: Occupied
- Light Blue: Just bought (recently occupied)
- House ID: Displayed as "H1", "H2", etc.
- Current Value: Shown in thousands (e.g., "250k")
- Ownership Years: Shows how long current owner has lived there
- Population Metrics: Total people, housed vs. unhoused
- Wealth Distribution: Average, median, Gini coefficient
- Market Activity: Occupancy rate, recent trades, affordability ratio
- All participants bid their full wealth (simplified but effective model)
- Homeless people bid on any house they can afford
- Homeowners only bid on houses worth ≥1.5× their current home value
- Wealth inequality creates natural market stratification
- Vickrey auctions ensure efficient price discovery
- Turnover provides market liquidity and prevents stagnation
- Vacant depreciation encourages housing utilization
- Batch auctions create more dynamic trading patterns
- Wealthy newcomers often outbid existing residents
- Market cycles emerge from turnover and wealth distribution
- Price appreciation occurs through competitive bidding
- Wealth concentration develops over time
- Housing shortages can develop if turnover is imbalanced
This simulation is designed to explore:
- Wealth inequality effects on housing markets
- Auction mechanism efficiency in real estate
- Market stability under different turnover rates
- Price discovery in competitive housing markets
- Policy impact modeling (via parameter adjustment)
- Start: Begin or resume the simulation
- Pause: Temporarily halt the simulation (can be resumed)
- Step: Advance exactly one tick
- Reset: Return to initial state with new random seed
- Speed Slider: Adjust time between ticks (100ms - 3000ms)
- Market View: Display interactive house grid with tooltips and real-time market activity
- Analytics View: Show historical charts with percentage trends and financial metrics
- Architecture: Object-oriented JavaScript with ES6 classes
- Rendering: HTML5 Canvas with real-time updates
- Testing: Comprehensive unit and integration test suite
- Performance: Optimized for 100+ houses with smooth performance
- Browser Compatibility: Modern browsers supporting ES6+
├── index.html # Main application page
├── css/style.css # Styling
├── js/
│ ├── main.js # Application entry point
│ ├── core/ # Core simulation logic
│ │ ├── Market.js # Market management
│ │ ├── Person.js # Person behavior
│ │ ├── House.js # House properties
│ │ ├── Auction.js # Auction mechanics
│ │ └── AnalyticsHistory.js # Time-series data tracking
│ ├── ui/ # User interface
│ │ └── SimulationRenderer.js # Canvas rendering & analytics views
│ └── utils/ # Utilities
│ ├── Config.js # Configuration management
│ ├── MathUtils.js # Mathematical utilities
│ └── ChartRenderer.js # Chart visualization
└── tests/ # Test suite
├── unit/ # Unit tests
└── integration/ # Integration tests
See ROADMAP.md for future development considerations.
Run tests with: node run_tests.js
Built for economic research and educational exploration of housing market dynamics.