THE BOOK cover
The Unwritten Book is Finally Written!
An in-depth analysis of: The sacrifice bunt, batter/pitcher matchups, the intentional base on balls, optimizing a batting lineup, hot and cold streaks, clutch performance, platooning strategies, and much more.
Read Excerpts & Customer Reviews
If you are a media member and would like a review copy of The Book, please contact Kevin Cuddihy of Potomac Books.

Buy The Book from Amazon

MOST RECENT ARTICLES
MAIL : You ask | We say

Advanced


THE BOOK--Playing The Percentages In Baseball

<< Back to main

Monday, August 14, 2006

Implentation v Framework

By Tangotiger, 08:48 AM

There is a world of difference between a framework, and an implementation.  A framework is a structure that defines how all its components interact.  An implementation is using the framework to create a solution.  If you don’t like the solution, it’s not the framework’s fault (necessarily), but the implementation.  Java can be a framework, while MLB.com is an implementation of Java.

Now, Charlie Pavitt tries to defend Linear Weights to Bill James.
http://www.philbirnbaum.com/pavittonwinshares.html
He says:

Linear Weights, in sharp contrast with both, wants to be able to compare players’ performance for a given year in an environment free of contexts such as team wins or team strategy.

Now…


The reason that Bill James doesn’t “get” Linear Weights (or hasn’t gotten it, based on his writings) is the misapplication of framework and implementation.

As anyone who has read Chapter 1 of The Book knows, the run values of each events are what they are.  And, when multiplied by the frequency of the event, the sum of which must equal zero.  This is the framework of Linear Weights.  It is what it is.  The framework of Linear Weights is entirely dependent on its context.  The run value of a walk is what it is because of the environment in which it occurs.  The basis of the framework is that you have to know what the environment contains, so that you can measure how much of an impact an event has on that environment. 

Now, what can you do with this framework?  That’s a discussion of an implementation.  In The Hidden Game, and subsequent Total Baseball and ESPN Encyclopedias, Pete Palmer comes up with run values relative to average.  A player that is average gets a run value of zero, while a player who produces less than average gets a negative number.  Bill James, among others, decries that we dare say someone has “negative” value.  And, even worse, a pitcher who is 14-15, with a corresponding ERA, would come out worse than a pitcher who is 2-1, with a corresponding ERA.  This is a problem with Palmer’s implementation of Linear Weights, and not its framework.

The framework itself is perfect, more or less, because it follows reality.  The implementation is different, because it measures two different things.  For example, let’s say my salary, in my industry, may be 20,000$ less than average, meaning I’d get a -20 score.  But, I’m still earning a living, and paying bills.  It’s not like I have no monetary value.  I simply make less than someone else in my industry.  Maybe that’s meaningful to you, and maybe that’s meaningless.  I don’t know.

A better implementation of the framework is to convert the player’s run value into it’s pluses and minuses.  Instead of saying said hitter is -1 runs, you can say he’s +119 runs when he does something that helps his team, and -120 runs when he doesn’t.  If some schmoe on the bench is +1, maybe he’s +21 runs and -20 runs.  See what I did?  All I did was give the implementation more context.  You always need to see the plus with the minus, or the total against the opportunities.  Wins and Losses, or Wins and Games.

Win Probability Added (WPA) has the same implementation issues as Palmer’s Linear Weights.  By definition WPA is win advancement (WA) minus loss advancement (LA).  If you see a starting pitcher go 7 innings, with a WPA of -0.1, and a relief pitcher go two-thirds of an inning with +0.1, it looks strange.  But, that’s because the WPA implementation is missing critical data.  If you do WA minus LA, and you show the starter as being +0.8 and -0.9. and the relievers as +0.1, and -0.0, it’s more apparent what happened.  The starter pitched alot, and he kept his team in the game, but not as much as the opposing starter.  The reliever came in for a very short period of time, and did his job.

Which one was more valuable?  The likelihood is that the starter was more valuable, since there is value in just being on the field.  (But, not if you are Cristian Guzman).

Implementation, Framework.  Two different things. 

#1    David Smyth      (see all posts) 2006/08/14 (Mon) @ 10:03

Very good explanation of this issue. I have to assume that James knows he is arguing with the implementation of LWts rather than the framework. He is just kind of loose in his terminology.


#2    awsytn      (see all posts) 2006/08/14 (Mon) @ 11:52

I’ve only really started to get into James’s writings, but I find it bizarre that he (or anyone) resists the idea that players could make negative contributions (this is the fundamental flaw in the Win Shares system, right, that he only considers positive contributions?). Maybe I’m still sore at watching Juan Castro and Tony Batista man the left side of the Twins infield for the first two months of the season, but I just don’t get it.


#3    Tangotiger      (see all posts) 2006/08/14 (Mon) @ 13:09

He considers positive (hits, walks, etc) and negative (outs) by merging them into a single unit (wins), which by definition cannot be negative.

Converting relative measures into absolute measures like this is bound to fail at some point.  Rob Wood and I discussed Win Shares here:
http://www.tangotiger.net/winshares.pdf


#4    studes      (see all posts) 2006/08/14 (Mon) @ 13:23

I think this essay only covers part of what James objects to about Linear Weights.  His rant against LW goes back many years.

I forget when he wrote it, but I distinctly remember an essay James wrote attacking LW because the weights weren’t developed until after the season had ended.  What good was that?, he asked rhetorically.

Addressing all of James’s objections to LW would take up some significant space.  Unfortunately, it’s an argumentative dichotomy that doesn’t really have to exist.


#5    Patriot      (see all posts) 2006/08/14 (Mon) @ 15:05

