tag:blogger.com,1999:blog-20226978960995600982016-10-21T03:02:51.008-07:00Seifd's Baseballseifdhttp://www.blogger.com/profile/01029713555192524262noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-2022697896099560098.post-18890599739640632512016-02-22T22:32:00.001-08:002016-02-22T22:32:10.330-08:00Baseball ForecastingAs spring training is about to begin, people begin to put out forecasts. How are these forecasts put together? There are three main methods.<br /><br />One method is the wisdom of the crowds. Fangraphs FAN projections is the purest instance of this method. The method is to have many people estimate something and average the estimates together. The idea is that, while people are going to be wrong, the way they're wrong will form a bell curve. So, by getting many estimates, we can get an estimate close to the real number.<br /><br />A second method is expert opinion. You get together a group of people who really know baseball and have them come to a conclusion. This is how Sports Illustrated does it.<br /><br />The final method an most common forecast is statistical projection. Stats can be projected taking into account past performance, the reliability of the data, and the effect of aging on the player. <br /><br />As an example, I'll forecast Miguel Cabrera's slugging percentage for 2016. The system I'll be using is the Marcels system, which is the simplest system I know of that will give reasonable results.<br /><br />First, I need to find Cabrera's runs for the past three years.<br /><br />2015 - .534<br />2014 - .524<br />2013 - .636<br /><br />Next, we take a weighted average. We assign last year's score a weight of 5, the year before a weight of 4, and the year before a weight of 3.<br /><br />wSLG = (5 * SLG15 + 4 * SLG14 + 3 * SLG13)/12<br /><br />(5 * .534 + 4 * .524 + 3 * .636)/12 = .556<br /><br />Next, we take a look at his plate appearances for those years to determine how reliable the information is. Those appearances are once again weighed.<br /><br />(5 * PA15 + 4 * PA14 + 3 * PA13)/(5 * PA15 + 4 * PA14 + 3 * PA13 +1200)<br /><br />(5 * 511 + 4 * 685 + 3 * 652)/(5 * 511 + 4 * 685 + 3 * 652+1200) = 0.858<br /><br />Next, we need a weighed league average:<br /><br />wLgSLG = (5 * LgSLG15 + 4 * LgSLG14 + 3 * LgSLG13)/12<br /><br />(5*.405+4*.386+3*.396)/12 = .396<br /><br />Now, we factor together the reliability rating and weighted average and add it to the factor of the league average and 1 - reliability rate:<br /><br />adjSLG = (wSLG * r) + (wLgSLG * (1 - r))<br /><br />(.556 * .858) + ((1 - .858) * .396) = .533<br /><br />Next, we need to find the factor to account for his age.<br /><br />ageFactor = 1 - ((age - 29) * .003)<br /><br />1 - ((32 - 29) * .003) = .991<br /><br />Finally we multiply are adjusted number and our age factor:<br /><br />final = adjSLG * ageFactor<br /><br />.991 * .533 = .529<br /><br />There's a few things to note. First, the formula for age factor given above is only for people above the age 30. For younger players, use the following instead:<br /><br />ageFactor = 1 + ((29 - age) * .006)<br /><br />The other problem is the system is designed to use three years of stats. For those without, use the league average for the stat being examined. However, don't do the same with plate appearances.<br /><br />Clearly this system could be improved. Rookies could be evaluated using minor league equivalencies and park factors instead of the league average. The weights given to the various years could probably be fine tuned. The same is probably true of the formula for age factor. In reality, it'd probably do better to have a table of factors.seifdhttp://www.blogger.com/profile/01029713555192524262noreply@blogger.com0tag:blogger.com,1999:blog-2022697896099560098.post-71373872945088547812016-02-06T21:03:00.001-08:002016-02-06T21:03:26.411-08:00Baseball and Stats: Units of AnalysisA unit of analysis is the unit that's being studied. Looking at different units of analysis can give a different view of things.<div><br /></div><div>As an example, let's compare attendance of <a href="http://www.baseball-reference.com/leagues/current_attendance.shtml">MLB games in 2014 and 2015</a>. If I use the team as my unit of analysis, things don't seem too good. 57% of teams had lower attendance in 2015 than they did in 2014. If I look at the Major League as a whole, it looks better. Attendance has increased (not by much, but a little). </div>seifdhttp://www.blogger.com/profile/01029713555192524262noreply@blogger.com0tag:blogger.com,1999:blog-2022697896099560098.post-29862489843662990782016-02-02T15:11:00.002-08:002016-02-02T15:11:41.967-08:00Baseball and Stats: What is average?Baseball is a numbers games. People love to throw around stats. However, to get a better understanding of stats, you need to understand statistics. In this post, I'd like to discuss average.<br /><br />How many home runs did the average Major League team hit in 2015? You can find this information on <a href="http://www.baseball-reference.com/leagues/MLB/2015.shtml">Baseball Reference</a>.<br /><br />In everyday language, average is means typical. In statistics, we're looking for the single number that best describes an entire set of data. There are several ways to come up with an average.<br /><br />The most commonly used method is a mean. A mean is calculated by adding up each item in a data set and dividing the sum by the number of items in the set. In 2015, Major League teams had a mean of 163.663 home runs. You can't half .663 home runs, so we round up to 164.<br /><br />A second method is median. A median is found by arranging the data in order and then finding the middle item. Since there are an even number of teams, we look at the two middle items and find the midpoint between them. This happens to be the mean of the two. For 2015, the median teams the Red Sox (161 home runs) and the Twins (156). The median comes out to 158.5 which we round up to 159.<br /><br />Mode is a third method. The mode is the item that appears most often in the data set. A data set can have more than one mode. The modes of our data are 177 (the Mets and the Nationals), 167 (the Reds and the Rays), and 136 (the White Sox and the Giants). Because we have three modes, our data set is called trimodal or multimodal. Note that all three modes would be reported. It wouldn't be right to find an average among them and call it the mode.<br /><br />Finally, there's the mid-range. The mid-range is the point equally distant from the highest number and lowest number in the data set. To find the mid-range, find the mean of the smallest and largest number in the set. For us, that's 232 (the Blue Jays) and 100 (the Braves). We get a mid-range of 166.<br /><br />Each of these methods give us a different answer (or in the case of the mode, multiple different answers). How can we determine which one best describes the data set?<br /><br />One method is to look at mean absolute deviation (MAD). To find MAD, you subtract each data point from the average you're examining (usually the mean or median). Next you add the absolute values of all the results together. The absolute value is the distance of that number from 0. For example, both 5 and -5 have an absolute value of 0. Finally, the total is divided by the number of items in the set. Here are the results for each method:<br /><br /><table border="1"><tbody><tr><th>Mean</th><th>Median</th><th>Mode 1</th><th>Mode 2</th><th>Mode 3</th><th>Mid-range</th></tr><tr><td>25.21</td><td>25.03</td><td>28.23</td><td>25.43</td><td>31.5</td><td>25.37</td></tr></tbody></table><br />A smaller MAD means that overall, the measure fits each data set better. The modes fit the entire data set the least well. The mid-range isn't much better. Next is the mean and the median best describes the entire set, according to MAD.<br /><br />A second method is mean squared error (MSE). To find MSE, find the difference between each data point and square the difference. Add the results up and divide the sum by the number of items in the data set.<br /><br /><table border="1"><tbody><tr><th>Mean</th><th>Median</th><th>Mode 1</th><th>Mode 2</th><th>Mode 3</th><th>Mid-range</th></tr><tr><td>979.0</td><td>1005.3</td><td>1157.6</td><td>990.3</td><td>1742.6</td><td>984.6</td></tr></tbody></table><br />According to MSE, the most accurate measure is our second mode (167), followed by the mean, and then the mid-range. After that is the median and the other two modes. What happened? How did the median and mode 2 switch spots?<br /><br />Because of the way that MSE is calculated, larger deviations are penalized more harshly than small deviations. As an example, let's compare the Red Sox's deviation from the mean (3 runs) and the Blue Jays' (68 runs). Let's see how much they each contribute to the final total.<br /><br /><table border="1"><tbody><tr><td></td><th>MAD</th><th>MSE</th></tr><tr><th>Red Sox</th><td>0.1</td><td>0.3</td></tr><tr><th>Blue Jays</th><td>2.267</td><td>154.13</td></tr></tbody></table><br />As you can see, the same deviation is valued quite differently between MAD and MSE. Which is better? It depends on your point of view. MAD is better for detecting total deviance. MSE is better for detecting large deviations.seifdhttp://www.blogger.com/profile/01029713555192524262noreply@blogger.com0