# Defense-Independent Component ERA (DICE) Calculator (Baseball)

## What is DICE?

DICE is a modification of Component ERA (ERC) that attempts to create a pitching metric that is independent of the performance of the rest of the defensive team.
The Component ERA metric was built to create a pitching metric that revolved around the pitcher-batter relationship more than it revolved around the number of runs earned (a result that is arguably further outside of a pitcher’s control).
The Defense-Independent Component ERA metric is intended to meet the goals of Component ERA, as well completely remove the performance of the non-pitching defensive team to create a metric that independently evaluates pitching performance.

## How to Calculate DICE

In Baseball, DICE is calculated as:
$\text{DICE} = 3.00 + \frac{(13\times\text{Home Runs})+(3\times(\text{Walks}+\text{Hit by Pitch}))-(2\times\text{Strikeouts})}{\text{Innings Pitched} + (\text{Outs Pitched (Partial Innings)}/3)}$

## Example

If pitcher has the following statistics:
Walks: 43 | Strikeouts: 207 | Home Runs: 35 | Batters Hit: 2 | Innings Pitched: 202 | Outs Pitched (Partial Innings): 1
then:
$\text{DICE} = 3.00 + \frac{(13\times35)+(3\times(43+2))-(2\times207)}{202 + (1/3)}$
$\text{DICE} = 3.00 + \frac{455+(3\times45)-414}{202.333333}$
$\text{DICE} = 3.00 + \frac{455+135-414}{202.333333}$
$\text{DICE} = 3.00 + \frac{176}{202.333333}$
$\text{DICE} = 3.00 + 0.86985$
$\text{DICE} = 3.86985$
Therefore, the pitcher’s Defense-Independent Component ERA is 3.870.