welcome to the final week of the moneyball mooc. Last week we introduced the concept of run expectancy and derived the run expectancy matrix. Which is an incredibly powerful tool for analyzing the performance of baseball players, baseball teams, analyzing baseball games in general. And in this final week, we're going to think about some of the ways that you might apply the run expectancy matrix. In reality, there are actually a lot of different ways you could use it. So this is no by no means meant to be an exhaustive list, but it will give you some ideas about the way you can use it. And maybe also prompt you to develop your own ideas about how to develop baseball statistics. So the place to start really is back with our old friends on base percentage, and slugging percentage. And think about a little bit about how those statistics work. So in particular, slugging gives a weight to particular events, batting events achieved by the players. So it gives a weight of one to a single, two to a double, three to a triple and four to a home run. Now those weights are essentially arbitrary. They make some kind of intuitive sense, one base, two base, three bases, four bases and so on. But in fact, they're just made up, and they don't really tell us exactly how much each of those events contributes to the total run scored in the game. Now that's what the run expectancy matrix can do for us, though. The run expectancy matrix tells us exactly how much each of those events contributes in terms of expected runs over again. So what we can use is use the weights from the run expectancy matrix to develop a new measure, which could replace concepts such as slugging. And that's goes by the name generally of weighted on base average. So weighted on base average is uses the weights from the run expectancy matrix for each possible event. In order to value the contributions of players or teams, or whatever it is that you're trying to evaluate with these statistics. And if you go to popular sites like Fangraphs, for example, they actually give you the weight in which you could then apply to the performance of players. In order to generate your statistics. So in some ways, that run expectancy matrix has already passed into basic statistical analysis of the game, and plays a significant role. Now what we want to do is go a little bit beyond that and show how you can use these statistics directly in your estimating, say, the contributions of players. So, for example, if you think about weighted on base average. What the Fangraphs is telling you is apply these weights to the statistics of a particular player in the current season. But in effect, that's saying that that's not taking into account the context of each of those events as they actually played out in the game. Whereas if we look at the run expectancy matrix directly, rather than taking the weights from somebody else, we can develop our own valuations. And so fully take into account the context of the players performance. Now, in thinking about how to use these statistics, people have gone beyond this even further and thought about valuing the contribution of players. In terms of what's known as wins above replacement. So wins above replacement uses again the idea of the run expectancy matrix, but adds in some particular adjustments, taking into account the context of the game. And there are three kinds of adjustments that go into the measure of wins above replacement. So one thing wins above replacement does is it looks not just at batting and pitching. But also looks at fielding and base running as part of the contribution of the player to the performance. So it looks as offensive statistics and defensive statistics, but still based around the run expectancy matrix. The other thing it can do is to take account of particular advantages that a player might have in particular context. And a good example here is the handedness of the players. So left handed players batting against right handed pitchers are often thought to have an advantage. And so that effect can be taken into account in measuring the performance of a player. So in some sense, it's not the player's skill that he happens to be left handed. It's something that just an endowment that he happens to have. And his skills above and beyond his handedness or something that you can measure separately. A third aspect of wins above replacement, though, is to take into account not just the runs contributed by a player. But to make the comparison of what the team would have achieved had that player not been present. And that's where the concept of the replacement comes in. The idea here is that had the particular player not been available, then the team would have had to bring up a replacement from the minors. And it's the skill level of that player, the difference between the skill level of that replacement player and the player in question. That is the measures that players true contribution. So that involves really calculating the value of a replacement player. Which still comes back down to using the run expectancy matrix to measure the runs values of those players. Now we're not going to actually generate a measure of wins above replacement in this mooc here. But you could go on and do it with the data that we're going to look at if that was something that you were interested in doing. The other thing to say of course it's wins above replacement, not runs above replacement, and that actually is simply an adjustment for convenience. It doesn't have any real statistical significance in the sense that, usually, the rule of thumb is that wind is equal to 10 runs. And therefore it's just simply a matter of dividing the runs value by 10 to come up with the players win value. So that part of the statistical analysis is not very complicated, and again, we're not going to bother with that here during this session.