Tuesday, March 10, 2015

Exportable 2015 MLB Schedule


Something that is difficult to find on the internet is an excel download file of the 2015 MLB Schedule.  I have taken the time to write a script that takes the 2015 MLB Schedule and converts it to an easy to use CSV file and uploaded it to google docs.  The file is free to download and can be found at the following link.

Here is the format that the file is in

Game ID,Year,Month,Day,Time,Away,Home

1,2015,4,5,8:05 PM,Cardinals,Cubs
2,2015,4,6,1:05 PM,Blue Jays,Yankees
3,2015,4,6,1:08 PM,Twins,Tigers
4,2015,4,6,2:10 PM,Rockies,Brewers
5,2015,4,6,3:05 PM,Red Sox,Phillies
6,2015,4,6,3:10 PM,Orioles,Rays
7,2015,4,6,4:05 PM,Mets,Nationals
8,2015,4,6,4:10 PM,Braves,Marlins
9,2015,4,6,4:10 PM,White Sox,Royals
10,2015,4,6,4:10 PM,Angels,Mariners
.
.
.
2426,2015,10,4,3:10 PM,Athletics,Mariners
2427,2015,10,4,3:10 PM,Padres,Dodgers
2428,2015,10,4,3:10 PM,Blue Jays,Rays
2429,2015,10,4,3:10 PM,Nationals,Mets
2430,2015,10,4,4:10 PM,Astros,D-backs

Please keep in mind that game times and dates will be changing due to rain and I will not be maintaining these changes.

Monday, March 02, 2015

Oakland Athletics - 2015 Most Optimal Lineups

There are many ways people attempt to determine the best batting order.  Some people try to arrange high on base percentage people at the top of the lineup followed by sluggers and then the rest of the crew and slap on a pitcher batting 9th (NL Team) and you are good to go.  Others try calculators where you enter in player stats and out pops the best lineups.  These are all fun and probably get you part of the way there but they are in NO WAY scientific enough to make much of a claim to what the top lineups might be.

The best way (in my opinion) to determine which lineup is the best is to actually trot out every single lineup and see which one wins the most games.  Of course you would have to hold the opponent constant, using the same starters, lineup and starting pitcher.  How hard could that be to do?  Let's see, with nine batters in a lineup you would only have 362,880 lineups to go through.  How long could that take to play over 350,000 baseball games.  You could probably filter those permutations down to 25,000 or so by limiting left handed batters from hitting back to back, limiting the pitcher (NL) to batting either 8th or 9th, plus a few other obvious things.  Even if you could narrow things down to just two lineups, you would still need to play more than one game to determine which one was better.  So how many samples/games would you need?  10? 20? or maybe an entire season (162) of games?  No.  You would need a lot more than that.  Try tens of thousands just to separate the bad lineups from the good and then try a million or two to compare the best lineups.

Well, I think it is pretty impossible to play thousands of games one time or a couple of games a million times.  Hypothetically, if one were able to play games with thousands of different lineups, thousands or millions of times against the exact same opponent then you would get a very good idea as to which lineups were the best.  This is where simulation comes in handy.  A simulator that could play actual baseball games, by actual baseball rules, taking into consideration the important facets of a real baseball game like speed, defense, pitchers getting tired the more pitches they throw, splits, hitter vs pitcher matchups and outcomes and throw in some good player projections like the ones available for free at Fangraphs and then maybe through the power of the computer you could plow through tens of thousands of likely lineups to determine the best ones.

Now, you would be able to test the synergy of batting certain groups of players next to each other.  You would be able to experiment with various types of hitters hitting in different spots.  In fact, you could just let the computer run through each lineup and let you know what the top ones were, even tabulating how many times each player showed up at each spot in the top lineups.  Now you would have a good list of top lineups and be able to measure how many wins a manager might be leaving on the table by using the lineup(s) that he used.  Wouldn't it be very worthwhile for a team to know what its best lineups might be?  Of course it would, especially considering that on the free agent market one win (or WAR) is typically worth around $7M.  For managers that might not want to hit certain batters in certain lineup spots for whatever reason, he could use the filtering option to only measure lineups that fit his parameters.

