Friday, January 30, 2015

St Louis Cardinals - Most Optimal 2015 Lineups

.
I am using my simulator that plays actual baseball games to find what it believes are the most optimal lineups for the 2015 St Louis Cardinals.  I started out with over 10,000 permutations of lineups, a group that was filtered to remove such things as too many left handed hitters hitting back to back or the pitcher not hitting 8th or 9th etc... and I slowly widdled it down to the top 50 lineups.  I also compared the best lineup against the lineup that MLB Depth Charts shows as a likely lineup and also one of the worst lineups to see what kind of spread there is.  The top 50 lineups all came within a half of a win per 162 games so really anything in that range is pretty good.  When you start nearing a full win differential with the top lineup then you definitely have problems.  I typically simulated each lineup over 1 million times which eliminated a large portion of the random noise and I did so only against a right handed pitcher.  Below are a list of the top 50 lineups and a batting order spot frequence table, where you can see how many times each player appeared in each of the top 50 lineup.

                                       Top 50 Most Optimal Lineups
RankLineupWins/162 Behind
1Heyward-Carpenter-Holliday-Adams-Wong-Molina-Peralta-Pitcher-Jay0
2Carpenter-Heyward-Holliday-Adams-Wong-Molina-Peralta-Pitcher-Jay0.014
3Wong-Jay-Holliday-Carpenter-Heyward-Peralta-Adams-Molina-Pitcher0.015
4Carpenter-Heyward-Holliday-Adams-Wong-Peralta-Molina-Pitcher-Jay0.032
5Heyward-Jay-Holliday-Carpenter-Adams-Peralta-Molina-Pitcher-Wong0.066
6Wong-Heyward-Holliday-Carpenter-Adams-Peralta-Molina-Pitcher-Jay0.086
7Heyward-Jay-Holliday-Carpenter-Adams-Molina-Peralta-Pitcher-Wong0.102
8Heyward-Jay-Holliday-Carpenter-Adams-Peralta-Wong-Molina-Pitcher0.120
9Jay-Heyward-Holliday-Carpenter-Adams-Peralta-Molina-Pitcher-Wong0.131
10Wong-Jay-Holliday-Carpenter-Heyward-Molina-Adams-Peralta-Pitcher0.151
11Jay-Heyward-Holliday-Carpenter-Adams-Peralta-Wong-Molina-Pitcher0.167
12Jay-Heyward-Holliday-Carpenter-Wong-Peralta-Adams-Molina-Pitcher0.171
13Jay-Heyward-Holliday-Carpenter-Adams-Molina-Peralta-Pitcher-Wong0.175
14Heyward-Carpenter-Holliday-Adams-Wong-Peralta-Jay-Molina-Pitcher0.184
15Carpenter-Jay-Holliday-Adams-Heyward-Peralta-Wong-Molina-Pitcher0.199
16Jay-Heyward-Holliday-Adams-Carpenter-Peralta-Wong-Molina-Pitcher0.200
17Heyward-Jay-Holliday-Adams-Carpenter-Peralta-Wong-Molina-Pitcher0.209
18Wong-Jay-Peralta-Carpenter-Heyward-Holliday-Adams-Molina-Pitcher0.243
19Heyward-Adams-Holliday-Carpenter-Wong-Molina-Peralta-Pitcher-Jay0.247
20Carpenter-Heyward-Holliday-Adams-Jay-Peralta-Molina-Pitcher-Wong0.253
21Heyward-Wong-Holliday-Adams-Carpenter-Peralta-Molina-Pitcher-Jay0.257
22Jay-Wong-Holliday-Carpenter-Heyward-Molina-Adams-Peralta-Pitcher0.266
23Heyward-Adams-Holliday-Carpenter-Wong-Peralta-Molina-Pitcher-Jay0.269
24Heyward-Jay-Holliday-Carpenter-Adams-Molina-Wong-Peralta-Pitcher0.269
25Wong-Jay-Molina-Carpenter-Heyward-Holliday-Adams-Peralta-Pitcher0.284
26Jay-Carpenter-Holliday-Heyward-Adams-Peralta-Molina-Pitcher-Wong0.286
27Heyward-Carpenter-Holliday-Adams-Molina-Wong-Peralta-Pitcher-Jay0.286
28Jay-Carpenter-Holliday-Adams-Heyward-Peralta-Molina-Pitcher-Wong0.288
29Heyward-Holliday-Carpenter-Adams-Peralta-Wong-Molina-Pitcher-Jay0.289
30Carpenter-Heyward-Holliday-Adams-Wong-Molina-Jay-Peralta-Pitcher0.292
31Jay-Adams-Holliday-Carpenter-Heyward-Peralta-Wong-Molina-Pitcher0.299
32Heyward-Wong-Holliday-Carpenter-Adams-Peralta-Jay-Molina-Pitcher0.305
33Wong-Carpenter-Holliday-Adams-Heyward-Peralta-Molina-Pitcher-Jay0.310
34Carpenter-Jay-Holliday-Adams-Heyward-Peralta-Molina-Pitcher-Wong0.310
35Peralta-Heyward-Carpenter-Holliday-Adams-Wong-Molina-Pitcher-Jay0.317
36Jay-Carpenter-Holliday-Heyward-Adams-Peralta-Wong-Molina-Pitcher0.326
37Jay-Wong-Molina-Carpenter-Heyward-Holliday-Adams-Peralta-Pitcher0.327
38Carpenter-Heyward-Holliday-Adams-Jay-Peralta-Wong-Molina-Pitcher0.327
39Wong-Carpenter-Holliday-Adams-Heyward-Peralta-Jay-Molina-Pitcher0.343
40Jay-Carpenter-Holliday-Adams-Heyward-Molina-Wong-Peralta-Pitcher0.348
41Jay-Heyward-Holliday-Adams-Carpenter-Molina-Peralta-Pitcher-Wong0.353
42Wong-Adams-Holliday-Carpenter-Heyward-Peralta-Molina-Pitcher-Jay0.372
43Heyward-Holliday-Adams-Carpenter-Peralta-Wong-Molina-Pitcher-Jay0.382
44Carpenter-Heyward-Holliday-Adams-Wong-Peralta-Jay-Molina-Pitcher0.388
45Carpenter-Wong-Holliday-Adams-Heyward-Molina-Peralta-Pitcher-Jay0.403
46Peralta-Heyward-Adams-Holliday-Carpenter-Wong-Molina-Pitcher-Jay0.433
47Heyward-Carpenter-Holliday-Adams-Wong-Molina-Jay-Pitcher-Peralta0.439
48Heyward-Peralta-Carpenter-Adams-Holliday-Wong-Molina-Pitcher-Jay0.469
49Heyward-Wong-Holliday-Adams-Carpenter-Molina-Peralta-Pitcher-Jay0.477
50Carpenter-Heyward-Holliday-Adams-Molina-Wong-Peralta-Pitcher-Jay0.485
......
MLBDCCarpenter-Heyward-Holliday-Adams-Molina-Peralta-Jay-Wong-Pitcher1.090
BADAdams-Peralta-Jay-Wong-Molina-Carpenter-Holliday-Heyward-Pitcher3.661
.
.
              Batting Order Frequence Table
