The ERA Equation

Fictional Fantasy Baseball – The Studyball Kurmudgeons

Rarely do I freely venture into the land of mathematics, but as that pertains to statistics, one could say there is love, not anger, death and PAIN. I’m not sure my endeavors serves any other purpose other than to fascinate my brain and make it work in a different way to figure out the solution to a problem, but regardless of notoriety, the task is noble. Back in the good ol’ days I was writing equations while manic that Excel couldn’t resolve, because they were written stupidly and abhorrently complex, ah yes, sweet memory… wait, this is a not good memory… however, I was able to do most of what I wanted, but not all. Fortunately I have found a middle ground between epiphany and practicality. The mechanism of my learning has been a logical argument within Microsoft Excel (or Google Sheets): IF/AND.

Excel allows one to look at or through data in a variety of ways, and boy is there a lot of data around Baseball. I take real 7-day MLB sums from players across the league and the results tell me something about how my own scoring configuration might balance, or scale in certain areas, as appropriate. The things that are hard to write equations for are those that modify or scale a result, or have an array of possible outcomes but somehow need to all be accounted for. Building a massive array by entering all the possible outcomes is not practical when dealing in hundreds. Equations need to be sleek, quick and able to return a sensible answer under any circumstances.

My task over the last couple of days was to make a logical equation using AND, IF or both, and try to weight the ERA over a game period like ranking the scoring/yardage surrendered by NFL team defenses. ERA becomes a scaling reward for low totals, and becomes a worthless (or a negative total) after 4. I had a similar equation already written for the NFL spreadsheet but all the values and references had to be changed.

=SUM[this is just the mechanism that will total the result as an integer]