Well, now on to what my game simulator using Steamer hitting projections lists as the top fifty lineups for the 2015 Oakland Athletics.  I only looked at lineups against a right handed starting pitcher and took the nine most likely starters from the list at the Roster Resource website and I have of course used their most common lineup as one of the many (10,000+) lineups that I am looking at.  Along with the top fifty lineups, there is a table showing how many times each player shows up in each lineup spot and what the most common back to back slottings are as well as back to back to back slottings (think synergy here).

Summary:
The batting order frequency table tells a lot here.  If you were to piece together a lineup from only the frequency table you would likely come up with what is the second ranked optimal lineup.  The lineup listed from the Roster Resource website came in listed 34th.  I've ran a few of these now for various teams and the Athletics seem to have a very balanced lineup with no one player way better than the others not causing much of a spread between the top lineups.  I also purposely added a bad lineup to the bottom of the top 50 list just to see what the maximum spread for the team looks like.  According to the simulator, there are not a lot of wins for the Athletics manager to leave on the table vs RHP compared to some of the other teams.

                                          Top 50 Lineups (vs RHP)
RankLineupWins/162 Games Behind
1Zobrist-Reddick-Lawrie-Davis-Crisp-Semien-Vogt-Butler-Fuld0
2Crisp-Reddick-Lawrie-Davis-Zobrist-Vogt-Semien-Butler-Fuld0.001
3Reddick-Crisp-Lawrie-Davis-Zobrist-Vogt-Semien-Fuld-Butler0.016
4Crisp-Vogt-Lawrie-Davis-Zobrist-Reddick-Semien-Butler-Fuld0.042
5Zobrist-Fuld-Lawrie-Reddick-Crisp-Vogt-Semien-Butler-Davis0.067
6Crisp-Vogt-Lawrie-Davis-Zobrist-Semien-Fuld-Butler-Reddick0.093
7Fuld-Crisp-Butler-Davis-Zobrist-Reddick-Lawrie-Vogt-Semien0.094
8Davis-Zobrist-Lawrie-Reddick-Crisp-Vogt-Semien-Fuld-Butler0.103
9Reddick-Semien-Lawrie-Davis-Crisp-Fuld-Zobrist-Vogt-Butler0.107
10Zobrist-Reddick-Lawrie-Davis-Semien-Crisp-Vogt-Butler-Fuld0.108
11Lawrie-Crisp-Davis-Zobrist-Reddick-Semien-Vogt-Butler-Fuld0.108
12Semien-Davis-Lawrie-Reddick-Crisp-Fuld-Zobrist-Vogt-Butler0.109
13Zobrist-Reddick-Lawrie-Davis-Crisp-Fuld-Butler-Vogt-Semien0.117
14Crisp-Reddick-Lawrie-Davis-Semien-Zobrist-Fuld-Butler-Vogt0.123
15Zobrist-Crisp-Reddick-Lawrie-Davis-Semien-Fuld-Butler-Vogt0.14
16Semien-Davis-Lawrie-Reddick-Zobrist-Crisp-Vogt-Butler-Fuld0.141
17Semien-Fuld-Butler-Davis-Zobrist-Reddick-Lawrie-Crisp-Vogt0.146
18Zobrist-Reddick-Lawrie-Davis-Crisp-Vogt-Semien-Fuld-Butler0.146
19Reddick-Crisp-Davis-Zobrist-Lawrie-Vogt-Semien-Fuld-Butler0.152
20Fuld-Crisp-Butler-Davis-Semien-Reddick-Lawrie-Vogt-Zobrist0.156
21Zobrist-Fuld-Lawrie-Davis-Crisp-Vogt-Semien-Butler-Reddick0.156
22Reddick-Zobrist-Davis-Lawrie-Crisp-Vogt-Semien-Fuld-Butler0.159
23Crisp-Butler-Reddick-Lawrie-Davis-Semien-Vogt-Zobrist-Fuld0.175
24Reddick-Crisp-Davis-Lawrie-Zobrist-Vogt-Semien-Fuld-Butler0.181
25Fuld-Crisp-Lawrie-Davis-Zobrist-Reddick-Semien-Vogt-Butler0.191
26Reddick-Zobrist-Lawrie-Davis-Semien-Fuld-Crisp-Vogt-Butler0.192
27Crisp-Zobrist-Reddick-Lawrie-Davis-Semien-Fuld-Butler-Vogt0.192
28Crisp-Davis-Lawrie-Reddick-Zobrist-Vogt-Semien-Butler-Fuld0.195
29Crisp-Fuld-Lawrie-Reddick-Zobrist-Semien-Vogt-Butler-Davis0.204
30Crisp-Semien-Davis-Lawrie-Reddick-Zobrist-Fuld-Butler-Vogt0.209
31Crisp-Fuld-Lawrie-Davis-Zobrist-Reddick-Butler-Semien-Vogt0.210
32Crisp-Zobrist-Davis-Lawrie-Fuld-Semien-Vogt-Butler-Reddick0.213
33Semien-Fuld-Lawrie-Reddick-Zobrist-Crisp-Vogt-Butler-Davis0.214
34Reddick-Crisp-Davis-Zobrist-Vogt-Lawrie-Semien-Fuld-Butler0.218
35Crisp-Zobrist-Reddick-Butler-Davis-Lawrie-Vogt-Semien-Fuld0.221
36Reddick-Zobrist-Davis-Lawrie-Fuld-Semien-Crisp-Vogt-Butler0.222
37Crisp-Davis-Butler-Reddick-Zobrist-Lawrie-Vogt-Semien-Fuld0.236
38Semien-Davis-Zobrist-Reddick-Crisp-Vogt-Lawrie-Fuld-Butler0.238
39Crisp-Vogt-Lawrie-Davis-Semien-Butler-Reddick-Zobrist-Fuld0.242
40Crisp-Zobrist-Reddick-Lawrie-Vogt-Semien-Fuld-Butler-Davis0.244
41Zobrist-Reddick-Lawrie-Davis-Crisp-Fuld-Butler-Semien-Vogt0.248
42Crisp-Butler-Reddick-Lawrie-Davis-Zobrist-Vogt-Semien-Fuld0.257
43Lawrie-Fuld-Butler-Davis-Crisp-Zobrist-Vogt-Semien-Reddick0.258
44Crisp-Reddick-Lawrie-Davis-Semien-Fuld-Butler-Zobrist-Vogt0.260
45Davis-Zobrist-Reddick-Lawrie-Fuld-Crisp-Vogt-Semien-Butler0.263
46Crisp-Fuld-Butler-Davis-Lawrie-Reddick-Semien-Vogt-Zobrist0.267
47Crisp-Reddick-Butler-Davis-Semien-Zobrist-Fuld-Lawrie-Vogt0.283
48Fuld-Semien-Lawrie-Davis-Crisp-Reddick-Zobrist-Vogt-Butler0.284
49Crisp-Vogt-Zobrist-Davis-Lawrie-Reddick-Semien-Butler-Fuld0.294
50Crisp-Reddick-Butler-Davis-Zobrist-Lawrie-Vogt-Semien-Fuld0.294
BADVogt-Butler-Fuld-Crisp-Semien-Davis-Zobrist-Reddick-Lawrie1.419
.
.
             Batting Order Frequency Table