1st2nd3rd4th5th6th7th8th9th
Heyward171602150000
Carpenter101032160000
Holliday0242213000
Adams04225120700
Wong86001071009
Peralta21102261071
Molina002021417150
Jay131100206018
Pitcher00000002822

Synergy:
10 most common back to back occurrences in lineup.
RankOccurrencesPlayer 1Player 2
132MolinaPitcher
228HollidayAdams
326PitcherJay
419HeywardHolliday
519HollidayCarpenter
619WongMolina
717PeraltaPitcher
815CarpenterHeyward
915JayHeyward
1014PitcherWong
.
10 most common back to back to back occurrences in lineup.
RankOccurrencesPlayer 1Player 2Player 3
116MolinaPitcherJay
213HeywardHollidayAdams
313WongMolinaPitcher
412PeraltaMolinaPitcher
512PitcherJayHeyward
610CarpenterHeywardHolliday
710HollidayCarpenterAdams
810PeraltaWongMolina
910PeraltaPitcherJay
10t9CarpenterHollidayAdams
10t9MolinaPitcherWong
10t9PitcherWongJay
.
.

                                         Analysis

Heyward:  Slots well at the top of the lineup as either the leadoff or second hitter.  With others better suited for the 3rd or 4th spot in the lineup, Heyward also slots in well as the 5th hitter but should not hit in the 6th thru 9th slots.

