Defense-independent ERA

In baseball statistics, defense-independent ERA (dERA) is a statistic that projects what a pitcher's earned run average (ERA) would have been, if not for the effects of defense and luck on the actual games in which he pitched. The statistic was first devised by Voros McCracken in 1999.

Method
Version 2.0 of dERA uses the following statistics:
 * batters faced
 * Home runs allowed
 * Base on balls
 * Intentional base on balls
 * Strikeouts
 * Hit by pitch

0) Multiply BFP by .0074 to get the number of intentional walks allowed (dIBB).

1) Divide HB by BFP-IBB. Call this $HB. Then multiply $HB by BFP-dIBB. This number gives the DIPS number of Hit Batsmen (dHB).

2) Divide (BB-IBB) by (BFP-IBB-HB), and call this number $BB. Multiply BFP by 0.0074, and call this dIBB.
 * 2a) Then multiply $BB by (BFP-dIBB-dHB). Take this number and add IBB. This number is now the DIPS number of total walks allowed (dBB).

3) Divide K by (BFP-HB-BB) and call this number $K. Remember this number for later.
 * 3a) Multiply $K by (BFP-dBB-dHB). This gives the DIPS number of strikeouts (dK).

4) Divide HR by (BFP-HB-BB-K) and call this number $HR. Remember this number for later.
 * 4a) Multiply $HR by (BFP-dBB-dHB-dK). This gives the DIPS number of Home Runs (dHR).

5) Calculate the number of 'Balls Hit in the Field of Play'. This is BFP-dHR-dBB-dK-dHB.

6) Estimate hits per balls in the field of play ($H):
 * 6a) Take the number 0.304396 and subtract 0.010830 if the pitcher is strictly a knuckleball pitcher. If not keep the 0.304396 number.
 * 6b) Take the result from the last step and add 0.002321 if the pitcher is left-handed, if not keep the number from the above step.
 * 6c) Take the $K figure from above and multiply it by 0.04782. Subtract this number from the number in 6b.
 * 6d) Take the $HR figure from way above and multiply it by 0.08095. Subtract this number from the number in 6c.
 * 6e) Whatever remains is the $H figure.

7) To get the projected number of Hits Allowed (DIPS 'Hits Allowed', or dH), multiply $H by the number of balls hit in the field of play (BHFP).
 * 7a) Add this number to dHR. This number is the DIPS total of Hits Allowed (dH).

8) Take BFP-dBB-dHB-dK-dH and multiply that number by 1.048. Add dK to that number. Take that number and divide by 3. This is the DIPS total of Innings Pitched (dIP).

9) Sum the following products:
 * (dH-dHR)*0.49674
 * dHR*1.294375
 * (dBB-dIBB)*0.3325
 * dIBB*0.0864336
 * dK*(-0.084691)
 * dHB*0.3077
 * (BFP-dHB-dBB-dK-dH)*(-0.082927)

The sum of all of these is the DIPS total of earned runs (dER).

10) Calculate ERA as usual: (9*dER)/dIP. This is the DIPS ERA (dERA).

Alternative formulation

 * 0)  $$\rm{dIBB=0.9926 \ IBB} \,$$
 * 1)  $$\rm{dHB = HB \left ( \frac{BFP-dIBB}{BFP-IBB} \right )} \,$$
 * 2)  $$\rm{dBB = (BB-IBB) \left ( \frac{BFP-dIBB-dHB}{BFP-IBB-HB} \right )+IBB} \,$$
 * 3)  $$\rm{dK = K \left ( \frac{BFP-dIBB-dHB}{BFP-IBB-HB} \right )} \,$$
 * 4)  $$\rm{dHR = HR \left ( \frac{BFP-dHB-dBB-dK}{BFP-HB-BB-K} \right )} \,$$