This repository contains the materials and code for our Bayesian Data Analysis project, completed as part of the Bayesian Data Analysis course instructed by Aki Vehtari at Aalto University.
The project investigates the time it takes for professional tennis players to reach the global top 20 rankings, using Bayesian modeling techniques. We utilized Gamma and Gaussian models to explore regional and country-level effects.
- Goal: Analyze the time it takes for tennis players to reach the global top 20 and identify regional/country-level effects on their progression.
- Dataset: Sourced from Kaggle, containing 106,716 rows with 49 variables such as:
- Match-level: Date, Surface, Duration
- Player stats: Name, Nationality, Age
- Rank info: Winner Rank, Loser Rank, Rank Points
- Regional and country-level effects significantly influence the time to top rankings.
- Gamma models performed better than Gaussian models in capturing variability, despite some challenges with rare rapid risers.
- Weakly informative priors ensured generalizability while balancing model stability.
data/: Contains the dataset (ensure appropriate licensing for redistribution).src/: Scripts for preprocessing, model fitting, and visualizations.docs/: Beamer presentation and associated materials.images/: Visualizations used in the presentation.models/: Code and outputs for Gamma and Gaussian models.
-
Gamma Model:
- Designed for skewed, positive data like time-to-event.
-
Gaussian Model:
- Symmetric model assuming normally distributed data.
- Weakly informative priors were selected to ensure stable convergence:
- Gamma model intercept: log-scale.
- Gaussian model intercept.
-
Model Performance:
- Gamma model: Better generalization with elpd_loo= -1543.9.
- Gaussian model: Higher sampling efficiency but less reliable predictions.
-
Posterior Predictive Checks:
- Gamma model outperformed in capturing variability of rare rapid risers.
- Gaussian model over-predicted negative times (unrealistic for this problem).
-
Key Findings:
- Players from Sweden and Russia exhibit shorter times to reach the top 20.
- Asian players perform well on clay courts.
-
Requirements:
- R with
brmsandggplot2packages installed. - LaTeX distribution for rendering Beamer presentations.
- R with
-
How to Run:
- Clone the repository:
git clone https://github.com/rezasoumi/BayesianDataAnalysis.git
- Run preprocessing and modeling script from the top of the code
- Clone the repository:
- Instructor: Aki Vehtari for his guidance during the Bayesian Data Analysis course.
- Tools: R,
brms, and Beamer for LaTeX presentations. - Dataset: Kaggle's tennis dataset.
This project is licensed under the MIT License. See LICENSE for details.
For questions or collaborations, feel free to reach out:
- Reza Soumi: reza.soumi@aalto.fi
- Alireza Honarvar: alireza.honarvar@aalto.fi