Carpenter: Surpsingly does well at cleanup along with Adams but also does well among the 1-2-5 spots like Heyward.  Carpenter shows a lot of lineup versatility if there is such a thing.

Holliday:  Should hit third.

Adams: The teams best cleanup hitter but can also move down to fifth in the lineup if need be.

Wong: No one great spot for Wong but he probably shows the most "lineup versatility" as anyone on the team  There are 6 lineup slots where Wong appeared at least 6 times.  When it comes to batting order spots, Wong is definitely the Nomad of the team.  Wong even makes 9 appearances hitting 9th, one spot behind the pitcher.

Peralta:  The simulator likes Peralta hitting 6th as he provides some pretty decent back of the lineup power.  He should definitely stay out of the top five spots in the lineup.

Molina:  6-7-8 are the best spots for Molina as only Heyward and Molina have a 14 or higher on their third most frequented lineup spot.

Jay:  Looks like the simulator likes Jay setting the table whether it be as the leadoff hitter or the quasi-leadoff hitter batting 9th.

Pitcher:  With Jay and Wong making appearances in the 9th spot the simulator pretty much calls it a crapshoot at hitting the pitcher 8th or 9th.  The pitcher should bat immediately after Molina does.

Friday, January 16, 2015

How Optimal Was The Royals 2014 Lineup

My simulator is a good tool for looking at optimal batting orders.  It can play tens of thousands and even millions (with a smaller set of games) of games while keeping the opponent static which can give you a good idea which lineups win more games.  I am using the Royals most common lineup that they used in the 2014 season and seeing how optimal the simulator thought it was.  After doing this for the Dodgers and Cardinals, I decided to move on to the Kansas City Royals.  I put in some filters to cut down on the number of lineup permutations.  I tried to mimic what the Royals manager tended to do in not hitting lefties back to back other than the 9th then leadoff hitter etc...    Of course you can't expect any manager to be implementing the most optimal lineup but you also don't want him to be giving away fractions of wins each game that can add up over a 162 game season.  So down below, I list the Top 10 lineups along with the most common 2014 lineup in a table sorted by Wins/162 games.  I also list a table showing the frequency of where each player batted in each of the top 50 lineups.  I love the batting order frequency tables as they show you which players have a few dedicated positions in the order they should be hitting in and which players are more versatile in giving you an optimal lineup.  I used 2014 final season stats as the input projections for each hitter because that is for the most part similar to the data that the manager went by.  And I did all the simulations with the opposing team using a right handed starting pitcher.

Before we begin, here is the common Royals lineup that I compared against

Aoki-Infante-Hosmer-Butler-Gordon-Perez-Moustakas-Escobar-Dyson

                                        Top 10 Lineups
LineupWins/162 GB
Aoki-Infante-Moustakas-Perez-Gordon-Escobar-Hosmer-Butler-Dyson0.000
Aoki-Escobar-Moustakas-Perez-Gordon-Infante-Dyson-Butler-Hosmer0.065
Aoki-Escobar-Moustakas-Perez-Gordon-Butler-Dyson-Infante-Hosmer0.111
Aoki-Infante-Moustakas-Perez-Gordon-Escobar-Dyson-Butler-Hosmer0.143
Aoki-Escobar-Moustakas-Perez-Gordon-Butler-Hosmer-Infante-Dyson0.164
Aoki-Escobar-Hosmer-Perez-Gordon-Infante-Moustakas-Butler-Dyson0.166
Aoki-Escobar-Moustakas-Perez-Gordon-Infante-Hosmer-Butler-Dyson0.207
Dyson-Infante-Moustakas-Perez-Gordon-Escobar-Aoki-Butler-Hosmer0.238
Aoki-Escobar-Moustakas-Perez-Hosmer-Butler-Gordon-Infante-Dyson0.308
Moustakas-Escobar-Hosmer-Perez-Gordon-Butler-Aoki-Infante-Dyson0.354
.
.
             Batting Order Frequency Table
