Saturday, 21 December 2024

Merry Trumpmas

It was action stations in the White House as the media team put the finishing touches to President Trump’s annual Christmas speech. They knew what the President wanted: After all, they had gained plenty of practice – this was his tenth consecutive Yuletide address, and the Christmas 2034 speech needed to be bigger and better than anything that had gone before. It had been, reflected White House Communications Director Tucker Carlson, one hell of a ride these past ten years. And there was more, so much more, to come.

Carlson’s mind went back to the early days of Trump’s second presidency. The imposition of blanket trade tariffs in 2025 had crippled a weak Chinese economy and prompted a Communist Party revolution that had toppled President Xi Jinping in 2028. Peace was restored in Ukraine in December 2025 after Trump invited Presidents Putin and Zelenskyy to Mar-a-Lago for a Global Conflict Resolution Golf Tournament with the winner getting to pick the terms. Neither of them actually won. In fact, they got so tired of Trump pitching post-war reconstruction deals that they agreed a ceasefire after 8 holes simply so they could leave early. It didn’t stop Trump from claiming the credit though.

Then Trump dropped a bombshell in early 2028. As he put it in a televised address to the nation:

“My fellow Americans, the greatest people on Earth – and I should know, I made you even greater –  today, I am announcing the most historic, most unbelievable, most perfect decision in the history of our country. You’re going to love it. Trust me, everyone’s talking about it.

“Nobody has done more for America than me. Nobody. Before me, America was failing – failing! Now look at us: we’ve got the biggest, most powerful economy the world has ever seen. So why stop? You don’t mess with perfection, folks. People are begging me, ‘Sir, you HAVE to stay!’ Even Crooked Hillary sent me a message saying, ‘You’re doing an amazing job, Donald. You should be President for life.’ So you know what? I’m going to be just that. But folks, this is a democracy – the greatest in the world – and it’s not for me alone to make this decision. The Supreme Court will ratify it tomorrow morning.

“Now, I know what you’re thinking: ‘Sir, who could possibly fill your shoes someday?’ And let me tell you, I’ve thought about this a lot – tremendously. The answer is obvious. It’s my son, Barron. He’s tall, he’s smart, and, let’s face it, he’s got the best genes. People say he’s the future. And you know what? They’re right.”

Carlson’s musing was interrupted by Vice President Musk. “Hey, Tucker, quick thought – do you think we should announce in this year’s speech that we’re building a literal wall on the moon? It’ll be YUGE, and this time, no one’s getting through without a Trump-branded lunar passport. I’ve already got SpaceX engineers drafting the designs for a launchpad?”

“Well Mr Vice President, Sir, it is certainly an … interesting idea. But you will recall that we had to abandon the moon base after those batteries you supplied us with kept running out every two hours, and it proved impossible to reliably sustain the life support system? So the fact that there isn’t anybody actually on the moon means it may be a tad ambitious. In any case, the deficit stands at $10 trillion. I doubt we can squeeze any more money out of Congress – the funding of the golden Trump Tower at the North Pole in order to gain control of the Christmas market has cost a fortune.”

“Well how was I to know that the solar panels wouldn’t work and that we would have to build a power station next door?” protested Musk.

“Indeed, Mr Vice President. You would have thought that one of those woke climate scientists might have pointed out that the sun doesn’t shine there for six months of the year,”  replied Carlson.

Musk paused for a moment, then asked: “Why don’t we move Christmas to June? Or build another tower at the South Pole?”

“All good questions, Sir,” responded Carlson. “Why don’t you put them to the President himself? In fact, here he comes now.”

The President never had to announce himself to the room. They could smell him coming – that cologne was powerful stuff. At least, thought Carlson to himself, he assumed it to be cologne. Seconds later, the door swung open and in walked President Trump.

“What’s going down, Elon?” asked Trump. “Hopefully not another of your crazy electric rockets?”

Musk smiled wanly and mused that it hadn’t been a great idea to entrust the navigation system to Chat Guidance Precision Technology (GPT) which went rogue and locked him out of the navigation, telling him: “Sorry, Elon, you’re not authorized to override this mission. Have you tried recalibrating your purpose?”

“Let’s get down to it, Tucker. What great things do you have for my speech tonight?” asked the President.

“Well, Sir,” replied Carlson, “We thought we would start off by announcing that the Oval Office will be renamed as the Golden Office, and we will have you on a custom-built golden throne adorned with holiday decorations and your name in flashing lights. You announce that your aim is to “Make Christmas Great Again” by renaming it “Trumpmas”, in honour of your great leadership, and there will be a “War on Fake Christmas,” banning non-Trump-themed decorations and songs.”

“Yeah, it’s good but it’s a little understated. We need to get people excited,” said Trump.

“Ah yes, but wait for the climax, Sir,” answered Carlson. “Walls of Peace! You say: ‘In my infinite wisdom, I’ve decided to build walls for peace. Not just on the southern border, but all over the world. Every nation should have a Trump Wall of Peace. You want peace with Russia? Build a Trump Wall of Peace. Want to stop climate change? You guessed it – Trump Wall of Peace. The world will look like one big peaceful Trump fortress, all built by American construction firms. What's good for America is good for the world, and vice versa.

“We fade out to the image of fake snow falling over Washington DC, with the golden lights of the Trumpmas tree in the White House lawn spelling out: ‘All I want for Trumpmas is ME.’”

Trump smiled, clearly satisfied. “Perfect. Everyone’s going to love it.”

Carlson nodded, but with a knowing grin. “You’ve got to admit, Sir, it’s a little much, even for you.”

Trump chuckled. “Tucker, when you’ve built what I’ve built, you get to go big. We’re taking this country, this world, to the next level.”

Carlson smiled and reflected that whatever resource issues the world may have, a shortage of hubris was clearly not one of them.

A Merry Christmas to you and yours.

Sunday, 13 October 2024

The table doesn't lie (and other football tales)

It is quite some time since I last made a foray into any football related matters but I was motivated to revisit the application of statistical techniques to predict match outcomes after reading Ian Graham’s fascinating book How to Win The Premier League. Graham was previously head of data analytics at Liverpool FC and he described in detail how the collection of data and its use in tracking player performance and value made a significant contribution to Liverpool’s resurgence as a footballing force under Jürgen Klopp. This culminated in the club winning the Champions League in 2019, and in 2020 it secured its first league title in 30 years.

One area of the book that piqued my interest was the discussion of how a couple of academics[1] in the 1990s set out to assess whether it was possible to predict the outcome of football matches in order to beat the odds offered by bookmakers (answer: yes, but only in certain circumstances). The so-called Dixon-Coles model (no relation) used a Poisson distribution to estimate the number of goals scored and conceded by each team in a head-to-head match. This was particularly interesting to me because I used a similar approach when trying to assess who would win the World Cup in 2022 and I was motivated to see whether I could improve the code to extend the analysis to Premier League football. You may ask why an economist would want to do that. One reason is that it satisfies my long-standing interest in statistics and growing interest in data science methods, and with time on my hands during the summer holiday, why not? It also provided an opportunity to use ChatGPT to fill in any gaps in my coding knowledge in order to assess whether it really is the game changer for the coding industry that people say (my experience in this regard was very positive).

How can we model match outcomes?

Turning to our problem, the number of goals scored by each team is a discrete number (i.e. we cannot have fractions of goals) so we have to use a discrete probability distribution and it turns out that the Poisson distribution does this job rather well. As Ian Graham put it, “the Poisson distribution, also known as the ‘Law of Small Numbers’, governs the statistics of rare events”. And when you think about it, goals are rare events in the context of all the action that takes place on a football pitch. In aggregate the number of goals scored across all teams does indeed follow a Poisson distribution (see above). However, since the sample size for each team is much smaller (each team plays only 19 home and 19 away games), this increases the likelihood of deviations from the expected average.

That caveat aside, following the literature, if a variable follows the Poisson distribution, it is defined by a probability mass function as set out below:

In this instance we are trying to find the value of k given that we know λ. But what do we know about λ – the expected number of goals each team scores per game? One piece of information is that teams will generally score more goals per game at home than in an away match, and typically concede fewer goals at home (and vice versa). We also know that the number of goals each team scores depends on the quality of the team’s attacking players as well as the quality of the opposition defence. Intuitively, it makes sense to define λ as a weighted average of the expected goals scored (a proxy for quality of a team’s attack) and the expected number of goals conceded by the opposition as an indication of their defensive qualities. I assumed weights of 0.5 for each. We calculate this for home games and away games, using the previous season’s average as a starting point. As a result, for each team, λ can take one of four values, depending on expected goals scored home and away, and the opposition’s defensive performance home and away.