(IF([condition/test],[result if Y],[result if N]

IF(AND[condition/test],[result if Y],(IF(AND[nested IF as negative response triggers second criteria in the next argument while building off the previous argument, as long as AND is present]

My initial equation looked like this:

=SUM(IF(D1=0,””,(IF(D1<.001,[value cell 0],(IF(D1=0,[value cell 1](AND(D1<.99,D1>.001,[value cell 2],(IF(AND(D1<1.99,D1…….. so on and so forth, moving the needle higher as the ranges of ERA are graded as they fall between one of the equations areas. But I was acting like there was a value below zero I had to be worried about, which is a product of using the equation from the NFL Fantasy Scorecard where those values are possible in the net yardage equation. After taking notice of the parameter change, I rewrote the beginning. 

There is a little “housekeeping” to settle up front, taking into account all numbers that COULD BE RENDERED on the spreadsheet. The D1, lets just say is the cell where the manual ERA will be entered on the sheet.

This specific line means, if D1 has no value in it, show nothing (represented by a text quote with no text “”) since zero is an ERA value there should be nothing to render if the cell is empty. 

After the above action, the next is to squarely assign a value to 0, since bridging ranges on it is problematic. The, the lowest value in the first range, mathematically expressed in greater-than less-than form. This can be repeated over and over, laying one on top of the other as the N condition until a result is returned.

The whole equation on the spreadsheet itself looks like this:

 

=SUM(IF(C21=“”,0,(IF(AND(C21=0),Rules!B40,(IF(AND(C21>0,C21<1),Rules!B40,(IF(AND(C21>0.99,C21<2),Rules!B41,(IF(AND(C21>1.99,C21<3),Rules!B42,(IF(AND(C21>2.99,C21<4),Rules!B43,(IF(AND(C21>3.99,C21<5),Rules!B44,(IF(AND(C21>4.99,C21<6),Rules!B45,(IF(C21>5.99,Rules!B46))))))))))))))))))

Those values triggered a result dependent on the integer in the cell, and were located on a separate page within the file:

The parallel between the NFL DEF/ST is undeniable because it is pretty much the same fucking thing. Beautiful how those two very different stats have a parallel in that scale, plus the way that can be whittled until bare at times, much like watching one’s team getting tired in the 4th quarter,defending the lead… this should give something additional for my nonexistent owners to fuss about. I wish there was someone who would fuss.

Making the equation and seeing the result it had on the scorecard was very rewarding, adding a boom-or-bust possibility to the pitcher’s slots on the roster. I like potential, and I like unexpected, crushing agony. Both remind me of how nice normal is.

 

 

Now I have a new scaling toy to play with, but another though I had is that pitchers aren’t the only ones with an ERA these days. Position players are now often used as a bullpen if a game is out of reach for example, and the manager wants to save his relief bullets. This could be hell for your average owner, when suddenly your 2B throws 17 pitches and has 4 ER with zero K, HR allowed and a 9.00 ERA!!

The Studyball Kurmudgeons: Fantasy Baseball League?

I know I have said at other times that I was “satisfied” with the tinkering of the scoring. I wanted to do a “past 7 days” filter so I could see what a scoring summary might look like for that interval. I had whole season numbers, but I wanted the Head-to-Head games to be competitive, not boring and incrementally relevant despite the season’s length. I saw what a above average season point output would look like, and there were clearly some areas that needed adjusting.opportunity to scale some things back. The I ran a new set of season numbers with mid level talent and tinkered with the balance some more.

The latest set of numbers came from a pretty high-output names, and some not so much. I think this latest tinkering is the best to date, since I am very concerned with the individual games not being monotonous. I also added a handful of “high level” achievement in the game, like a grand slam, a no hitter… etc.

The overall model is balanced enough to keep things competitive among similarly knowledgeable players, mind you. The bonus FPs from a big play is probably enough to lift someone who is trailing late, or crush your foe into the turf with a massive play that sets you on the path to victory.

Let me first show you the scorecard, which was totally redone as of last time I wrote about it.

 

 

 

 

95% of that is real data from active players over the last week, and it helped me to see where the final adjustments to the scoring were to be made. With the recent live-data scenario, I can say that the current scoring setup promotes intense and interesting games, and that’s the main point. Here are the (maybe) final scoring tweaks.

 

Clearly position players other than pitchers do well in this mode, but the pitchers come out looking like NFL fantasy quarterbacks. When they’re hot, they’re lighting everyone up and things are generally: yay! When they’re not, they become a vast, expanding black hole consuming all nearby fantasy points if they stray too close.

 

Big plays get rewarded, sometimes massively. Emongously. Trabookafred!

 

 

Maybe one day I might run this league… probably not though.

It’s just fun to think about.

Another, differently shaped golden trophy would look nice in my castle.

5-4 Triple Play

Two Texas Rangers infielders made 3 outs all by themselves, which is among the more insane things I’ve seen happen during live sports over the years. I’ve never seen two pickles in one play, or any of those shenanigans.

Pretty miraculous play (this being the third time since 1961 that it has ever happened)

https://www.youtube.com/watch?v=OqcdoLUB4Jwhttp://www.espn.com/video/clip?id=24395792

**Sorry, that other link broke

Head-to-Head Format Fantasy Baseball

I have been watching sports for a long time and am also a very data-horny person in general. Fantasy Football was a good fit, but weekly single matchups are very stressful.

Theoretically, Baseball is much less strenuous, though still very inside-knowledge dependent. Also, because of the unusually long season, presents a more gradual advancement towards some final playoff-like confrontation. I’ve had a look at the formats available, and I think I like Head-to-Head the best. Comprehensive approach to stat calculation presents an uncomfortably large swath of statistical accumulation to process and deliberate about, as Rotisserie would seem to indicate. For me, the contest would have to be rooted in the more elegant aspects of the sport, and values achievements of significance, skill or consistency above others. I’d like to discuss a few of these, and why I believe they should be weighted in some way, and specifically tracked in the H2H format:

Defensive

(Outfield) Assists: The outfield assist might be my favorite play in all of Baseball, because it requires perfect body-mechanics to execute effectively. Also, having a runner thrown out at home, or caught trying to leg-out a double or triple is flaming-hot fried action. It doesn’t get much sexier than that. The deep outfield assist is easily the hardest throw to make in all of MLB (in a close second: the throw from third base foul territory to first before the runner is also a cannon-shot).

Double Plays: These coordinated exchanges can be stressful, improbable and miraculous at times. Among my favorites are the Strike-out/Throw-out, a long 6, 4, 3 or the Fly-out/Throw-out DP. When executed, they represent a tight-knit unit of infielders who can turn-two under any number of precarious, low-success probability circumstances.

Strikeouts: Obvious choice, but also a critical stat for determining the “overpoweryness” of a pitcher, which is a thing I like to track. Strikeouts looking, if they could be divided and weighted from strikeouts swinging, should be a tick or two more valuable than the latter. Either hitters get duped into thinking the pitch is junk, or they swing at something appealing that rapidly becomes junk on its way to the plate. Either way, very satisfying as an observer (except when it’s my guy who strikes out).

Pick-Offs: Though relatively uncommon, it should be a requirement of pitchers to have a sneaky pick-off move. It’s a skill thing, because pitchers should also be effective as fielders from the mound. Pick offs are particularly sweet because it’s the pitcher erasing his own mistake, and also requires a player who is not only good at throwing 90 feet from the windup or stretch, but also slinging it fast to first to nab some unsuspecting, or leaning-too-far-to-second individual.

Offensive

2-Out Runs Batted In: This is all about clutch. Hitting when it is most needed, driving in critical runs… its the sort of thing that light a fire under a team. This would up the RBI value in that scenario by a large degree. There is no more important single statistic for a player, in my mind, than this one. This is the stat that wins games.

Doubles: Why doubles? Because they are a lot like home runs, just on a different, more arduous trajectory. A double requires a batter to suddenly take flight around first to ensure the hit is not squandered as a single. Triples are fun, but they’re really mostly just poorly fielded doubles, which isn’t a miraculous thing IMHO. Doubles are also a good judge of power, and almost certainly boost nearly every relevant stat an offensive player can accumulate.

Home Runs: Chicks dig the long ball, and so do I. Though, if possible the Inside-the-Park-Home-Run would be astronomically more valuable than your standard home run. They are also a rating of power, and is often the engine behind RBI. Simply put, home runs are spectacular, and they are a part of the shiny entertainment value of the sport at its core. Players tend to fall into grooves seeing the ball well, and HR tracks that trend as well.

Stolen Bases: A feat of quickness, timing and keen observation skills. They also have a chance to be very effectual in the course of the game, and stealing home would obviously be massively valued over any other base, not just in statisitcal value but in the “feat of skill” aspect. For me, “manufacturing runs,” which is a “small-ball” concept of persistence and timely quickness is entertaining. Teams that don’t have the higher Batting Averages tend to steal more bases, and finding a player that hits well and steals bases is optimal.

Base/Modified Scoring Breakdown

Defensive Scoring Categories

Win = 5.5
Save = 7.75
Hold = 3
Assist = 2.75 (OF = 4)
Double Play =  4.25
Pick-Off = 5.25
Strikeout = 1

Loss = (-2.5)
Blown Save = (-9.5)
Error = (-.75)
Home Run Allowed = (-1.25)

Offensive Scoring Categories

Run Scored – 1
Run Batted In – 1.25
Single – 1.5
Double – 2.75
Triple – 3.25
Home Run – 5
2-Out Runs Batted In = 2.75
Stolen Base = 1.5 (Home = 2.75)

Caught Stealing = (-2)
Strikeout = (-1.25)
Grounded Into Double Play = (-3.75)

Under terms such as these, I think a low-maintenance league might be fun… but the scope of invested time on research is daunting to say the least.

Roster size is of importance as well, and I have that consideration when amplifying the point totals. It’s a scaled-down version of the standard model:

NL Model Roster Positions

1B (1)

2B (1)

3B (1)

C (2)

OF (4)

SP (5)

RP (3)

FLEX (2)

BENCH (6)

Total = 25

That sort of describes what I fancy about MLB… there are many little corners of statistical fascination and rarity that please my brain. The fact that Baseball is so heavily dependent on stats plays a big part in why it smells interesting and so, I just keep sniffing it. I like to sniff the smoodge.