Thursday, January 31, 2013

Yea, but how important is it?

Over the last few posts, I've been providing you with a look at battles on Province, the crazy low-tier map that's so unbalanced it makes your head hurt. With that look, I gave you a list of tanks and a number that represented how they affect your win chances if you plugged your team composition into a fancy formula.

Today I'm going to take a step back and try to inform you something about their usefulness: how well do they let us predict the outcome of battles?

I do this for two reasons:

1. The only way to know if these numbers mean anything is to apply them to data and see if you get accurate predictions.
2. People who know their statistics keep harping on me to do some legit hypothesis testing/other statistical things.

So, to evaluate how good my regressions are, I'm going to slip off into a slightly different data set: All Tier 1 Battles. 1576 battles were included in the model generation, another 1506 in the validation set (these were separated randomly). Again, T1 Cunninghams were used as the baseline tank.


Once again we see an interesting distribution, ~51% of games are won by side 1, however we can attribute it to:

A. Effects of Province on the total distribution.
B. Random chance.

We know A from the last set of analyses, while we know B from the P-value of the intercept, at a 28.9% chance of getting that value purely by chance, we can't reject the null hypothesis of battles being, on average, 50/50. So, I'm going to run it again, forcing this value:


This obviously isn't much of a difference, but it will give us a good starting point. In summary, from best to worst:

TankOdds Ratio
Leichttraktor
1.09
MS-1
1.019
T1 Cunningham
1
Renault NC-31
0.965
Renault FT-17
0.915
Vickers Med. Mk. 1
0.901

Hey look, I made a table! But I've stuck something in here that you probably haven't seen before, the Odds Ratio. It's really not hard to understand, it's just the amount that your base odds (in this case 0.5, or 50%) is multiplied by for each unit increase in that variable.

Example Battle: Somebody got Annihilated!
Count 'em up: Even LTraktors, Even FTs, Side 1 has +1 MK. I, Side 2 has +1 MS-1, Even T1s. So to predict the outcome is pretty simple:

Overall Odds Ratio = (1.09)0(1.019)-1(0.965)0•(0.915)0(0.901)1= 0.882 or ~9:10 odds

And since P = (Odds)/(Odds + 1):

46.86% Win Chance

Obviously this isn't the best of odds for our eventual winners, so lets see how well it does on other data.

If we were to just choose side 1 to win the entire time, we would get it right ~50% of the time, 51.4% in the case of this data. How well does the model predict it? Well, if we compare it to the data we used to generate the model, it gets 735 cases wrong (By wrong, I mean it gave side 1 a >50% chance of winning but side 2 won, or vice-versa). Remember that we had a total of 1576 battles, so our error rate with this model is 46.6%. In other word, this model only predicts 2% more battles correctly than you would if you laid your money all on one side, 3.4% than if battles are truly balanced. That may be good enough for Vegas odds makers, but not that great for us.

Applying it to the test set, the results aren't particularly good either. In fact, if we apply this data to my test set of 1506 battle, it only get 50.6% right! That's terrible! Scarcely better than flipping a coin! Surely there has to be some way we can make it better?

Well the first thing to do is combine the two data sets. Stick them together and what do you get?

On this one I forced a 50% Win Rate
But not on this one.

From these you can clearly see that doubling the amount of data definitely increased the significance of each of the coefficients except for the LoLTraktor. Further the difference between these two models is pretty small, which is a sign of stability in the outcomes. The intercept shows that 52% of all battles are won by side 1, but now the significance level is such that we're mostly left with option A for an explanation. But now we get a whole new set of Odds Ratios:

Tank50% Model52% Model
Leichttraktor
1.0268
1.0239
T1 Cunningham
1
1
MS-1
0.9516
0.9495
Renault NC-31
0.9179
0.9181
Renault FT-17
0.9106
0.9096
Vickers Med. Mk. 1
0.8583
0.8563

Looking at it this way we can see a new shift in the data, suddenly the MS-1 drops below the T1. But we still need to do the important part, see how well the model predicts.

