### Warning - Math Ahead!

Posted:

**Wed Feb 07, 2018 5:33 pm**So I've cut down to one baseball league a year now and I've kept refining strategy for that league. The last couple of years I've tried a new valuation method for this league that I finally codified - and by codified I mean wrote a Visual Basic 6 program for it finally. Now that I actually have the code in my grubby hands I figured I'd toss out the ideas behind it to the community to discuss my reasoning and see if there are any tweaks I could get - any suggestions people might have - etc.

Down to the nitty gritty on the league...and these details really matter because while the reasoning could be applied to any league the NUMBERS involved and formulas would likely be different in every single league structure. This league is a 14 team h2h league. We have 6 keepers per year, a minor league program that keeps 8 guys with one guy being able to be kept an extra year, positions of c/1b/2b/3b/ss/3of/util/2sp/2rp/3p with 5 bench slots. Finally, we replaced k's with k/9 and put on a 30ip minimum, though most teams sit in the 40-50ip range on any given week. The teams and general strategies don't vary a lot (important to the rest of the discussion) and we generally see about 6sp's and 4rp's per roster (though I tend to run 4 or 5sp and 5rp's to leverage the low ip minimum and quality top-end arms).

Last year I saved the ending roto stats from our Yahoo league. I highly recommend anyone else in a long-term league on Yahoo do this. You have to do it on the last day of the season - once you're past that they archive the league and those stats are no longer available (at least as far as I know).

Obviously this wouldn't work unless you have some benchmarks. One way you could get those if you don't have the previous season stats is to figure out the likely owned players, figure out how much of their stats would likely apply (ie the starting rosters would likely apply most their stats, backups would just be a tiny portion), and use that to estimate what the projected end of season stat totals for the league would be.

So now, on to the strategy. I feel like h2h should have massively different valuations than roto. In a roto league concepts like Standard Gain Points, Standard Deviation Values within a category, etc. all have a lot of mathematical merit. There is marginal value to each stat and that marginal value is different from category to category.

But in a h2h league all we care about is the chances we have of winning in a given category. To put that into perspective with an example - in a roto league if I'm projected for 200sb's and 2nd place is projected for 100sb's then I've clearly done something stupid (assuming I'm not hoarding to trade of course). I get 1 more point than 2nd place but I've put a ton of resources into getting that point. However, in a h2h league if I'm projected for 105sb's my chances of beating an opponent projected for 100sb's in that category any given week is fairly small. There's a formula called Pythagorean Expectation that involves something like the following:

As mentioned in the wiki there the exponents used vary in different applications and must be tested to find a good model. Lacking the data to perform that testing though I decided to at least attempt a valuation based on the formula by sticking as close to squaring each number as possible and only tweaking results when they were...questionable.

To arrive at a player's value in a given category then I try to determine what a league average team would have in a stat as outlined above. Then I figure out what a league average team that adds this player would get in that category. For my league that meant that hitters get 90% league average on counting stats and a weighted average of their ab's / 4500 for ratio stats (average only). For starting pitchers it's 83.3% league average on wins and ip / 1175 weighted average on ratios (era/whip/k per 9). Relief pitchers are 75% for wins and saves with the same ip / 1175 for ratios.

So for example, take a player with 40hr's. The league average home runs was about 200 last year. That means adding a 40hr player would give you the 90% of 200 (180) + the 40hr's for a new total of 220hr's instead of the 200hr's. By the formula listed above that team's chances go from .500 winning percentage to 220 ^ 2 / (200 ^ 2 + 220 ^ 2) or .548.

I used Steamer projections for the first cut on this but honestly any projections system would work...I just prefer Steamer as a good starting point and then I can use my discretion to ignore things where I disagree with Steamer...rankings are just rankings - not orders. For my first cut I just turned out the projections with every stat using 2 for the exponent and no special adjustments and the results were not even close to what I'd want to use. Specifically stolen bases were overvalued compared to the market, saves were overvalued compared to the market, ratio categories (both hitting and pitching) were undervalued, and runs/rbi's slightly undervalued.

I chose to look at the ratio issues as a feature rather than a bug. I think that even a team expected to hit .220 or have an era of 4.20 has a decent shot in any given week of beating a .280 average team or 3.80 era. It's probably a better shot than an average team running up against both Billy Hamilton and Dee Gordon has of winning sb's that week. That's one thing this exercise pointed out to me. In a roto league the value of every point of batting average is VERY high. Ditto with every point of era/whip. Teams typically exist in a narrow band there and 1 point can mean the difference between winning or losing your league as you could end up moving 3 or 4 points in the standings from that 1 point in a tight league. In a h2h league though a team that averages .275 for the year is not much more likely to have a winning record in batting average than an average team (.2689 in this league last year). Because of this I accepted the variance in the ratios and moved on to look at the sb's and saves.

The sb's proved themselves very easy to tame. I just tamped down the exponent to 1.25 and saw rankings closer to what you'd expect. sb's were still a bit more valuable than typical rankings but again, in a league like this crushing your competition in a category has some benefit.

The sv's - and their effect on starting pitchers - were a bit uglier and required some extra fidgeting with the numbers to make the pitcher rankings make sense. I had to adjust the exponent on the saves down to 1.1 to get numbers I liked on the closers. Once I got the closers working out I had to set a minimum ranking in the saves category to help the starting pitchers. Because they all had a 0 in the category they were being penalized the same as a hitter that never ever stole a base. That doesn't make sense though because 1) you need starting pitchers and 2) that's not one of their categories. I addressed this by setting a floor on the save category of 0.5...the number is part arbitrary and part because that's what an 'average' player for the league contributes to the category. As this is an 'average' pitcher I went with that.

