This talk by Wesley Bulra demonstrates the application of Bayesian time series decomposition to analyze Formula 1 race data using the PyMC framework. The presentation breaks down complex lap time data into interpretable components, such as a baseline trend influenced by fuel burn and track evolution, the impact of tire degradation, and outliers like pit stops. A key technique showcased is the use of Radial Basis Functions (RBFs) to model the highly non-linear, cyclical patterns found in high-frequency telemetry data, effectively capturing the "seasonality" of a single lap. Furthermore, the talk introduces multi-level (hierarchical) models to address the classic "car vs. driver" debate by simultaneously estimating the performance contributions of individual drivers and their respective teams. Through a case study of the Japan Grand Prix, the framework is presented as a flexible tool for quantifying uncertainty, running simulations, forecasting performance, and detecting anomalies.
Analyzing Formula 1 with Bayesian Time Series Models
0:00:35 Introduction to Bayesian F1 Analysis: The talk introduces a framework for analyzing Formula 1 race data using Bayesian time series decomposition with PyMC to answer strategic questions about fuel burn, tire degradation, and driver vs. car performance.
0:02:47 The Power of Bayesian Uncertainty: The approach uses Bayesian methods to move beyond simple point estimates. By using priors and sampling (MCMC), it produces posterior distributions for model parameters, which crucially include measures of uncertainty, showing how confident the model is in its estimates.
0:05:41 Case Study Data: Japan Grand Prix: The analysis uses lap time data from the Japan Grand Prix. The raw data shows a clear downward trend as cars get faster throughout the race, along with significant outliers caused by pit stops.
0:07:44 Decomposing Performance Factors: The model is built by decomposing the time series into several additive components that affect lap time:
Trend: A general trend of decreasing lap times due to factors like fuel burn (lighter car) and track evolution (more rubber on the track).
Tire Degradation: A component that models the gradual loss of performance as tires wear out. The model learns different degradation rates for different tire compounds.
Outliers: Specific components are added to account for time lost during the first lap (influenced by grid position) and the in-lap/out-lap cycle of a pit stop.
0:14:10 Modeling In-Lap Seasonality with RBFs: To model the repeating, non-linear pattern of speed within a single lap, the talk uses high-frequency telemetry data. Radial Basis Functions (RBFs) are employed as a flexible technique to fit this cyclical "seasonality," providing a near-perfect model of a driver's typical lap profile.
0:17:43 Using Residuals for Anomaly Detection: The difference between the model's prediction and the actual telemetry data (the residuals) can be used to detect anomalies, such as a driver making a mistake or deviating from their consistent performance pattern.
0:18:24 Multi-Level Models: Disentangling Car vs. Driver Performance: A multi-level (or hierarchical) model is introduced to analyze all drivers and teams simultaneously. This structure allows the model to estimate the performance contribution of the car separately from that of the driver.
0:20:59 Key Insights from the Multi-Level Model: For the Japan Grand Prix, the model's results suggest that McLaren had the strongest car and that Max Verstappen significantly outperformed his car, while also showing how closely matched the two McLaren drivers were.
0:22:49 Practical Applications: The completed framework can be used for practical strategic applications, including simulating the impact of different pit stop strategies, running counterfactuals (e.g., "what if this driver were in that car?"), and forecasting.
0:27:48 A Flexible Modeling Framework: The key takeaway is that combining time series decomposition with a Bayesian approach in PyMC creates a powerful and flexible framework. It allows for the inclusion of specific domain knowledge through priors and provides rich, uncertainty-aware outputs.