So, of the total 3082 tier 1 battle, the previous model, based on half the data, had only predicted 1603 right, a tepid 52%. With these new models, we should see some drastic improvement, right?


Behold! The mighty power of the 50% Model! 1550 Correct predictions! An astounding 50.3%! Wait, that's actually WORSE than having no predictors at all! It's scarcely even an improvement on our 50/50 win split assumption! That's terrible!  Maybe the other model will do better...

The power of the 52% Model will astonish you with 1666 correct predictions! 54.05% correct! That's right, 60 more correct predictions! 2% additional accuracy! The slivers of probability that gambling careers are made of. But still not a tool you'd want to bet the house on. Obviously there's more to these battles than tank type.


So basically, the moral of the story is this: At least down here, at tier 1, the differences in tanks are so small that building a prediction tool based soley on tank types isn't going to help you much. No tank is so overpowered that it overrides skill or luck in determining the outcome of the match. rather the differences in tanks is just as likely to be a bias in the players who favor them, which is something we'll have to control for at some point.


As always, if you enjoyed this post, please help us in our data gathering efforts. It's simple, it's easy and you can find out how just by clicking here.

Tuesday, January 29, 2013

And the Winner is...

At this point I've probably bored you enough with my forays into telling you which tiers and nations are better on one weee 'ittle map visited only by tier 3 and under tanks. But I have one last big reveal, the full listing. Trying to estimate just how good all 54 tier 3 or less tanks are on Province represents a lot of typing, after all, those names are long, but for you, I did it.

Now, to get you ready, I used as my baseline the T1 Cunningham, so positive values indicate it's better to have that tank than a Cunningham, while negative values indicate you're better off with the Cunningham.


Honestly, I rather surprised by just how many of these produce significant results. If you read the previous posts, you'll notice that most of these values fall in line with the findings from their regressions: Artillery is bad, TDs good, Premium Tanks good. The two best tanks to have on your team are German Premiums. Tier 1&2 British tanks are poor shadows of their counterparts.
The best:

PzKpfw II Ausf J: This one really surprises me, since looking through the data I can only find one instance of it appearing in a battle. But the data suggests (with a surprising level of significance) that having one on your side gives you a nearly 30% increase in win chance. Obviously either the tank or those who drive it are extremely good...

PzKpfw S35: Another tier 3 German premium, this one give you an extra ~25% chance of winning compared to having a Cunningham.

M22 Locust: American Premium this time, boasting a respectable +23% win chance.

FCM36 PaK40: The French Tier 3 TD seems almost perfect for this map, long view range and powerful gun. It's slowness is not a problem as there isn't much movement to do. This translates to a +22% win chance.

PzKpfw 38H735.f: The infamous Micro-Maus gets the distinction of being the only Tier 2 to make the top 5. Each one on your side give +21% chance of winning.


Obviously it's easy to find a pattern to this data. Premiums are good, Artillery Bad, the lower the tier the worse the tank. It's pretty simple to understand why this is, most people don't play the Tier 1-3 for more than a couple weeks, and even then, rarely with elited tanks and good crews. Premium tank players on the other hand tend to have more experience and are willing to pay, both gold and credits, for better crews and ammo. Further, premiums have no XP grind, so you're never going to find a premium tank fighting at less that full effect.

In an attempt to verify this theory, let us take a look at two premium tanks in particular, the T1E6, this year's gift tank and the M3 Light, the Lend-Lease M3 Stuart that players could get by finishing the tutorial. One peculiarity of the M3 Light is that when you get it, it comes with a free 100% crew, giving players with little experience a fully qualified crew much sooner than they would hav otherwise.

The T1E6, on the other hand, was gifted to everyone with a 50% crew. If you were like me, you immediately dismissed them to place your trained Chaffee crew members in it. But some people forget that it is a premium tank and can use tankers trained on other vehicles.

Comparing the M3 and the T1E6, it's fairly obvious that the M3 underperforms for it's tier, the fact that  50% crew tier 2 and a 100% crew tier 3 perform similarly is ample evidence of that. Comparing to other tier 3 premiums, the skill differential can be estimated at about 0.8, or 16% win chance. This shows that experience is not an irrelevant factor, but having a good crew is also important.


