A repository for exploring home field advantage (hfa) in soccer for matches played without fans due to the ongoing COVID-19 pandemic.
- hfa_sims.R: Functions to simulate the distribution of expected home points, using both FiveThirtyEight's Soccer model (with 10% reduced hfa) as well as my own model which mimicks FiveThirtyEights model but can have variable hfa.
- model_fit.R: Functions to fit model that allows for variable hfa.
-
prediction_helpers.R: Functions that translate predicted scoring rates (
$\lambda_1$ ,$\lambda_2$ ) into (win, loss, draw) probabilities. - xg_graphics.R: Functions for plotting shot- and non-shot- based expected goals graphics.
- pipeline.R: Data pipeline to run all of the above scripts for a given league.
Each league has a folder which contains the following objects:
- figures/: Graphics from simulations and xG analysis
- model.rds: League specific model used in sims
- simulations/:
- sims.csv: csv with simulation results for expected points by hfa reduction between 0 - 100%
- simulation_ecdf.csv: csv w/ empirical P(simulated home points <= obsevered home points | hfa reduction)
More background on the methodolgy behind this analysis can be found here.
Updates: 2020-06-11:
- Add 95% CI to graphics
Updates: 2020-06-09:
- Refactor to take config file and add logos to graphics.
Updates: 2020-06-04:
- Change model to predict FiveThirtyEight
$(\lambda_1, \lambda2)$ (rather than predict score directly) for better calibration in leagues with less training data. - Inflate draw probabilities using FiveThirtyEight's draw_inflation_factors.csv provided by Jay Boice.
















