A Bayesian statistical forecasting tool for predicting ticket sales at live event venues. Originally developed for PianoFight Theater in San Francisco.
This application uses historical event data to predict final ticket sales for upcoming shows. By analyzing patterns from past events with similar characteristics (venue, timing, initial sales velocity), it generates probabilistic forecasts with confidence intervals.
- Bayesian Probability Model — Calculates likelihood of various sales outcomes based on historical data
- Real-time Forecasting — Projects final ticket sales based on current sales and time until event
- Interactive Visualizations — Dynamic plots showing probability distributions and sales trajectories
- Credible Intervals — Statistical confidence ranges for predictions
- Historical Pattern Matching — Identifies similar past events to improve forecast accuracy
- Multi-venue Support — Handles different venue capacities
-
State Definition — Defines a "state" based on current conditions:
- Number of tickets sold (with tolerance range)
- Time until event start (with tolerance range)
- Venue type
-
Historical Analysis — Scans historical events to find matches:
- Filters for events that passed through the defined state
- Tracks their final attendance numbers
-
Bayesian Calculation — Computes probabilities:
P(final_tickets | current_state) = P(current_state | final_tickets)
× P(final_tickets) / P(current_state)
-
Smoothing — Applies weighted smoothing to reduce noise in the probability distribution
-
Confidence Intervals — Calculates credible intervals at specified confidence levels
- Initial Tickets — Current number of tickets sold
- Ticket Delta — Tolerance range for matching similar sales levels (±)
- Time Until Event — Days/hours until the event starts
- Time Delta — Tolerance range for matching similar timeframes (±)
- Smooth By — Smoothing factor for probability distribution
- Confidence Interval — Desired confidence level (e.g., 80%)
- Frontend — Vanilla JavaScript, HTML5, CSS3
- Data Visualization — Plotly.js
- UI Components — Chosen.js for enhanced select dropdowns
- Data Source — Ticketing API (via JSON exports)
- Statistical Method — Bayesian inference
The application expects JSON data files exported from a ticketing platform API:
events-all.JSON— Event dataattendees.JSON— Ticket purchase recordsvenues.JSON— Venue informationreconStats.JSON— Reconciliation statistics
-
Set Initial State parameters:
- Select venue
- Enter current tickets sold
- Enter time until event (days + hours)
-
Adjust Tolerances:
- Ticket Delta: How much variance in ticket counts to include
- Time Delta: How much variance in timing to include
-
Configure Visualization:
- Smoothing factor
- Confidence interval percentage
- Toggle mean line and confidence interval display
-
Click Forecast to generate prediction
- Most Likely Final Tickets — Expected final attendance (mean of distribution)
- Credible Interval — Range where actual result is likely to fall
- Probability Distribution — Shows likelihood of each possible outcome
- Matching Events — Number of historical events that matched your criteria
- Enter an Event ID to see ticket sales over time
- Visualize sales velocity and patterns
- Compare against initial state to see when conditions were met
- Revenue Forecasting — Predict box office performance early in the sales cycle
- Marketing Decisions — Identify shows that need a promotional boost
- Capacity Planning — Optimize staffing and resource allocation
- Show Selection — Evaluate the potential of different productions
- Pricing Strategy — Adjust ticket prices based on demand predictions
Traditional forecasting methods often assume linear relationships or require extensive feature engineering. The Bayesian approach:
- Allows a reasonable forecast to be generated with minimal data
- Handles uncertainty naturally through probability distributions
- Incorporates historical patterns without overfitting
- Provides interpretable confidence intervals
- Works well with limited data by leveraging similar events
- Shows with similar initial sales velocities tend to have similar final outcomes
- Time until event is a critical factor — urgency drives late sales
- Venue capacity creates natural ceiling effects
- Historical patterns from the same show or organizer improve predictions
- Data is cached with random query parameters to prevent browser caching
- Unlisted events are automatically filtered out
- Free, refunded, and cancelled tickets are excluded from analysis
- Attendee data is sorted by purchase date for temporal analysis
- Weight events by room capacity and extend model to all capacities
- Add seasonality factors (day of week, time of year, etc.)
- Allow venues to opt in to share data and improve models collectively
- Real-time API integration instead of cached JSON
- Machine learning ensemble with traditional time series models
- Mobile-responsive design
- Export forecast reports
- Generalize data adapter layer for multiple ticketing platforms
- Processes 1,000+ historical events in real time
- Sub-second forecast generation
- Interactive visualizations with smooth rendering
- Efficient filtering and probability calculations
This repository contains the application code only. Actual event data files are not included as they contain sensitive business information. To run this application you would need to supply your own data exports from a compatible ticketing platform API in the following format:
events-all.JSON— Event dataattendees.JSON— Ticket purchase recordsvenues.JSON— Venue configurationreconStats.JSON— Reconciliation statistics
MIT License — see LICENSE file for details
Originally built for PianoFight Theater's operations team in 2018. Open sourced as a portfolio project demonstrating practical application of Bayesian statistics and real-time data visualization in the live entertainment industry.
