Monday, September 10, 2012

Combining Win Probability Model With Live WP Graph

by Tom Baldwin

Andrew Foland provided a solution to this all the way back in January 2011, but it has not been implemented, perhaps because of the complexity of the solution, perhaps simply because nobody has got around to it yet, whichever the case I am here to provide a simple alternative and hope it gets implemented.

The problem is that of combining the prior strength of the teams – the expected difference in performance over a game, let us call this S, with the current state of the game as expressed as a probability, WP. To do this we must consider the total game time, 60 minutes, and the game time remaining, T, in minutes.

Intuitively we can say that S varies such that S(T)=S(60)*T/60, where S(60) is simply the value of S at the start of the game. We can see this is true, intuitively, because if I tell you team A will on average beat team B by ten points over a sixty minute game, then we'd both agree that if the games were cut to thirty minutes then on average A would beat B by five points.

However, we must also consider how the standard deviation of this value varies with time, and the answer happens to be that it varies as the square root of the ratio of time reamining to total time, in other words: Stdev(T)=Stdev(60)*((T/60)^0.5), where Stdev(60) is the standard deviation at the start of the game. As such we reach the equation for the variation of the team strength parameter over the course of the game, S(T)=S(60)*((T/60)^0.5).

How do we get the initial value of S, S(60)? We take it from Brian's win probability for the game:
S(60)=ln(P/(1-P)), where P is Brian's predicted win probability.

So now, lastly, we need the information from Brian's live model, which we get from taking the probability from the model for the current game time, call it WP, and doing as we did to find S(60):
W=ln(WP/(1-WP)), where W is the logit value of WP.

Now, finally, we have everything, and it combines nicely into this neat, simple equation:

And that's it, hardly complicated all in all, maybe if we're very lucky it'll be implemented.


Andrew Foland said...

Have you tried out your equation with some real game data to see if it does what you expect/ want? It would be interesting to see a plot of the in-game WP as currently calculated, and the in-game WP as using this correction. The most important thing is to show that at the beginning of the game, it equals S(60), and that at the end of the game, it slowly converges to the orignial WP at either one or zero (depending on who won.)

However, I do suspect (and maybe you've found a version) that there's a much simpler first-order approximation to my original formula that would work practically as well. Finding such an approximation would be a worthy thing.

Although I should say that I have the sense that Brian knows how to implement the complicated version, but has hesitated. I'd speculate it's because you can introduce a lot of confusion and a lot to argue about.

"As such we reach the equation for the variation of the team strength parameter over the course of the game, S(T)=S(60)*((T/60)^0.5)."

What varies with the square root of time remaining is the standard deviation of the realized strength advantage outcome over many games, not the team strength parameter, which is the average of the of the realized strength advantage outcome over many games.

This is one reason it gets complicated--the things with simple time dependences are denominated in points, but what you want is a probability.

I believe this is indeed correct: "if I tell you team A will on average beat team B by ten points over a sixty minute game, then we'd both agree that if the games were cut to thirty minutes then on average A would beat B by five points", namely, that team strength S(t) varies linearly in time, not like the square root.

Tom Baldwin said...

Ah Andrew, perhaps I wasn't clear enough. The team strength does indeed vary linearly with time, but any suitably distributed random variable (normal, logistic etc) must also be considered relative to its standard deviation, or in the case of the logistic distribution its S value, which is proportional to standard deviation - see here:
As such the overall logit must vary as (T/60)/((T/60)^0.5) = (T/60)^0.5 and hence we reach what I stated. This is due to the fact, that is well known, that the standard deviation of a random variable of this sort (logistic, normal, lognormal...) follows the rule that its standard deviation varies as T^0.5. So if we have some value M measured over 60 minutes with a standard deviation of 7, then over 30 minutes we would expect a mean of M/2, but a standard deviation of 7*((30/60)^0.5) = 4.95, not 3.5. This is very important.

I can confirm that this equation is the correct solution to the problem at hand when matches are considered via logistic distribution, which is much nicer to implement than the Normal distribution, and is the natural basis for Brian's equations. I use this equation for drawing graphs from NBA games, and it agrees to within a 1% tolerance with a model that instead uses a monte carlo simulation to play out remaining game time taking into account the difference in team strengths.

Tom Baldwin said...

To put it simply, Brian's model gives us the current measurement of the difference between the two teams due to what has happened in the game, and the part I have introduced says: right, we know that a sixty minute game between these two will give us an expected result of X with probabilities of distance from X varying according to its standard deviation S, so if we shrink the game to what time reamins, T, we must calculate the new value of S, which is S*((T/60)**0.5), and the new value of X, which is simply X*(T/60). Then we can simply combine what Brian's model says, and what we have from the new values of X and S, to compute the total probability of winning.

matt r said...

Is there any stat that simply measures the area under the WPA graph (integral?) to measure game dominance? If not WPA + time remaining should be enough to come up with something like this and I think would be valuable when ranking/comparing teams.


Post a Comment

Note: Only a member of this blog may post a comment.