Finally, I just added the expected win percentage in each category to get a number around the 2.4 to 2.6 range. That was the player's value. I made dollar values as well just for reference by figuring out the point value of the last player picked, subtracting that from each player, and then apportioning the dollars based on the excess points each player had compared to that baseline. I'll post the results in the next post...interested in people's thoughts.

Down to the nitty gritty on the league...and these details really matter because while the reasoning could be applied to any league the NUMBERS involved and formulas would likely be different in every single league structure. This league is a 14 team h2h league. We have 6 keepers per year, a minor league program that keeps 8 guys with one guy being able to be kept an extra year, positions of c/1b/2b/3b/ss/3of/util/2sp/2rp/3p with 5 bench slots. Finally, we replaced k's with k/9 and put on a 30ip minimum, though most teams sit in the 40-50ip range on any given week. The teams and general strategies don't vary a lot (important to the rest of the discussion) and we generally see about 6sp's and 4rp's per roster (though I tend to run 4 or 5sp and 5rp's to leverage the low ip minimum and quality top-end arms).

Last year I saved the ending roto stats from our Yahoo league. I highly recommend anyone else in a long-term league on Yahoo do this. You have to do it on the last day of the season - once you're past that they archive the league and those stats are no longer available (at least as far as I know).

Obviously this wouldn't work unless you have some benchmarks. One way you could get those if you don't have the previous season stats is to figure out the likely owned players, figure out how much of their stats would likely apply (ie the starting rosters would likely apply most their stats, backups would just be a tiny portion), and use that to estimate what the projected end of season stat totals for the league would be.

So now, on to the strategy. I feel like h2h should have massively different valuations than roto. In a roto league concepts like Standard Gain Points, Standard Deviation Values within a category, etc. all have a lot of mathematical merit. There is marginal value to each stat and that marginal value is different from category to category.

But in a h2h league all we care about is the chances we have of winning in a given category. To put that into perspective with an example - in a roto league if I'm projected for 200sb's and 2nd place is projected for 100sb's then I've clearly done something stupid (assuming I'm not hoarding to trade of course). I get 1 more point than 2nd place but I've put a ton of resources into getting that point. However, in a h2h league if I'm projected for 105sb's my chances of beating an opponent projected for 100sb's in that category any given week is fairly small. There's a formula called Pythagorean Expectation that involves something like the following:

Code: Select all

`Wins Expected = My Runs ^ 2 / (My Runs ^ 2 + Their Runs ^ 2)`

As mentioned in the wiki there the exponents used vary in different applications and must be tested to find a good model. Lacking the data to perform that testing though I decided to at least attempt a valuation based on the formula by sticking as close to squaring each number as possible and only tweaking results when they were...questionable.

To arrive at a player's value in a given category then I try to determine what a league average team would have in a stat as outlined above. Then I figure out what a league average team that adds this player would get in that category. For my league that meant that hitters get 90% league average on counting stats and a weighted average of their ab's / 4500 for ratio stats (average only). For starting pitchers it's 83.3% league average on wins and ip / 1175 weighted average on ratios (era/whip/k per 9). Relief pitchers are 75% for wins and saves with the same ip / 1175 for ratios.

So for example, take a player with 40hr's. The league average home runs was about 200 last year. That means adding a 40hr player would give you the 90% of 200 (180) + the 40hr's for a new total of 220hr's instead of the 200hr's. By the formula listed above that team's chances go from .500 winning percentage to 220 ^ 2 / (200 ^ 2 + 220 ^ 2) or .548.

I used Steamer projections for the first cut on this but honestly any projections system would work...I just prefer Steamer as a good starting point and then I can use my discretion to ignore things where I disagree with Steamer...rankings are just rankings - not orders. For my first cut I just turned out the projections with every stat using 2 for the exponent and no special adjustments and the results were not even close to what I'd want to use. Specifically stolen bases were overvalued compared to the market, saves were overvalued compared to the market, ratio categories (both hitting and pitching) were undervalued, and runs/rbi's slightly undervalued.

I chose to look at the ratio issues as a feature rather than a bug. I think that even a team expected to hit .220 or have an era of 4.20 has a decent shot in any given week of beating a .280 average team or 3.80 era. It's probably a better shot than an average team running up against both Billy Hamilton and Dee Gordon has of winning sb's that week. That's one thing this exercise pointed out to me. In a roto league the value of every point of batting average is VERY high. Ditto with every point of era/whip. Teams typically exist in a narrow band there and 1 point can mean the difference between winning or losing your league as you could end up moving 3 or 4 points in the standings from that 1 point in a tight league. In a h2h league though a team that averages .275 for the year is not much more likely to have a winning record in batting average than an average team (.2689 in this league last year). Because of this I accepted the variance in the ratios and moved on to look at the sb's and saves.

The sb's proved themselves very easy to tame. I just tamped down the exponent to 1.25 and saw rankings closer to what you'd expect. sb's were still a bit more valuable than typical rankings but again, in a league like this crushing your competition in a category has some benefit.

The sv's - and their effect on starting pitchers - were a bit uglier and required some extra fidgeting with the numbers to make the pitcher rankings make sense. I had to adjust the exponent on the saves down to 1.1 to get numbers I liked on the closers. Once I got the closers working out I had to set a minimum ranking in the saves category to help the starting pitchers. Because they all had a 0 in the category they were being penalized the same as a hitter that never ever stole a base. That doesn't make sense though because 1) you need starting pitchers and 2) that's not one of their categories. I addressed this by setting a floor on the save category of 0.5...the number is part arbitrary and part because that's what an 'average' player for the league contributes to the category. As this is an 'average' pitcher I went with that.

Finally, I just added the expected win percentage in each category to get a number around the 2.4 to 2.6 range. That was the player's value. I made dollar values as well just for reference by figuring out the point value of the last player picked, subtracting that from each player, and then apportioning the dollars based on the excess points each player had compared to that baseline. I'll post the results in the next post...interested in people's thoughts.