One thing you may have noticed is that the map bias we noted in the last two post is a bit higher in the full tank run. Also, we have some rather extreme biases toward high skill players in the form of premium tanks. How about we try to cut out that bias by removing the premium tanks.


Ok, I messed up a little. The T1E6 stayed in and I don't access to my regression currently to fix it. But, other than a few top tier tanks, almost every tank was close to 5% significance level. And all the low tier ones were highly significant. Plus the map bias has tweaked a bit down toward where we've had it previously.

One thing that should pop out immediately is that almost all of these tanks have negative coefficents, the M3 Stuart being the sole exception (With about 45 predictors, it's rather amazing that we only had one that truely deviated. Further, the significance level indicates just how random that value truely is, so I am going to ignore it and wait for more data). This tells me that it's not so much a question of who is better, but of who is less bad. Obvious offenders appear again, Artillery tends to be close to -0.9, some TDs are very good, others not quite so good.

The surprise winner among these tanks? The French D2 Medium, though it too is a low significance result. Beyond that, the Chi Ha and Luchs make good showings. The most surprising tank would be the classic LoLTracktor (Leichttraktor) which performs 0.11 points better than it's fellow tier ones, though this may be attributed to nostolgia driving by high skill players.

One could make a whole chart of which tanks are good, bad and balanced. But I will leave that for another time.




As always, if you enjoyed this post, please take a moment and download our Replay Upload Tool. It's simple and fast to use and each replay improves the quality of our data and the results we can show!

Saturday, January 26, 2013

That Stiff Upper Lip won't help you down here!

Since my full spreadsheet is still unfinished (give me a break, I've unlocked three tier 8s over the last three days!) and I still need to see just how much information we can develop from the data, I decided to go ahead and take a closer look at how the tanks of different nations perform on Province.

Before I show you the numbers, I want to give you a better understanding of what they mean. All of my numbers are generated using what's called Logistic Regression, which a fancy way of saying we can assign a value to the factors that effect your chances of winning. We get to choose the factors we think will be important, grab them in a data set and throw them at the little computer daemons in a package called R to work their statistical magic and give us these values, which we must then interpret.

When you go to perform a regression in R (or when you do any statistical regression really), you have to give it a function to regress. So far I have (and for the near term I will continue to) functions that are pretty simple: WinChanceSide1 = a + b*NetArtillery + c*NetTDs being the one from the previous post (you can see this at the top of the image). I had another variable to add there, NetTanks, that I didn't include because it would 'overdetermine' the system (NetTanks+NetArtillery+NetTDs=0, so if you know two, you can always find the third). This meant that Tanks were the baseline for the regression and you can figure out the win chances for each team from the values generated.

Now that that's all explained (and hopefully makes sense) let's take a look at the breakdown by nationality:


Interesting, apparently, at least on province, the British low tiers are REALLY underpowered. In fact, that's almost as bad as the artillery from the last post, but much, much more significant. In fact, down here it seems being anything but German is a Bad Idea(TM). Now, once again, I have to caution that these values are fairly insignificant, except for the British, and nationality is mostly a non-effect. In fact, looking at the American values, despite popping up with a slight negative value in this regression, based on the small size of the effect and the significance, I think it can be safely said that the American sub-tier 3 tanks are almost perfectly balanced. More data is probably necessary to identify if the Soviet and German biases are real or imagined (insert plug for people to send us replays with our Uploader here).

Now there's one last category I want to take a look at before we go ahead and regress on all of the tier 1-3 tanks. Premium tanks are generally intended to be "better than a stock tank, but worse than a same tier elited tank." So, down at these low tiers, versus other low tiers, on a very specific map, the results may surprise. After all, people who play low-tier premiums tend to be very experienced and have a greater likelihood of having a good crew. But let's take a look:


Holy unbalanced Batman! Here is a category of tank that gives a HUGE increase in win rates. Having just one extra on your team gives you a whole 5% better chance of winning. That's pretty damn imbalalanced if you ask me...

So now we have three good predictors for winning on province: What side you are on, how many more British tanks do you have and how many more premiums. So I'm going to make us a simple model for guessing how likely you are to win on province, using these three variables:


This gives us a pretty simple, but generally accurate guess of win likelihood from just those three questions:

Chance of Side 1 Winning = (e -(0.275+0.182*NetPremiums-0.08*NetBritish) +1)-1

Chance of Side 2 Winning = 1 - Chance of Side 1 Winning

In case you forgot which side is which


Again, this makes no allowances for draws, but as we have demonstrated, almost all of the draws come out of side 2's win rate, so we can estimate it as:

Chance of Side 2 Winning = 1 - Chance of Side 1 Winning - 0.03

Next time I plan to perform a regression over the whole of tier 1-3 tanks, which I expect to have a lot of low significance results until more data is available. Then we can move on to bigger and better things...

Please, if you enjoyed this post and want to see more like them, be sure to help by contributing your replays! It's fast and simple, just see how here.

Wednesday, January 23, 2013

A Quick Note on Significance

Significance in statistics is generally expressed as a P-value, which measure the chance of obtaining obtaining the answer you got randomly, even if there is no actual effect. In general, to be sure that there is an effect and you aren't just reading into noise,  you want a P-value of less than 0.05, or 5%. Fortunately for us, this isn't an entirely scientific enterprise, so we're more willing to accept less surety in our values.

There are two things that effect significance, the size of the effect and the number of data points you have. In the last post, I chose predictors that I hoped would have a large effect to demonstrate what we're looking for. Even so, the data across the 2800 or so games was so sparse that only the intercept showed significance. Even smaller effects, such as the influence of individual tank types on the outcome of battles, will require a lot more data to show significance. This is why we ask you to contribute your replays through the Uploader, which is linked in the sidebar. Information on how to use it can be found in this post.

What is wrong with Province?

To get us started off on the right foot, I'm going to work with a nice, small subset of the 174k battles that vbaddict has supplied us as a seed.

Why Province? In all honesty, the fact that it is tier limited makes it a very attractive way to keep the data set small(ish), as well as only being availible as standard mode. Being limited to tier 3 or less tanks (tier 2 artillery) means that we are only looking at 53 different tanks that can possibly be in the battle. That means I can set up my spreadsheets before my morning coffee runs out.

Of the 174k battles the vbaddict supplied, 2950 of the took place on Province. I am going to simplify things and assume that vbaddict doesn't capture a large portion of the total battles that take place during the day, thus treating the total battle population as infinite relative to our sample here.
Side 1 starts in the Green Area to the south, Side 2 in the Red to the North

The straight forward and simple:

Side 1 Win Rate: 54.7% with a standard error of 0.9%
Side 2 Win Rate: 41.8% with a standard error of 0.9%
Draw Rate: 3.5% with a standard error of 0.3%

Really, you could have found that on any WoT Statistics site. It's widely known that Province is unbalanced in favor of side 1, anyone who has spent significant time at tier 3 or lower is aware of this. But we're not here to look at things as simple as map biases, we're looking for answers.

One possible explanation for the map bias is issue with the matchmaker when dealing with the tier limitation. Unfortunately  if you look at the distribution of tank tiers and types across the two teams, this theory falls rather flat on its face.
Positive values indicate Side 1 had more of that tank type in battle, Negative side 2
This leaves the bias in the map.

The Logistic Equation: For us, PI is the probability of a win for side 1


Next, since we have the data on the types and tiers of tanks, let's take a look at how they effect your chances of winning. This is going to be a logistic regression on all tiers and types of tanks to see if the proportion of any of them is a significant predictor of success on the battlefield. Note that because of the fact that that we can determine certain variables from the others (ie Tier 1 from Tier 2 and Tier 3 tanks)



The first thing to realize is that we are looking at the data from the point of view of side 1. I set up our predictors as net values, ie the number of artillery on side 1 minus the number of artillery on side 2.

If we look at artillery and tank destroyers, leaving other tanks out to avoid over-determination, there is a slight positive effect from tank destroyers and a bigger negative effect from artillery. So each artillery that you have more than the other team decreases your teams chances by about 10%. Similarly, TDs have a positive effect on win chance, ~1.1%.

The 'Intercept' value tells us what we already know, the base chance of side 1 winning is about 56.7%. As outcomes for the regression can only be absolute win or loss, this is actually the chance of side one winning with out draws as an option. Comparing this to the earlier values, it would seem that introducing draws as an option makes it look like most draws come from Side 2's win chance. This may lead one to a theory that most of the draws on province are from side 2 teams that can't entirely capitalize on a weak side 1.

Now all this sounds good, but there is one more column to take note of: P(>|Z|), also known as the P value. In general, for a result to be statistically significant, you want a P-value of <0.05, meaning a less than 5% chance of obtaining the value by chance, which neither net artillery or TDs manages, each of these having ~20% chance of giving these results even if they had no actual effect on the outcome. However, the Intercept is on the order of 10^-12, which is extremely significant. Thus, from this data set, artillery and TDs are not necessarily good predictors, but the team side is by a large margin.






Tuesday, January 22, 2013

Using the Upload Tool



To facilitate the effort of gathering the data required for our analysis, we've create a simple upload tool, dubbed (unsuprisingly) "the Uploader".
You can download it from GitGub by clicking here and then "View raw".



  1. Before running it, ensure you have or install .NET Framework 4
  2. Place the Uploader in the WoT main directory
  3. Ensure that you have enable replays in Settings
  4. Run the uploader during or after playing World Of Tanks (you can create a shortcut so long as the actual executable is in the WoT directory)
That's it!

If you encounter problems, leave a comment.


Data Collection

In any endeavor to gain a statistical understanding, the single most important aspect is the hunt for data. In many ways gathering data seems like a trivial step, so obvious that it can be left as an afterthought. After all, to many the data itself is uninteresting, it's what you learn from it that they truly care about.

The thing is, the data is the limiting factor for understanding. Collect the wrong data, ask the question improperly and your data no longer represents what you're trying to understand. When large polling companies set up surveys of elections, a great deal of thought and knowledge goes into creating questions that accurately gauge the opinions of their sample.

Fortunately, as a computer game, we don't much have to worry about asking the right question, the game itself generate a huge volume of data. This data isn't exactly easily accessible  stored on your computer in replay files or on Wargaming's servers. But it can be extracted.

The final problem is one of volume. For most statistical analysis, it is almost impossible to have too much data. When you're dealing with something as complicated as World of Tanks, with it 200+ different tanks in 12 different battle tiers, plus all of the possible combinations of modules and equipment and 200K+ active players (just on the NA server), the more data you have, the more likely you are to be able to say something meaningful.

Which is where you come in. The more people we have sending in replays, the better off we are for data. The more data we have, the confident we can be in our knowledge of the game. So the next post will show you how you can send us data so we can come up with pretty charts and graphs about our favorite game!

GL HF!

Monday, January 21, 2013

Hey, do you Know WoT?

We play a game and after a while we think we know it. The rules become familiar, the pace routine, the best strategies rote. We look at it and we 'know' how it works. 

In some ways I feel that I know World of Tanks. I can't spout off the spotting algorithm or tell you what the Random Number Generator will do next, but after 10k battles, I have a good feel for the structure of the game and how it works. I know to hide the lower front plate in German tanks, lest the transmission be set on fire. I know better than to fight American tanks on hills. But, like so many of us, I still don't know what tanks are best, though I certainly have an opinion, as it's difficult know just how all those stats effect play. I don't know which side of each map is has better chance to win, terrain is just too complicated.

But, I do have at my disposal the tools and methods to figure it out. See, I've taken statistics courses and done my best to understand what a good collection of data can tell you. I even slightly enjoy using what I have learned to better understand the world. So I have decided to turn these tools on the game I have been greatly enjoying over the past year: World of Tanks.

It is my hope that this blog will shed some light on what we assume we know about this game, and, if the matchmaker is kind, even help us enjoy this damn good game.


GLHF