1st2nd3rd4th5th6th7th8th9th
Aoki3000090506
Escobar03200011070
Moustakas40260501005
Perez0303905030
Gordon90003001001
Infante014000190170
Hosmer20240601008
Butler010110150230
Dyson50000015030
.
.
Note:  The most common lineup ended up 0.56 wins per 162 games behind the most optimal lineup.  Not too bad.  The simulator liked batting Perez cleanup which the Royals did not do.  The simulator also liked hitting Escobar second instead of Infante (basically switching them).
.

Wednesday, January 14, 2015

How Optimal Was The Cardinals 2014 Lineup


My simulator is a good tool for looking at optimal batting orders.  It can play tens of thousands and even millions (with a smaller set of games) of games while keeping the opponent static which can give you a good idea which lineups win more games.  Originally, taking an idea from the "straight arrows" over at The Book Blog, I decided to take the 2014 Dodgers most common lineup, that one can find over at the Baseball Reference website and compare how well that lineup does against tens of thousands of other possible lineup permutations.  Now I decided to move on to the St. Louis Cardinals mostly because I like doing this and the Cardinals have a very analytical friendly blog not one that spends endless hours discussing TV shows, taco trucks and their personal problems.  I did set some filters to cut down on the permutations, like I only looked at lineups where the pitcher hit 8th or 9th and where the best hitters didn't hit 8th or 9th and the worst hitters didn't hit 3rd or 4th etc...  I wanted to see how well one of the Cardinals most common lineups compared to what the simulator thought was the most optimal lineup.  Of course you can't expect any manager to be implementing the most optimal lineup but you also don't want him to be giving away fractions of wins each game that can add up over a 162 game season.  So down below, I list the Top 10 lineups along with the most common 2014 lineup in a table sorted by Wins/162 games.  I also list a table showing the frequency of where each player batted in each of the top 50 lineups.  I love the batting order frequency tables as they show you which players have a few dedicated positions in the order they should be hitting in and which players are more versatile in giving you an optimal lineup.  I used 2014 final season stats as the input projections for each hitter because that is for the most part similar to the data that the manager went by.  And I did all the simulations with the opposing team using a right handed starting pitcher.

Before we begin, here is the common Cardinals lineup that I compared against

Carpenter-Wong-Holliday-Craig-Molina-Adams-Peralta-Bourjos-Pitcher.


                                                      Top 10 Lineups
RankLineupWins/162 Behind
1Peralta-Carpenter-Holliday-Adams-Wong-Bourjos-Molina-Craig-Pitcher0.000
2Peralta-Carpenter-Adams-Holliday-Wong-Molina-Craig-Pitcher-Bourjos0.081
3Bourjos-Carpenter-Holliday-Adams-Peralta-Wong-Molina-Craig-Pitcher0.092
4Peralta-Carpenter-Adams-Holliday-Wong-Bourjos-Molina-Craig-Pitcher0.118
5Holliday-Carpenter-Peralta-Adams-Wong-Molina-Craig-Pitcher-Bourjos0.119
6Holliday-Carpenter-Adams-Peralta-Wong-Molina-Craig-Pitcher-Bourjos0.158
7Bourjos-Carpenter-Peralta-Holliday-Adams-Wong-Molina-Craig-Pitcher0.161
8Carpenter-Holliday-Adams-Peralta-Wong-Molina-Craig-Pitcher-Bourjos0.162
9Carpenter-Wong-Peralta-Holliday-Adams-Bourjos-Molina-Craig-Pitcher0.206
10Wong-Carpenter-Holliday-Peralta-Adams-Bourjos-Molina-Craig-Pitcher0.216

And how did the Cardinals common lineup fair? Wel, it finished 2.07 wins/162 games worse than the top ranking lineup according to the simulator. Good thing that lineup wasn't actually used 162 times but it kind of gives you a general idea of how many wins the Cardinals manager may have been leaving off the table during the entire season if you trust the output of the simulator. When I did this for the Dodgers, Mattingly's most common lineup was only 0.84 wins/162 games off from the most optimal.

           Batting Order Frequency Table