I believe that Studes is thinking about his piece in the Original Historical Abstract (the only blemish on a great masterpiece for my money).  It is filled with so many distortions of what LW actually is, even in Palmer’s implentations, and without shoddy thinking by Bill.

Perhaps Palmer did not explain himself well enough in The Hidden Game, and so perhaps some of the confusion about specific applications of the method on Bill’s part can be overlooked.  The problem is that everybody reads James, and sometimes accepts of all of this as fact and does not divorce it from Plamer’s specific implementation and lump it onto LW in general.  There was a big run estimator thread on Primer earlier this year and the same old falsehoods were being repeated.


#6    Joe Arthur      (see all posts) 2006/08/15 (Tue) @ 04:26

I think there’s no perhaps about it; Palmer did not explain his method in sufficient detail.

I think the framework/implementation distinction is fair in theory, but I don’t think that has much, if anything, to do with why James “doesn’t get it.” It’s pretty clear that James had objections to the framework as well, and to Palmer’s interpretations of the results of his implementation.

Also, I think I’d distinguish what’s framework and what’s implementation differently than Tom seems to intend. 1) the exact events chosen to be valued and the values given to them are implementation, not framework [it’s not true in a platonic sense that “the values are what they are"] 2) the choice to balance to zero is implementation, not framework. 3) the choice to alter the value of an out for changing run environments each league/year is an implementation choice.

This would enable me, if I wanted to, to identify Paul Johnson’s Estimated Runs Produced as an implementation of a linear weights framework.


#7    tangotiger      (see all posts) 2006/08/15 (Tue) @ 07:23

In #2, it is framework, not implementation.  The Run Expectancy model does not treat the out any differently than any other event.  (I should say that the framework should not be called Linear Weights, but Run Expectancy.)

Every event changes the base/out state.  It’s zero-sum by definition.

***

For #3, the choice to make the out dynamic rather than all events dynamic is an implementation choice.  Palmer knew it was wrong (since he did show the custom lwts for each run environment), but it makes life easier.  The problem is that people really didn’t know that.  I’m as big a proponent of the RE model and LWTS that there is, and it took me a very long time to realize how much the run environment impacts the run value of each event, not just the out.  I can imagine how people who don’t devote their time to this wouldn’t appreciate this.


#8    Phil Birnbaum      (see all posts) 2006/08/15 (Tue) @ 10:11

I would argue that Bill is interpreting Linear Weights as if it represents a player’s value.  It does not.  It represents the player’s value *above or below average*. 

They measure two different things.  It is legitimate to criticize *the misapplication of linear weights to measure players’ value,* just as it is legitimate to criticize the use of a ruler to measure weight.

LW does not answer the question Bill is asking.  Win Shares does not answer the question Pete is asking.  It’s as simple as that, I think.

Of course, if Pete is trying to apply Linear Weights to answer the question of a player’s bulk value, then Bill is right—Linear Weights (unadjusted) is not appropriate to that question.  But it’s not a problem with Linear Weights, it’s a problem of its application.


#9    Joe Arthur      (see all posts) 2006/08/16 (Wed) @ 06:20

Tango,

perhaps we’re descending deep into the pit of semantic misunderstanding here. Because of the way this blog entry started (a critique of James’ critique of linear weights), and because one of James’s criticisms is very general ["run creation is multiplicative, not linear"] I was tempted to talk about a framework for linear weighted systems in general. Within the ‘family’ of linear weighted systems, there is a dominant subfamily which includes yours and Palmer’s. This subfamily can certainly be described as having a more specifically articulated framework of its own.

As to summing by zero by definition, since I’m thinking of the framework of linear weights in a more general way, I would still say it’s implementation. Perhaps you do want to call it part of your framework.

How do you get to zero sum? You start with data to build a run expectancy table. You build yours with events measured in the batting line. Consider the analogous base/out transition table with a starting state of (0 baserunners,0 outs) and value of .454 or .559 or whatever and end at state (x,3) with value of .000. Summing of that to zero clearly occurs when 2 conditions apply: a) initial value = average b) the matrix is applied precisely to the same set of innings from which the transition values were derived. [If you apply the weights to an individual season out of many, or to a new season, they are very unlikely to sum to zero]. Using the same data, you build an equivalent table and measuring values pretty much against the events measured in the standard batting line. I think the same constraints have to apply as they do to the base/out version of the run expectancy table.  In fact, the way you (brilliantly!) built the run expectency table in The Book, by throwing out partial innings, you would not quite sum to zero exactly when you apply the weights back and include the events in partial innings.

If someone constructed (by simulation) a run expectency table which was based on replacement level batting against average pitching, so that the initial state was worth .300 runs and etc for the following states, deriving batting event values as you do, I would still call that a linear weights system, one whose overall framework would certainly be similar to yours. It would not then sum to zero when applied to real batting lines; I think the values returned would be +- replacement instead of +- average.

I hope that makes it clearer where I’m coming from.


#10    tangotiger      (see all posts) 2006/08/16 (Wed) @ 07:02

Sounds semantical more than anything.  The “RE framework based on conditions of the sample data”, I suppose is what it is.


Page 1 of 1 pages


Name (required)
E-Mail (optional)
Website (optional)

<< Back to main


Latest...

COMMENTS

Nov 20 01:43
Sabermetric Moves of the 2009 Pre-Season

Nov 20 04:02
Nate Silver: hero to interviewers

Nov 20 02:01
My 1B is better than your 1B

Nov 20 00:26
MLB logo

Nov 19 23:03
NBA’s Marcel

Nov 19 19:13
Offense by position groups by decade

Nov 19 17:32
Changes in home run rates during the Retrosheet years

Nov 19 16:40
One Year and One Million Hits Later

Nov 19 16:22
Soria as a starter?

Nov 19 13:50
Response of a fired head coach