Application for predicting football results
This is an application developped using C++ and the framework Qt5
This application uses quite a lot of Qt's features.
Well to put it simply, I use Poisson distribution to predict how many occurences a certain number of goals is bound to happen (i.e scored).
The calculation process is explained quite elaborately in this beautiful article
tl;dr: for a team, we need the average number of goals scored and conceded both home and away. We also need the average of goals scored in the league, also home and away. So if for a match, the lambda parameter, which serves as the average used for Poisson distribution, is calculated by multiplying these averages depending on the home and away team. The averages, which are the stats, are calculated using an Excel spreadsheet and stored in a database.
Anyhow, the predictions are preferrably stored in a matrix like this:
Now the most highly likely final result is the one with the highest associated probability, in the example above it's 2-0. Simple, right ?
The most important thing is the stats, which I calculated using a spreadsheet like this:
I then linked this (and other leagues done simlarly) to a database, then linked the database to Qt.
The calculations then are pretty easy, once one chooses the league, then the home/away teams, we retrieve the associated stats using the SELECT FROM WHERE
command and calculate the poisson estimate for n=0,...,6, storing them in a matrix, and displaying the highest number of predicted goals for each team. Just a bunch of for
and if
blocks.
Here's the log, that I set to print some results: