Monday, 9 July 2012

Calculating Goal Expectancy


Way back in January, I did a post on how to understand Poisson (see entry HERE) and how it could be used to estimate various score lines between two teams. This was just a basic get-you-started guide, but it was generally well-received and generated a fair few comments. 


The post, however, while being all well and good, did rather leave everyone hanging because one of the corner-stones of being able to calculate Poisson to any degree of accuracy comes from having each team's attack and defence parameters to hand. When you have the attack and defence parameters, you can then calculate each teams scoring ability - in other words you will know the goal expectancy for each team.


Now that the Euros have come to an end, we have a natural, albeit brief, pause before all the European leagues kick-off again in August and September, so this seems like a good point to pop in some more analytical posts, rather than my normal "ooh", this is what I won/lost kind of entries.

Recap:
If you haven't read my post on Poisson and/or you haven't got a clue what I'm talking about, then do have a read of that post first. Briefly, however, given each team's scoring ability, (or goal expectancy) then we can use Poisson to generate probabilities for any scoreline. This is good for betting/trading in the correct score market, but can also be used for match odds, over/unders and asian bets.


But, as mentioned, the scoring ability bit was omitted from that post, so let's rectify that here. If you remember, in the horrible Poisson calculation we had this little symbol, "µ". This is from the Greek alphabet and is pronounced as "mu". In the Poisson calculation, this was used as a placeholder for the scoring rate of a particular team. So if we wanted to find out the actual scoring rate for Man City when playing at home last season, we would need to work out the actual value of µ. This is achieved thus:

µ = A1 x D2 x H

The value of µ is calculated as the attack rating of the home side (A1) times the defence rating of the away side (D2) times the home advantage value (H).


Oh dear, so we've now got to work-out three different values to get to our scoring rate? Well, we should do really, yes... but we don't absolutely have to do so.


It's at this point that I have a decision to make because there are different methods for calculating attack and defence parameters, and some are easier than others. The best method (in my view) is also the most complicated to explain and the most difficult to implement, and that's a method called Maximum Likelihood Estimation (or MLE). MLE basically uses best estimates for each attack and defence parameter, in addition to the home advantage parameter, by settling on a set of values that produce probabilities which actually reflect the real scorelines when looking at historical data. In other words, MLE is a "best fit" technique.


The problem is that calculating MLE would involve some detailed maths and some medium to advanced Excel, which personally I feel may be at odds with the rather simplistic approach I took when explaining Poisson in the first place. Afterall, what's the point in a dummies guide if the completion of that guide then moves on to advanced calculations?


You may strongly disagree with me here; you may think this is a cop-out or that I'm being outrageously patronising, but for now I'm going to leave MLE behind and show you a more "accessible" method for generating these values.

Before I do so, you may remember that I have already provided one method for calculating these values. I did it in my Fag Packet Calculations post, so have a look at that if you want a really rough-and-ready method.


Goal Expectancy Method:
Okay, let's get down to brass tacks:
  • CityOverallRate = Man City scored 93 goals in 38 Premier League matches last season. If we divide one figure by the other ( 93 ÷ 38 ) we get 2.45
  • WiganOverallRate = Wigan scored 42 goals in 38 Premier League matches last season. If we divide one figure by the other ( 42 ÷ 38 ) we get 1.10
  • CityHomeRate = Man City scored 55 goals at home and 38 goals when away. Again, if we divide one figure by the other (55 ÷ 38 ), then we get a multiplication factor to show us how much better City are at home compared to when they are away. The result is 1.45.
  • WiganAwayRate = Wigan scored 22 goals at home and 20 goals when away. This time we reverse the division (away divide home) because we want to know Wigan's multiplication factor when playing away. This is (20 ÷ 22 ) = 0.90.
Right the home side's scoring rate can now be calculated as:    CityOverallRate X CityHomeRate and the away side's scoring rate can be calculated as: WiganOverallRate X WiganAwayRate

         Man City Scoring Rate = 2.45 X 1.45  = 3.55
         Wigan Scoring Rate    = 1.10 X 0.90  = 0.99

So the goal count looks high. These scoring rate values can be plugged into Poisson now and used to calculate each individual scoreline. In Excel, Microsoft have kindly provided a Poisson function that we can use, so even though I explained the details behind how Poisson works, the truth is that you don't really need to know. Instead you can just plug the appropriate values into the function.