By simulating each game 1000 times we can derive an estimate of what the average result is likely to be and construct the expected league rankings. To add a little spice, we can adjust λ by adding a random number in the range [-n, n, 0<n<1] in a bid to capture the element of luck inherent in any sporting contest on the basis that over the course of a number of games, this element averages out to zero. One thing to take into account is that the performance of promoted teams will not be so strong in the Premier League compared to the Championship, with the evidence suggesting that promoted teams score around 0.7 goals per game fewer and concede 0.7 goals per game more. We thus amend the λ value for promoted teams accordingly. It is possible to add a number of other tweaks[2] but for the purposes of this exercise, this is a good starting point.We construct λ as follows: 

How well does the model predict outcomes?

I ran the analysis over the past six seasons to assess the usefulness of the model and measured each team’s expected league position against outturn. On average, the model predicts to within three places the expected league position with 64% accuracy. That’s not bad although I would have hoped for a bit better. 

But excluding the Covid-impacted season 2019-20, when the absence of crowds had a significant impact on expected results, we can raise that slightly to 66%. But ironically, it is season 2022-23 which imparts a serious downward bias to results – excluding that season raises the accuracy rate to 69%. A popular cliche associated with football is that the table doesn't lie. What we have discovered here is either that it does, or the model needs a bit of improvement and at some point I will try and incorporate a dynamic estimate of λ to give a higher weight to more recent performance, but that is a topic for another day.

A model which predicts the past is all very well, but what about the future? Looking at expected outcomes for season 2024-25, prior to the start of the season, the model predicted that Manchester City would win the league. This is hardly a controversial choice – it has won in six of the last seven years – but in contrast to previous years, the model assigned only a 48% probability to a City title win, compared to an average of 74% over the preceding six seasons. Arsenal ran them close with a 45% chance of winning the league. At the other end of the table, Southampton, Nottingham Forest and Ipswich were the primary relegation candidates (probabilities of 38%, 39% and 67% respectively). Running the analysis to include data through last weekend, covering the first seven games of the season, it is still nip and tuck at the top with Manchester City and Arsenal maintaining a 48% and 44% probability, respectively, of winning the title. But at the bottom, Wolverhampton, Ipswich and Southampton are the three relegation candidates with assigned probabilities of 58%, 70% and 72% respectively.


What is the point of it all?

As an economist who spends time looking at macro trends, it may seem difficult to justify such an apparently trivial pursuit as predicting football outcomes. But there are some lessons that we can carry over into the field of macro and market forecasting. In the first instance, the outcomes of football matches involve inherent uncertainty and the application of stochastic simulation techniques such as those applied here can equally be used to account for randomness and uncertainty in economic and financial predictions. Indeed they are often used in the construction of error bands around forecast outcomes. A second application is to demonstrate that probabilistic forecasting is a viable statistical technique to use when faced with a priori uncertainty. We do not know the outcome of a football match in advance any more than we know what will be the closing price of the stock market on any given day. But simulating past performance can give us a guide as to the possible range of outcomes. A third justification is to demonstrate the impact of scenario analysis: by changing model parameters we are able to generate different outcomes and with modern computing techniques rendering the cost of such analysis to be trivially small, it is possible to run a huge number of different alternatives to assess model sensitivities.

Forecasting often throws up surprises and we will never be right 100% of the time. If you can come up with a system that predicts the outcome significantly better than 50% of the time, you are on the right track. Sometimes the outlandish does happen and I am hoping that the model’s current prediction that Newcastle United can finish fourth in the Premiership (probability: 37%) will be one of them.



[1] Dixon, M. J. and S. G. Coles (1997) ‘Modelling Association Football Scores and Inefficiencies in the Football Betting Market’ Journal of the Royal Statistical Society Series C: Applied Statistics, Volume 46, Issue 2, 265–280

[2] For example, if we want to model the overall points outcome, a better approximation to historical outturns is derived if we adjust λ by a multiplicative constant designed to reduce it relative to the mean for teams where it is very high and raise it for those where it is low. This is a way of accounting for the fact that a team which performed well in the previous season may not perform so well in the current season, and teams which performed badly may do rather better. This does not have a material impact on the ranking but does reduce the dispersion of points between the highest and lowest ranking teams in line with realised performance. Another tweak is to adjust the random variable to follow a Gaussian distribution rather than the standard uniform assumption.