1st2nd3rd4th5th6th7th8th9th
Carpenter15197630000
Peralta55119710300
Holliday36171761000
Adams051218103200
Wong95002212200
Molina03300123101
Bourjos18700212407
Craig0000008420
Pitcher0000000842

Player by Player Analysis

Leadoff:  Matt Carpenter.  Matheny bats Carpenter leadoff and the simulator agrees that that is a good spot for him but he would be a little better off hitting second not first.  Good

Second:  Kolten Wong.  Matheny bats Wong second and the simulator doesn't think that is one of the top three places for him to hit.  It is not a totally glaring mistake as the simulator does have Wong hitting second in the 9th most optimal lineup but a better selection can be made here.  Below Average

Third:  Matt Holliday.  Matheny bats Holliday third and pretty much nails this one.  The simulator thinks that Holliday is a good third or fourth hitter in this lineup.  While Holliday does have some batting order versatility and could even slot into the second and fifth slots without deserving to be taken out behind the shed.  Great

Cleanup:  Allen Craig.  Matheny bats Craig cleanup and as you know Craig had an awful season.  To Matheny's credit he probably didn't know Craig was going to be this bad and stay this bad as long as he did but nonetheless batting Craig cleanup was not a good choice and if done enough times would be extremely costly.  The simulator liked Craig batting 8th, in front of the pitcher.  Bad

Fifth:  Yadier Molina:  Matheny bats Molina fifth and the simulator does not like him there at all.  The simulator likes the slow legged and power hitting catcher batting seventh or sixth at best where he can knock in runs and not get knocked in himself.  Bad

Sixth:  Matt Adams.  Matheny bats Adams sixth and the simulator thinks that is too low.  Mostly because the simulator already knows how bad Craig is.  The simulator likes Craig batting cleanup or in one of the other traditional power hitting slots (third or fifth).  Bad

Seventh:  Jhonny Peralta.  Matheny bats Peralta seventh and maybe he didn't know at the time he was building these lineups that Peralta would be one of his better hitters in 2014.  A look up above at the 'Batting Order Frequency' table and you really see how versatile Peralta is in this lineup.  Peralta hits leadoff in three of the four top optimal lineups and the simulator think the third, fourth and fifth slots are his best.  Good

Eighth:  Peter Bourjos.  Matheny puts the all glove not stick Bourjos eighth.  From above the simulator thinks that spot should be reserved for Allen Craig.  The simulator touts leadoff or ninth, which in and of itself is a second leadoff spot, as the most optimal placement for Bourjos.  Bourjos is leadoff in 2 of the top ten lineups and bats ninth in 4 of the top ten lineups.  There is often efficiency in batting the pitcher 8th if you have the right personnel to do it.  Bad

Ninth:  Pitcher.  The simulator has the pitcher batting 9th in 84% of the Top 50 lineups.  Good

Overall:
So overall Matheny did not do a very good job with this lineup but to his credit the simulator is using end of season (or after the fact) input projections.  If Matheny was hitting Craig cleanup when it was obvious he wasn't very good then he is greatly to blame, otherwise he gets some slack.  How much slack is up for debate.
.

Sunday, January 04, 2015

How Good Is Don Mattingly At Setting The Batting Order

.
My simulator is a good tool for looking at optimal batting orders.  It can play tens of thousands and even millions (with a smaller set of games) of games while keeping the opponent static which can give you a good idea which lineups win more games.  Taking an idea from the "straight arrows" over at The Book Blog, I decided to take the 2014 Dodgers most common lineup, that one can find over at the Baseball Reference website and compare how well that lineup does against tens of thousands of other possible lineup permutations.  I did set some filters to cut down on the permutations, like I only looked at lineups where the pitcher hit 8th or 9th and where the best hitters didn't hit 8th or 9th and the worst hitters didn't hit 3rd or 4th etc...  I wanted to see how well Mattingly's most common lineup compared to what the simulator thought was the most optimal lineup.  Of course you can't expect any manager to be implementing the most optimal lineup but you also don't want him to be giving away fractions of wins each game that can add up over a 162 game season.  So down below, I list the Top 25 lineups along with the most common 2014 lineup in a table sorted by Wins/162 games.  I also list a table showing the frequency of where each player batted in each of the top 25 lineups.  I love the batting order frequency tables as they show you which players have a few dedicated positions in the order they should be hitting in and which players are more versatile in giving you an optimal lineup.  I used 2014 final season stats as the input projections for each hitter because that is for the most part what Don Mattingly went by.  And I did all the simulations with the opposing team using a right handed starting pitcher.