The POISSON() function in Excel takes three arguments; they are, "X", "Mean" and "Cumulative".

If you did revisit my Poisson post, then you'll recognise the "X" value, as that is the number of goals we're interested in. For example, if you want to know the likelihood of Man City scoring 2 goals, then "X" becomes 2.

The "Mean" figure is simply our scoring rate, which we calculated above - so for Man City that would be 3.55.

The "Cumulative" parameter is either TRUE or FALSE. If set to TRUE, then the result will return the cumulative probability between zero and "X", where as FALSE returns exactly "X". For our purpose, we should set it to FALSE. The POISSON function for finding out how likely Man City scoring two goals is then:

=POISSON( 2, 3.55, FALSE)

The answer is 0.181001136, or 18%.

Ideally you should complete a full set of POISSON calculations for all scores from 0 to 10 goals for both the home and away sides. You can then do things like add-up all the home win scorelines, draw scorelines and away win scorelines to produce match odds. The same can be done for overs and unders.

Outstanding Issue:
There is still one other issue that I mentioned in my original Poisson post back in January, and that's the weighting that needs to be applied to Poisson to prevent it from underforcasting score draws and low-score home wins. Judging from my normal output on this type of post, I'd say you only have six months or so to wait before I get round to talking about this. :-)

Sunday, 8 July 2012

The Ropey League



The first qualifying round of the Europa League was played today... Yes, that's right. I do realise that it's early July but the Europa League has indeed started already.


Without doubt, this competition has got to be one of the most ludicrous, bloated, long-winded tournaments in history. Starting in July, there are three qualifying rounds, a play-off round, a group stage and five knockout rounds, before two teams finally drag their weary arses to the final in May, some ten months later. The competition is now so elongated that it's made a mockery of itself, and it's no wonder top teams are reluctant to be in it.

This wasn’t too bad a tournament back in the days when it was called the EUFA Cup, but it’s now so large and unwieldy that even my local pub, The Kings Arms, are in the opening qualifying rounds. 


If a team manages to battle it's way through the qualifying rounds (two matches in each round), they then face the group stage, which is 12 groups of four teams. That's right, forty-fucking-eight teams fighting to get through to the knockout phase of the tournament.


The Group stages finally finish in December, but even then, if a team makes it through, they haven’t managed to whittle their opposition down to 23 other teams. No, because a huge bunch of Champions League losers are parachuted in, bulking the numbers back up to 32 teams again. To win the competition from the group stages, a team has to get through 15 matches in addition to their other league and cup commitments. What a slog!


The Europa League really should be looked at afresh, as it’s been horribly devalued by too much meddling. Now it's almost comical. Of course, as a trader of football, the Europa League is actually quite good for me. If there are additional matches on the goggle-box for me to trade, that’s all well and good.


__________________________________________


Received this comment today:

Anonymous8 July 2012 22:23
Hi, I'm really interested in football trading, but I'm afraid to start with real money. Is there a way to "practice" just like play money in online poker?

There are some clever bits of software out there that do allow you to run in practice mode, but they tend to cost money and so you may as well start-off actually using some money. You can however, practice with £2.00 stakes and, if trading, then you'll probably only be risking a fraction of that £2.00 on each trade, therefore the risk and your exposure are very small indeed. 


It's also been said before and I think it's true, that trading with real money is different to trading with fake money. You will react differently if it's real money, and that's valuable learning indeed; and if you trade large sums, the money you put into the market will go on to affect the actual behaviour of that market. Fake money can never do this.

So start small and start slowly. Don't be too eager to find an opportunity, but rather let an opportunity present itself to you. That way you'll do fine.

Oh and my last piece of advice is don't listen to people who plop blogs out onto the internet and waffle on about trading as if they actually know what the hell they're talking about. I hate those kind of people, don't you?

Tuesday, 3 July 2012

Only a month to go...


That is, only a month or so to go before the new season starts, which is just fine by me. That allows me a bit of time to recharge my trading batteries, so to speak, and to work on some new stats and ideas that I have. I suspect that I'm not going to finish these before the season does indeed start, but I can continue working on them even then.

So, what about those European Championships, huh? Pretty, pretty, pretty good - as Larry David might say. In my estimation there were only one or two boring games, with most of them being thoroughly entertaining. This may be due to the truncated nature of the tournament compared to the World Cup, but most of the matches did seem to buck the trend (and indeed most bookies estimations) of how the games would pan out.