1st2nd3rd4th5th6th7th8th9th
Crisp21900134210
Reddick8107929104
Lawrie20251134410
Davis2582650004
Zobrist8923155332
Vogt040021114109
Semien53007101582
Butler02810141915
Fuld4800367814
.
.

                    Synergy


   Back to Back Frequency Leaders
RankOccurrencesPlayer 1Player 2
122LawrieDavis
220VogtSemien
320SemienFuld
420FuldButler
518ReddickLawrie
617CrispVogt
717DavisZobrist
816ZobristReddick
915ButlerReddick
1015FuldCrisp
1114ButlerDavis
1213VogtButler
1312ReddickZobrist
1411DavisLawrie
1511DavisSemien
1611ZobristVogt
1710ReddickCrisp
1810LawrieReddick
1910DavisCrisp
2010ButlerFuld

     Back To Back to Back Frequency Leaders
RankOccurrencesPlayer 1Player 2Player 3
113VogtSemienFuld
213SemienFuldButler
312ReddickLawrieDavis
410ZobristReddickLawrie
58LawrieDavisSemien
68DavisZobristReddick
77CrispVogtSemien
87LawrieDavisCrisp
97LawrieDavisZobrist
106LawrieVogtSemien
116DavisLawrieReddick
126ZobristVogtSemien
136VogtButlerFuld
146SemienFuldCrisp
156ButlerReddickCrisp
166ButlerReddickZobrist
176ButlerDavisZobrist
186FuldButlerReddick
195CrispVogtButler
205LawrieReddickZobrist
.
.