Before we begin, here is the most common 2014 Dodgers lineup.

Gordon-Puig-Gonzales-Kemp-Ramirez-Crawford-Uribe-Ellis-Pitcher

                                                       Top 25 Lineups
RankLineupWins/162 Behind
1Kemp-Gordon-Ramirez-Gonzalez-Puig-Crawford-Ellis-Uribe-Pitcher0.000
2Gordon-Ellis-Ramirez-Gonzalez-Puig-Crawford-Kemp-Uribe-Pitcher0.059
3Gordon-Ellis-Crawford-Ramirez-Puig-Gonzalez-Kemp-Uribe-Pitcher0.060
4Gordon-Puig-Gonzalez-Ramirez-Crawford-Kemp-Uribe-Pitcher-Ellis0.090
5Gordon-Ellis-Gonzalez-Ramirez-Puig-Crawford-Kemp-Uribe-Pitcher0.108
6Puig-Crawford-Ramirez-Gonzalez-Kemp-Gordon-Ellis-Uribe-Pitcher0.163
7Ellis-Gordon-Ramirez-Gonzalez-Puig-Crawford-Kemp-Uribe-Pitcher0.218
8Ellis-Puig-Gonzalez-Ramirez-Crawford-Kemp-Uribe-Pitcher-Gordon0.226
9Gordon-Puig-Gonzalez-Ramirez-Kemp-Crawford-Uribe-Pitcher-Ellis0.243
10Puig-Crawford-Ramirez-Gonzalez-Kemp-Gordon-Uribe-Pitcher-Ellis0.261
11Crawford-Kemp-Gonzalez-Ramirez-Puig-Gordon-Ellis-Uribe-Pitcher0.307
12Gordon-Puig-Ramirez-Gonzalez-Kemp-Crawford-Uribe-Pitcher-Ellis0.316
13Ellis-Gordon-Ramirez-Gonzalez-Puig-Kemp-Crawford-Uribe-Pitcher0.326
14Crawford-Puig-Gonzalez-Ramirez-Kemp-Gordon-Uribe-Pitcher-Ellis0.348
15Crawford-Puig-Ramirez-Gonzalez-Kemp-Gordon-Uribe-Ellis-Pitcher0.379
16Kemp-Crawford-Ramirez-Gonzalez-Puig-Gordon-Uribe-Ellis-Pitcher0.402
17Ellis-Puig-Gonzalez-Ramirez-Crawford-Kemp-Gordon-Uribe-Pitcher0.412
18Gordon-Ramirez-Kemp-Gonzalez-Puig-Crawford-Ellis-Uribe-Pitcher0.430
19Gordon-Kemp-Gonzalez-Ramirez-Puig-Crawford-Uribe-Ellis-Pitcher0.430
20Gordon-Ramirez-Kemp-Gonzalez-Puig-Crawford-Uribe-Ellis-Pitcher0.456
21Gordon-Puig-Gonzalez-Ramirez-Kemp-Crawford-Ellis-Pitcher-Uribe0.513
22Ramirez-Gordon-Kemp-Gonzalez-Puig-Crawford-Uribe-Ellis-Pitcher0.551
23Gordon-Ellis-Crawford-Ramirez-Puig-Gonzalez-Kemp-Pitcher-Uribe0.580
24Puig-Crawford-Kemp-Gonzalez-Ramirez-Gordon-Ellis-Uribe-Pitcher0.604
25Gordon-Ramirez-Kemp-Gonzalez-Puig-Ellis-Crawford-Urube-Pitcher0.613
55Gordon-Puig-Gonzalez-Kemp-Ramirez-Crawford-Uribe-Ellis-Pitcher0.837
.
And for comparison sake the worst lineup was 3.55 wins/162 games worst than the best lineup.
Worst: Ellis-Uribe-Puig-Kemp-Gonzalez-Ramirez-Crawford-Pitcher-Gordon
.
           Batting Order Frequency Table