Before I reflect on my own trading performance throughout the tournament, I think it's only right and proper that we hand out some awards:

Personally, I'd give the best player award to Andres Iniesta, who is an absolutely fabulous player. Incidentally, he also wins the award for the player with the whitest, smoothest and shiniest head in the Euros. He looks like Casper. Then we have Mario Ballotelli, who surely must win sweatiest player of the tournament. He must have shed 20 pounds per match.

Special mention, however, has to go to our new England manager, "Woy" Hodgson. Without doubt, Hodgson wins the Gutless Fucker Of the Year award, a man only interested in not losing, rather than having the balls to go out and try to win. No one really expected us to get beyond the quarter finals, but to go out so meekly without really giving it a go was absolutely infuriating. Leaving Rooney on the field when he was doing nothing; leaving Ashley Young on the field when he couldn't put a foot right (did he complete more than three or four passes without losing the ball?); bringing on the waste of oxygen, Jordan Henderson, a man so far away from international class that it's beyond belief.

Ah, well, I could go on but where's it going to get me? I'll let you fill-in the blanks of my rantings for yourself.

_______________________________


Okay, so how did I fare in the Euros? Nothing too amazing either way. I lost money on the final but finished just over £830 in profit across the whole tournament, which I realise is not world-beating but is also not too bad considering I'm just sitting there enjoying watching my favourite sport. There's not much that can better that, is there? Earning money doing something you enjoy. Maybe if someone gave me a tenner each time I had a wank, then I'd relegate my trading to second place, but right now I haven't found anyone around who is willing to put forward such an offer. 


Football: -£24.02 | Tennis: £42.84 | Tote: |  Total P&L:  £18.82

 

Football Showing 1 - 8 of 8 markets

Market Start time Settled date Profit/loss (£)
Football / Spain v Italy : Winner 2012 01-Jul-12 19:45  01-Jul-12 21:42  1.36
Football / Spain v Italy : Match Odds 01-Jul-12 19:45  01-Jul-12 21:37  11.23
Football / Spain v Italy : Over/Under 3.5 Goals 01-Jul-12 19:45  01-Jul-12 21:33  1.17
Football / Spain v Italy : Correct Score 01-Jul-12 19:45  01-Jul-12 21:32  -178.49
Football / Germany v Italy : Correct Score 28-Jun-12 19:45  28-Jun-12 21:45  20.94
Football / Germany v Italy : Over/Under 2.5 goals 28-Jun-12 19:45  28-Jun-12 21:37  15.28
Football / Portugal v Spain : Correct Score 27-Jun-12 19:45  27-Jun-12 21:36  105.86
Football / Portugal v Spain : Match Odds 27-Jun-12 19:45  27-Jun-12 21:35  -1.37


_______________________________


With the Euros now finished, I suppose I should turn my attention to trading the tennis. However, even though I've had some small dabblings, I can't really drive up my interest to give it a proper go. I'm looking forward to having a break not trading, and the thought of continuing on all through the summer (what little summer we're getting) doesn't really appeal to me. I suppose this is another reason I will never make a full-time trader. I need some wind-down time.

I'll endeavour to pop one or two interesting posts up between now and the new footy season, but do expect them to be a little sporadic now. Instead I'll be barbequeing in my garden... even if it's 10 degrees and in horizontal rain. It's summer afterall!

Monday, 25 June 2012

Mən yalnız İngilis anlamaq

I've, perhaps thankfully, missed out on trading the last two quarter final matches. I was out with my good lady wife on Saturday and in the pub with a raucous crowd watching the England match last night. I suppose it's all been said already, but by the time England went out, I was a little past caring. Their match play was so negative, dull and infuriating that I almost wanted them to lose by that stage.
 
__________________________________


I've had a couple of (loosely related) comments on my blog over the last couple of days. After my Greece entry, I received this kind comment:


Anonymous22 June 2012 21:52
fuck you...ELLAS YIA PANTA!!!



Yes, thank you. In case any of you were wondering, the second part means "Greece Forever". As for the first part... erm... well it's all Greek to me I'm afraid

My second comment, on the same entry, was this:

Raymond25 June 2012 19:23
Hi there,

Nice blog. Ben je nederlands? Zie de blogspot extensie op .nl ??
Lijkt me tof om eens te sparren over trading.
Gr R.

