Skip to content

lbenz730/soccer_hfa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

soccer_hfa

A repository for exploring home field advantage (hfa) in soccer for matches played without fans due to the ongoing COVID-19 pandemic.


Files

  • 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.

Results (Updated 2020-08-23)

About

Analysis of home field advantage in soccer w/out fans (during COVID-19)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published