Repository containing code, data & presentation accompanying the manuscript Bayesian Analysis of Formula One Race Results: Disentangling Driver Skill and Constructor Advantage.
Note: version
v1.0
used Beta regression via thebrms
package rather than the currentcmdstanr
rank-ordered logit implementation. Themodel_comparison
folder compares the old and the current implementation.
The scripts contain the following:
Script | Contents |
---|---|
01_prep_data.R |
Data preparation, data joining from database f1db_csv |
02_eda.R |
Some visualisation and exploratory data analysis |
03_model.R |
Creating and estimating models with different predictors |
04_compare.R |
Performing model comparison |
05_check.R |
MCMC validation, posterior predictive checks |
06_infer.R |
Inferences using posteriors of parameters |
07_predict.R |
Counterfactual predictions |
Data f1db_csv
obtained from Ergast developer API on 2022-02-17 uploaded with permission. All data objects (.rds
and .csv
files) are CC BY 4.0 licensed. Code is MIT licensed.
Disclaimer: the ratings shown below are the result of a statistical model and its accompanying simplifying assumptions, estimated using only position data from 2014-2021. Please do not take the ratings as absolute truth.
NB: Presentation picture sources are in the notes.