For those of you not from Raymond's neck of the woods, the translation is:

Are you Dutch? See the blogspot extension. nl? Seems cool to have a chat over trading.

I'm not too sure what Raymond is referring to. As far as I know, my web address is http://footytradingposts.blogspot.co.uk. If he is seeing a .nl extension then I don't know why that should be. Anyway, sorry to disappoint you Raymond but I'm English. Thanks for the comment though. At least you didn't swear at me.

Oh, and in case you were wondering what my post title is on about, I thought that seeing as I've had to resort to using Google Translate, I would translate my title into Azerbaijani. Translate it yourself if you want.

TTFN.


Friday, 22 June 2012

Greece Leave the Euro Twice


They left the first time tonight (thankfully) and will probably leave the Euro (currency-wise) later in the summer. Despite the raft of goals, my trading was all straightforward tonight, which is just the way I like it.

Just a quick post tonight, as I have to go and pick my daughter up from a party. I will be posting some (hopefully) more interesting posts when the Euros finish in July:



Football: £90.47 | Tote: |  Total P&L:  £90.47

 

Football Showing 1 - 6 of 6 markets

Market Start time Settled date Profit/loss (£)
Football / Germany v Greece : Over/Under 6.5 Goals 22-Jun-12 19:45  22-Jun-12 21:42  7.47
Football / Germany v Greece : Over/Under 5.5 Goals 22-Jun-12 19:45  22-Jun-12 21:34  24.28
Football / Germany v Greece : Correct Score 22-Jun-12 19:45  22-Jun-12 21:20  15.15
Football / Germany v Greece : Over/Under 3.5 Goals 22-Jun-12 19:45  22-Jun-12 21:14  1.81
Football / Germany v Greece : Over/Under 2.5 goals 22-Jun-12 19:45  22-Jun-12 21:07  12.05
Football / Germany v Greece : Half Time Score 22-Jun-12 19:45  22-Jun-12 20:34  29.71




Thursday, 21 June 2012

It's Mega!

I don't know if anyone else has entered Betfair's Megaminute competition, but it's one of the few offers of theirs that I bother participating in. I'm betting on the event anyway, so it's effectively free entry and is well worth a punt. If you're not familiar with the competition, you just have to guess the minute the first goal will be scored. It's a bit of a stab in the dark, but as I say, there's nothing to be lost.


Betfair have run this regularly during the normal Premiership season, offering £1,000 (or a share of it) for any correct guesses. I managed to win £50 from it a while back (see below), but during the Euros they've upped the prize pot to £5,000. I'd say this is well worth it. If 20 people guess correctly (as happened when I won it), then that's still £250 if you're one of them. If you want to enter for tomorrow's match, this is the link.


2010-12-28
15:29 13339184 2010-12-28
978-XXS003-CRM-MegaMinute villavtottenham ADJ43 - - - 50.00 
My winning guess

_________________________________


On the actual betting front, all much ado about nothing, I'm afraid. Yesterday I traded out of my lay dutch of the winners market as the downside was too uncomfortable. So that's a £16 loss, but that's okay. I also had a fun bet on a GG at Ascot yesterday. It lost. Then I had a small test bet that I duly forgot about in this evening's quarter final in the half-time score market, so I lost £18 there too.

The only actual proper trading I did was on the full-time correct score market, where I managed to pick-up just over £50. So a stunningly dull tenner profit today, which was hardly worth bothering about. Apologies for the extreme dullness of it all.


Football: £34.98 | Horse Racing: -£24.25 | Tote: |  Total P&L:  £10.73

 

Football Showing 1 - 4 of 4 markets

Market Start time Settled date Profit/loss (£)
Football / Czech Republic v Portugal : Correct Score 21-Jun-12 19:45  21-Jun-12 21:39  51.72
Football / Czech Republic v Portugal : Over/Under 1.5 Goals 21-Jun-12 19:45  21-Jun-12 21:38  5.33
Football / Euro 2012 : Winner 2012 08-Jun-12 17:00  21-Jun-12 21:37  -3.47
Football / Czech Republic v Portugal : Half Time Score 21-Jun-12 19:45  21-Jun-12 20:32  -18.60

Tuesday, 19 June 2012

Let The Overreactions Begin


Well, England have won a match of Association Football this evening, so I suppose it's only right and proper that we now all stand up in our living rooms, dressed smartly in our St. George's underpants, snap out a crisp and efficient salute and boldly declare England to be the greatest football team ever to grace this small and wonderful orb that we fondly call The Earth!