1st2nd3rd4th5th6th7th8th9th
Gordon1240007101
Puig3800140000
Gonzalez0091402000
Kemp225074500
Ramirez1391110000
Crawford3420311200
Uribe00000011112
Ellis440001655
Pitcher0000000817

.
Analysis:
So the simulator thinks that Mattingly left around 0.84 wins off the table over 162 games with his most common lineup.  I will leave that up to the reader if they think that is significant.  Keep in mind that one win (or WAR) is going for about $7 million dollars on the free agent market.

I think Mattingly's lineup is an above average one when using common and traditional methods for constructing a lineup.  A look at the Batting Order Frequency Table (BOF Table) does show what the simulator thinks are a few glaring mistakes though.  When we look at the BOF Table you will notice that a few players are more versatile in the lineup slot that they give the most value in.  Puig for example only slots into three locations... leadoff(3), second(8) and fifth(14) while players like Kemp and Ellis slot in to many more locations but not as frequently.  Let's walk through each player in Mattingly's lineup one at a time and look for strengths and weaknesses.

Player by Player Analysis:
Leadoff - Dee Gordon:  Mattingly has Dee Gordon in the leadoff spot and according to the simulator that is the best spot for him, though hitting 6th can be good as well as batting 2nd depending of course on the rest of the batting order makeup.  Nails it.

Second - Yasiel Puig:  Puig's best spot is hitting fifth where he can help rack up the RBIs but hitting second is also a good spot for Puig.  I think Mattingly does well on Puig's position in the order.  Good

Third - Adrian Gonzalez:  Just like with Puig, Mattingly has slotted Gonzalez into his second best spot in the batting order.  The simulator prefers Gonzalez hitting one spot lower which wouldn't ordinarily be that big of a deal as long as the person batting fourth in his place belonged there too.  Good

Cleanup - Matt Kemp:  The simulator thinks Kemp is many things but a cleanup hitter on this team is not one of them.  According to the simulator it is a big mistake to bat Kemp fourth.  There are many lineup positions that Kemp can slot into and you can still have a highly optimal lineup but fourth is not one of them.  Stink

Fifth - Hanley Ramirez:  Out of the top 25 lineups the simulator has Ramirez hitting fifth only once.  The simulator seems to like Gonzalez and Ramirez hitting in the 3rd/4th slots in either order making this another glaring mistake according to the sim.  The 4th and 5th spots in the lineup are probably not good spots to be making mistakes at.  Stink

Sixth - Carl Crawford:  Crawford also is pretty versatile in where he slots in to the top 25 lineups and Mattingly gets back on the winning track as he nails this one.  Crawford hits 6th in 11 out of the top 25 most optimal lineups including three of the top five.  Nails it.

Seventh - Juan Uribe:  The simulator thinks that Uribe should hit seventh or eighth and that is exactly where Mattingly puts him.  Slow, low on base second tier power hitters are good for the bottom of the lineup as they tend to give you that last good chance to clear the bases before the black hole of the pitcher batting.  Nails it.

Eighth - A.J. Ellis:  Ellis like Kemp is able to slot in to many different lineup spots without causing carnage to the optimization of it.  Ellis is not a very good hitter but he still does bring a decent skill of drawing walks to the table, that is why you see him hitting at the top of the lineup a few times and ninth.  His poor hitting but good on base skills are a good fit for hitting 9th and moving the pitcher to 8th as he turns in to a quasi leadoff hitter in the 9th spot.  Good.

Ninth - Pitchers Spot:  The simulator has the pitcher hitting 9th in 17 out of 25 (68%) of the top lineups.  So there can be some value to hitting the pitcher eighth but you have to have the right personnel and batting order mix to make it work.  Nails it.
.
Overall, Mattingly does a pretty good job but the simulator thinks he made big mistakes in hitting Matt Kemp cleanup and Hanley Ramirez fifth and really with the tools that Mattingly has (instincts) you really wouldn't know this was a mistake.

.