Bleed Cubbie Blue: An SB Nation Community

Navigation: Jump to content areas:



Sports blogs for fans, by fans.
Around SBN: Steve McNair Found Shot to Death


lineup optimization using Cubs 2008 ZiPS projections

Back in 2006, I got it into my head to try my hand at writing a simulator for the express purpose of optimizing lineups. It would go through all 9! permutations of the lineup and actually play simulated games, and then output the average runs scored for each lineup. You can see the original post here and the follow-up using stats taken from the 2005 Astros here. I never did get around to updating the algorithm (although it's still on my to-do list), but since I finally got myself a new computer I decided to try something that my friend suggested, which was to run a set of projections through the program in order to predict what the optimum lineup would be for the forthcoming year.

The program finally finished the run (marginally faster - about 50 hours run time) using the 2008 ZiPS projections for the Cubs. I used the projections for the following eight players: Lee, Ramirez, Fukudome, Soto, Pie, DeRosa, Theriot, and Soriano; and then summed up the actual 2007 lines for the five pitchers with the most ABs (Z, Lilly, Hill, Marshall, Marquis) to make a sort of "average" pitcher. I'd like to reiterate that this algorithm doesn't take into account errors, steals, player speed, GIDP, handedness, sacrifice flies or sac bunts, and baserunning is strictly station-to-station. The algorithm also does not take into account any other strategy - i.e., it doesn't pitch around guys to get to the pitcher. In addition, ZiPS doesn't project hit-by-pitches.

That said, here are the results for the top 10 and bottom 10 lineups, as well as the results for the starting lineup from the March 18th spring training game.

March 18th starting lineup
Runs/season Runs/9 1st 2nd 3rd 4th 5th 6th 7th 8th 9th
596.248 3.681 Theriot Soriano Lee Ramirez Fukudome DeRosa Soto Pie pitcher
Top 10
Runs/season Runs/9 1st 2nd 3rd 4th 5th 6th 7th 8th 9th
606.033 3.741 DeRosa Fukudome Lee Soto Ramirez Soriano Pie pitcher Theriot
605.697 3.739 Fukudome Lee Ramirez Soto Soriano Pie pitcher Theriot DeRosa
605.402 3.737 Fukudome Lee Soto Ramirez Soriano Pie pitcher DeRosa Theriot
605.378 3.737 DeRosa Lee Fukudome Ramirez Soto Soriano Pie pitcher Theriot
605.314 3.737 Fukudome DeRosa Lee Soriano Ramirez Soto Pie pitcher Theriot
605.294 3.736 Fukudome Lee Ramirez Soriano Pie Soto pitcher Theriot DeRosa
605.287 3.736 DeRosa Soto Fukudome Lee Ramirez Soriano Pie pitcher Theriot
605.286 3.736 Fukudome Soto Lee Ramirez Soriano Pie pitcher Theriot DeRosa
605.268 3.736 Fukudome Lee Soto Pie Ramirez Soriano pitcher Theriot DeRosa
605.223 3.736 Fukudome Lee Ramirez Soriano Soto Pie pitcher Theriot DeRosa
Bottom 10
Runs/season Runs/9 1st 2nd 3rd 4th 5th 6th 7th 8th 9th
565.289 3.489 DeRosa Fukudome Theriot pitcher Pie Soto Soriano Ramirez Lee
565.301 3.49 Pie DeRosa Fukudome Theriot pitcher Soto Soriano Ramirez Lee
565.562 3.491 DeRosa Theriot Fukudome pitcher Pie Soto Soriano Ramirez Lee
565.64 3.492 Pie DeRosa Fukudome Theriot pitcher Ramirez Soto Soriano Lee
565.697 3.492 Fukudome Theriot DeRosa pitcher Pie Soriano Ramirez Soto Lee
565.715 3.492 DeRosa Theriot Pie pitcher Soto Soriano Ramirez Lee Fukudome
565.758 3.492 DeRosa Theriot Fukudome pitcher Pie Soriano Ramirez Soto Lee
565.808 3.493 Fukudome DeRosa Theriot pitcher Pie Soriano Soto Ramirez Lee
565.833 3.493 Theriot Pie Fukudome DeRosa pitcher Soriano Soto Lee Ramirez
565.878 3.493 DeRosa Theriot Pie pitcher Soriano Ramirez Soto Lee Fukudome

There is some evidence for putting your best OBP player (Fukudome) in the leadoff spot, followed by your best OPS guys with an emphasis on OBP. Unfortunately, the 2008 Cubs ZiPS projections probably aren't the best lineup for determining generalities about each lineup slot; the top 4 hitters are all within 60 points of each other in projected OPS, and the top 6 projected starters all have projected OBP within 50 points of each other as well. However, there is good support for LaRussa's "second leadoff hitter" in the 9-hole, and maybe even a "third leadoff hitter" with the pitcher in the 7th or 8th slot depending on whether your real leadoff hitter also has good pop or not. The optimum lineup here is only about 10 runs (maybe 1 win) better than the lineup Lou fielded on March 18th.

Crossposted at my website.

Star-divide

 

This is a FanPost and does not necessarily reflect the views of SB Nation or Al Yellon, editor-in-chief (unless it's a FanPost posted by Al). FanPost opinions are valued expressions of opinion by passionate and knowledgeable baseball fans.

1 recs | Comment 24 comments

Story-email Email Printer Print

Around SB Nation

Brewers 11, Cubs 2

Jul 2009 from Brew Crew Ball - 22 comments

Cubs 2, Brewers 1 (10 innings)

Jul 2009 from Brew Crew Ball - 119 comments

Derrek Lee as trade bait?

Jul 2009 from MLB Daily Dish - 4 comments

Cubs 9, Brewers 5

Jul 2009 from Brew Crew Ball - 28 comments

East Coast Bias

Jun 2009 from Blueshirt Banter - 12 comments

Comments

Display:

Interesting...

that Soto is in the top 4 spots in 60% of the best lineups and in the last 4 in 90% of the worst lineups. Did you forward this to LPiniella@Cubs.com?

As I've told you before, I never repeat myself.

by santoswoodenlegs on Mar 20, 2008 12:24 PM CDT reply reply actions actions   0 recs

Interesting...

that Soto is in batting 2-4 in 60% of the top 10 lineups and 6-8 in 90% of the bottom 10. Did you forward this to l_piniella@cubs.com?

As I've told you before, I never repeat myself.

by santoswoodenlegs on Mar 20, 2008 12:28 PM CDT reply reply actions actions   0 recs

OK, explain why you changed the e-mail address protocol...

...the second time.

Ladies and gentlemen, your 2008 Chicago Cubs starting outfield: Soriano-Pie-Fukudome. Let it be.

by dat cubfan daver on Mar 20, 2008 12:35 PM CDT to parent up reply reply actions actions   0 recs

Interesting...

that I just repeated myself...weird hiccup I guess. I tried to post the first comment and accidentally clicked another link that took me away from the diary. When I came back I didn't see my post so I reposted my original thoughts....

As I've told you before, I never repeat myself.

by santoswoodenlegs on Mar 20, 2008 12:36 PM CDT to parent up reply reply actions actions   0 recs

Somehow, I can't see Lou perusing email.

But maybe that's just me.

"That's my opinion and if you don't like it, well, I have others." ~ Groucho Marx

by Al on Mar 20, 2008 12:44 PM CDT to parent up reply reply actions actions   0 recs

re: Somehow, I can't see Lou perusing email.

I could see Lou having that machine that prints out your e-mail as it comes in. I keep hearing radio ads for this thing.

Ladies and gentlemen, your 2008 Chicago Cubs starting outfield: Soriano-Pie-Fukudome. Let it be.

by dat cubfan daver on Mar 20, 2008 12:49 PM CDT to parent up reply reply actions actions   0 recs

Radio?

What's a radio? Oh yeah....I've seen some banner ads on the internet about those "wireless RF audio recievers"...but I think their outdated and usless.

As I've told you before, I never repeat myself.

by santoswoodenlegs on Mar 20, 2008 1:03 PM CDT to parent up reply reply actions actions   0 recs

Oh, and getting to the topic at hand...

...I agree that Soto's various spots in the lineup are interesting. In fact, I'm not going to go as far as saying that this team's success depends on Soto's at coming through as projected, but I think he could make the difference between this team being great and it just being good.

I, too, notice that none of the top lineups have the pitcher in the nine spot. I know it's not popular to support what's perhaps fast becoming known as "the LaRussa model," but this concept does intrigue me.

I heard a snippet from an interview with Bill James on the Score last week , and he made the pretty valid point that batting the pitcher and catcher last was really just an arbitrary decision made decades (upon decades) ago, and that the decision wasn't based on any research whatsoever. He predicted that, within a few years, moving the pitcher out of the nine-hole will become fairly commonplace. I'm not necessarily criticizing Lou for not making this move now but, like I said, it's an intriguing concept.

Ladies and gentlemen, your 2008 Chicago Cubs starting outfield: Soriano-Pie-Fukudome. Let it be.

by dat cubfan daver on Mar 20, 2008 12:47 PM CDT to parent up reply reply actions actions   0 recs

regarding the "LaRussa model"

Statistically speaking, it makes a ton of sense. In general, each spot in the order sees about 2-4% fewer plate appearances than the spot before it. If your worst regular is more than 4% better than your pitcher (quite probable), the strategic advantage of putting him in 9th may outweigh the reduction caused by the decrease in PAs.

by false cognate on Mar 20, 2008 1:25 PM CDT to parent up reply reply actions actions   0 recs

especially with a guy like soriano batting 1st, who would benefit greatly from having runners on. that said, since he seems to slump badly the first month, it may not matter.

by dr stabbingworth on Apr 9, 2008 6:20 PM CDT to parent up reply reply actions actions   0 recs

also worth noting

is that the differential between the worst and best lineups is about 40 runs, or 4 wins. It does lend some credence to the idea that lineup really doesn't matter that much, especially considering that the differential between the "standard" lineup and the "optimal" lineup is only 10 runs.

by false cognate on Mar 20, 2008 1:32 PM CDT reply reply actions actions   0 recs

Really?

It takes 10 runs on average to get a win? I must be missing something.

"Confidence is what you have before you understand the problem." Woody Allen

by BlueSox on Mar 20, 2008 1:48 PM CDT to parent up reply reply actions actions   0 recs

10 additional runs

over the course of the season is generally equated to 1 extra win. Not that it takes 10 runs to win one game, just that over the course of 162 games, if you score an extra 10 runs, you're probably one game better than you would have been had you not scored those extra runs.

If that still doesn't make sense, let me know and I'll see if I can explain it better.

by false cognate on Mar 20, 2008 1:57 PM CDT to parent up reply reply actions actions   0 recs

Ah,

I think I understand. Here's another question:

Is there any way to figure out how much of the error in projections like this can be attributed to the stats that are left out (i.e., errors, steals, etc.)?

"Confidence is what you have before you understand the problem." Woody Allen

by BlueSox on Mar 20, 2008 2:13 PM CDT to parent up reply reply actions actions   0 recs

well

It's not too hard to take a crack at some of them. The 2007 Cubs reached on error 82 times. A walk or a single is valued between 0.4 and 0.6 runs, according to Tom Tango, so we might expect an ROE to be about the same. So you could maybe stack on another 35 - 40 runs as a result of errors against, except that I don't think it's in the batter's control whether an error is committed or not. This could be useful in validating the simulator against historical data, but wouldn't be so useful in predicting future performance.

Speed is a lot harder to model; my simulator doesn't take it into account. If a single is hit, the runners on base advance one base. Obviously, in some instances in real life, fast runners (Pie, perhaps) would advance to third. This is a non-trivial problem to solve, so I ignored it.

by false cognate on Mar 20, 2008 2:43 PM CDT to parent up reply reply actions actions   0 recs

All of those run totals look really low.

I haven't had time to look at anything other than the tables here, but using the Baseball Musings lineup simulator, the Cubs score between 4.5-5.5 RPG with about any lineup configuration I can come up with.

by cwyers on Mar 20, 2008 3:05 PM CDT to parent up reply reply actions actions   0 recs

They are low.

As I said above, my simulator doesn't take into account a lot of possibilities - errors, steals, sacrifices, speed, etc., and the baserunning is strictly station-to-station. But it should give a first order approximation. Errors and sac flies alone will probably be about 80 runs, or 0.5 runs per game.

Using the Baseball Musings lineup tool and the ZiPS projections, I max out at 5.1 runs per game, which leaves me with about another 0.8 runs per game to account for. I don't know if that can be done with just speed. One problem I have with the Baseball Musings lineup tool is that it assumes that the value of OBP and SLG for each position is independent of who is in the other positions. As you are doing the permutations, the value of an point of OBP and SLG for each slot clearly must depend on who is in the immediately following slots.

by false cognate on Mar 20, 2008 4:03 PM CDT to parent up reply reply actions actions   0 recs

I don't think that speed or the other factors...

...are what's going on here. You seem to be presuming that the advancement value of an event is equal to the number of bases taken by the batter, which isn't true - a double will score a runner from first quite often, fore example. So your model needs to reflect that fractional advancement.

by cwyers on Mar 20, 2008 4:42 PM CDT to parent up reply reply actions actions   0 recs

I understand that

That's what I mean when I say my algorithm is strictly station-to-station, because it's the easiest thing to model. Making runner advancement variable is a tricky thing to simulate because it depends on so many variables - runner speed, where the ball was hit to and fielded, defender arm strength and accuracy. Sal Baxamusa has written a similar program, and he allows runners to take one extra base if there are two outs. In preliminary testing, that helps, but it definitely doesn't make up the whole difference.

by false cognate on Mar 20, 2008 4:51 PM CDT to parent up reply reply actions actions   0 recs

Your current assumption makes everyone...

...a below-average baserunner. Simply making everyone an average baserunner will drastically improve your model.

Here's how I would suggest modeling it; presume that the average baserunner advances 2.67 bases on a double. (I think that's pretty close to accurate; I can get more detailed advancement rates when I get home tonight if you're interested.) So then use a RAND function to get a random number between 0 and 1 - if it's above .67, the runner stays at third, if it's below .67, the runner goes home.

It's a bit more complex, but I don't know that it's unworkable. (I'm the furthest thing from a computer programmer out there, so take it with a grain of salt.)

by cwyers on Mar 20, 2008 5:38 PM CDT to parent up reply reply actions actions   0 recs

Sure

Post the data if you've got it. What you suggest isn't unworkable, but it'll definitely have to wait until after I parallelize the code because it would add a significant chunk to the run time. Right now to do one run of all 9! lineups it takes about 50 hours, running at 100% on one core of my Core2Duo based computer without any compile optimization. The problem is, as they say, "embarrassingly parallel," so I should be able to cut that in half if I can get it working on both cores.

by false cognate on Mar 20, 2008 6:38 PM CDT to parent up reply reply actions actions   0 recs

I find this

very interesting. You put much work into this, for this I applaud you. The problem I have with any projections is this. How does anyone know what a Soto, Pie and Dome will actually do?

We are looking at three unproven players at the ML level. I understand what data is used for determining their stats for the year, but I think the basis is flawed.

Certainly as a Cubs fan I hope for the very best from these three. With Lee, Soriano and other proven ML, the data is solid with the history of their level of play. With these three ( Pie, Dome & Soto), which is over 33% of our fielding starters, I find it troubling thinking that all three will come to their projections supplied by any means.

Either way, I am impressed with your effort. Nicely done.

"You can't take life to seriously, you don't get out of it alive"

by wild bill on Mar 20, 2008 6:27 PM CDT reply reply actions actions   0 recs

Doesn't like Soriano..

..very much.

I'm drunk......and it shows.....

by Keystone80435 on Mar 20, 2008 10:50 PM CDT reply reply actions actions   0 recs

but i guess since it doesnt factor speed and sb it wouldnt like him.

pretty cool though.

I'm drunk......and it shows.....

by Keystone80435 on Mar 20, 2008 10:54 PM CDT to parent up reply reply actions actions   0 recs

Comments For This Post Are Closed


User Tools

Welcome to Bleed Cubbie Blue, the Chicago Cubs blog for the SB Nation, created on February 9, 2005 by Al Yellon
Start posting about the Cubs »

Join SB Nation and dive into communities focused on all your favorite teams.

FanPosts

Community blog posts and discussion.

Recommended FanPosts

Images_small
Creative Writing: July 1, the Day that Changed Everything
Pitching3_small
OT: The Next Generation: The Playoffs
Small
Cubs need to make a trade
Sexy_chicago_cubs_002_small
My Own Personal Forgetting DeRosa Pictures....Sure to make you smile.
Small
Top Prospects part 1

Recent FanPosts

340x_small
Command and control
Sandberg_small
Done Being Patient With Soriano
Small
Center field vs. last year
Cubs-5_small
Questions about new ownership...
Cutler_small
Mike Fontenot demotion?
Capt_5375a8d00e0742c0864cdb642c18eb1f_pirates_cubs_zambrano_ejected_baseball_cxc109_small
What to do with the bench
Small
Booing or not booing and why
L_bb30e2f156464d9a95bd9408091eb725_small
The Cubs need to go 7-4 the next 11 games.
Fukudome_bleachers_small
The Top 5 Cubs Games of June

Post_icon New FanPost All FanPosts Carrot-mini

FanShots

Quick hits of video, photos, quotes, chats, links and lists that you find around the web.

Recommended FanShots

via ESPN

Ronald Reagan
AP Photo/Charles Tasnadi

President Ronald Reagan throws out the ceremonial first pitch Sept. 30, 1988, at Wrigley Field before the Chicago Cubs played host to the Pittsburgh Pirates. Reagan later went to the broadcast booth and helped announce the first part of the game.
Cubs deal for Rockies' Jeff Baker
Bart Given on Gameboard vs. Lou
Cubs calling up outfielder Sam Fuld
Len Kasper's Lunch With Ernie Harwell

Recent FanShots

Peoria Chiefs @ Kane County Cougars 7/3/09
Coincidence or not, Soto has hit .315 with five home runs and 10 RBIs in...
Aramis Ramirez and Reed Johnson during warm ups at their rehab assignment with the Peoria Chiefs at Kane County.  Aramis Ramirez missed a home run by about 2 feet at his first at bat and ended up with a stand up double.  He later took a base-on-balls and scored twice. Reed Johnson also had a hit and scored.  Here are the rest of the photos.
Sam Fuld to lead off Saturday
Cubs sign Casey Fossum to a Minor League Deal
7/3:Cubs vs. Brewers

It's more walk-off magic for the Cubs, when a bases-leaded walk to Jake Fox gives them the 2-1, extra-innings win.

Damen Jackson (Cubbie Nation)
7/3:Cubs vs. Brewers

It's yet another episode of "Outfield Adventures", starring Milton Bradley, as he'd lose this Jason Kendall-hit ball in the sun Friday against the Brewers.


Damen Jackson (Cubbie Nation)
7/3:Cubs vs Brewers

Jeff Suppan is thrown out by Kosuke Fukudome in the seventh inning of the Cubs 2-1 win.

Or as Kenny Powers would put it, "You're %@$@#!! out!!"

Damen Jackson (Cubbie Nation)
"Sources tell me Soriano will bat 6 in tomorrows lineup vs....
Buster Olney said a few days ago that the Braves would entertain offers for their 26 year old shortstop (who makes 450k) Yunel Escobar. He is a plus bat, a solid defender, and would move Theriot to his more appropriate position at second.

They are looking for a bat in return. Apparently Cox doesn't like the guy. 

I couldn't even speculate what we'd have to send them in return, but I think he would be a good fit given his low salary, his productive bat, his position, and his age.  I don't care if he's a jerk if he makes the team win more.

What would it take?

Post_icon New FanShot All FanShots Carrot-mini

Cubs By The Numbers

Cubs By The Numbers is a history of the ballclub by uniform number, but the biographies help trace the history of our beloved team in a new way. For everyone who's a Cubs fan, anyone who ever wore the uniform is like family. Cubs By The Numbers reintroduces readers to some of their long-lost ancestors, even ones they think they already know.

Click here to order your copy, available now!

Recent Stories in Game Threads

Yelloncard_small
Overflow Thread 3: Cubs vs. Brewers, Saturday 7/4, 12:05 CT
Yelloncard_small
Overflow Thread 2: Cubs vs. Brewers, Saturday 7/4, 12:05 CT
Yelloncard_small
Overflow Thread 1: Cubs vs. Brewers, Saturday 7/4, 12:05 CT

Recent Stories in Ticket Exchanges

Yelloncard_small
Ticket Exchanges: July 24-30 Homestand
Yelloncard_small
Ticket Exchanges: General 2009 Ticket Exchange
Yelloncard_small
Ticket Exchanges: July 2-12 Homestand

SPONSORS


Editor-in-Chief

Yelloncard_small Al

Editorial Cartoonist

Toonmike_small toonmike

Contributors

Dsc_0139_small holy mackerel

100px-boisehawkscaplogo_small Josh77

Official Partner of Yahoo! Sports