Yes, bipolar nation that we are, let's all flip from morbid depression at our bleak and dire prospects as a footballing nation to absolute cast-iron certainty that we're going to lift the European Championship trophy on 1st July. We only have to beat Italy, Germany and one other top team in the final. Piece of piss.

I sound rather heartless and negative, but of course I want us to do well. There'll be no one more delighted than me if we do somehow manage to progress to the final. But perhaps just a small amount of calm and perspective along the way might just be a good thing. What do you think?

__________________________________


I'm back in my hotel again tonight, and so after having my fingers burnt a little bit last week, I traded the England match using a low-impact, low-risk trading methods. This means rather low profits but I prefer that to silly losses. Before the tournament started, I layed Ukraine to make it out of our group so that small win also came in today. My lay dutch is now looking a little worse than it did yesterday and I'm now showing a £15 red. I've placed orders to close some teams off should they drift, which will effectively scratch those teams. Either way, I don't think I'll be making much money out of this little approach.


Football: £76.55 | Tote: |  Total P&L:  £76.55  

 

Football Showing 1 - 3 of 3 markets

Market Start time Settled date Profit/loss (£)
Football / England v Ukraine : Correct Score 19-Jun-12 19:45  19-Jun-12 21:39  25.37
Football / Group D : To Qualify 11-Jun-12 17:00  19-Jun-12 21:39  47.60
Football / England v Ukraine : Match Odds 19-Jun-12 19:45  19-Jun-12 21:36  3.58



__________________________________




I got this message today on my old match odds compiling post:


jking715 June 2012 14:21
Hi. I'm trying to do a test of the Goal Supremacy system. I have the data of the PL 2011/12 matches in an excel document and now I need a good COPYABLE function to calculate the goal differences.


Thanks for your help.


Grabbing a rolling figure for the last six matches is the trickiest part of this system. There's no absolute correct way and I'm sure there are some Excel gurus out there that can easily improve on the method I use, but here goes.

After downloading the data from football-data, I add some additional columns. One of these is a count of the games that each team has played, so if my teams are in columns B and C (home and away), then my count on each row would be:

=COUNTIF($B$2:B9, B10)+COUNTIF($C$2:C9, B10)+1

If you had plonked this in G10 for example, then you could simply drag this formula down and it will auto-populate the column all the way down. You'd then need to do the same for the away column.

Okay, so this gives us a count of each team's games, but how do we look-up their goal count over the last six matches using this additional information. Again there are plenty of ways to skin a cat, but I add two more columns that I use as lookups. I concatenate (or join) the team name with their game count (team_name & game_count) and then look for all the relevant matches. So if Liverpool had played 15 matches and I wanted to find all their goals scored over the last six matches, I would search for these strings:

Liverpool14
Liverpool13
Liverpool12
Liverpool11
Liverpool10
Liverpool9

This is the my actual formula (goals scored home and away over the last six matches):

=IF(G41<7, "", (SUMIF($H$2:H40,B41&(G41-1),$D$2:D40)+SUMIF($J$2:J40,B41&(G41-1),$E$2:E40)+SUMIF($H$2:H40,B41&(G41-2),$D$2:D40)+SUMIF($J$2:J40,B41&(G41-2),$E$2:E40)+SUMIF($H$2:H40,B41&(G41-3),$D$2:D40)+SUMIF($J$2:J40,B41&(G41-3),$E$2:E40)+SUMIF($H$2:H40,B41&(G41-4),$D$2:D40)+SUMIF($J$2:J40,B41&(G41-4),$E$2:E40)+SUMIF($H$2:H40,B41&(G41-5),$D$2:D40)+SUMIF($J$2:J40,B41&(G41-5),$E$2:E40)+SUMIF($H$2:H40,B41&(G41-6),$D$2:D40)+SUMIF($J$2:J40,B41&(G41-6),$E$2:E40)))

Looks a bit of a mess, doesn't it? Really I should provide a "name" for certain columns. This is something I normally do as it makes formulas much easier to read, but I haven't in this case. Once again, this formula is "draggable" and so will always grab the rolling count of goals scored by any team in question.


I hope this is the answer to the actual question that you were asking me, but if it isn't then perhaps it still gives you the basic idea of what you need to achieve.