"Total" EH  incorporating different damage types into EH
Moderators: Fridmarr, Worldie, Aergis, theckhd
Re: "New EH"  incorporating different damage types into EH
Xenix wrote:There are, however, some times where the question is "Is dA armor + dR resistance overall better than dS stam for a given fight" (e.g. the Onyxia resist ring), or similar questions for resist vs. armor, resist + health vs. armor, etc. In that case you need a coupled formula between all three variables, which is one use for the formula I posted.
In that case, you just convert dA and dR to stamina equivalents using those two formulas and compare to dS.
I'm not saying there's no value in having the fundamental formula somewhere, and it's certainly more useful for matlab situations. But in reality, I don't see many people other than you or I firing up matlab to do calculations with it.
"Theck, Bringer of Numbers and Pounding Headaches," courtesy of GrehnSkipjack.
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty

theckhd  Moderator
 Posts: 8003
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: "New EH"  incorporating different damage types into EH
theckhd wrote:In that case, you just convert dA and dR to stamina equivalents using those two formulas and compare to dS.
I'm not saying there's no value in having the fundamental formula somewhere, and it's certainly more useful for matlab situations. But in reality, I don't see many people other than you or I firing up matlab to do calculations with it.
Heh  can't argue with you much there. I'd say the main difference is in the intent of the formulas, though. Your separate formulas basically hold the fight variables constant and let armor/health/resist vary, with the intent of giving you a fightspecific formula to weight an upgrade against. Mine is more designed to to hold the upgrades constant and let the fight variables (Pmit,Pnmit and Mmit) vary, so I give you an upgradespecific equation to weight a fight against.
As an example, in a program based on your formulas, you'd pick a fight you're interested in and it could then sort all available gear based on which provides the larges NEH upgrade (which is of course also doable with the dNEH line in my own formulas). My approach, on the other hand, would let you pick a piece of gear and then would show a plot of when it is an upgrade, with markers on that plot representing each fight you're interested in. It gives you a better overall view, that doesn't require Matlab once you've found the formula, especially if you're analyzing just one piece, but people not interested in the theory would be more looking for the gear list that your approach works better for.
There's tons of data you can get out of the 7D scalar field that the NEH formula covers though, everything from what we've calculated to things like calculating an isoNEH surface in armorhealthresist space that represents the minimum NEH for a specific fight so you could plug in your armor/health/resistance to a simple inequality (like the ones for the method I posted earlier) and see if you meet it.
As much as I like the formulas I've posted, solving them for those variables instead and creating a separate surface equation based on NEH >= f(a,h,r) for each encounter/class would probably be the most useful thing to do with it, since even more than "Is this piece better for me", you want to know "Do I meet the NEH requirements for this fight". Doing that should be a simple matter of plugging the fight's coordinates in PnmitPmitMmit space to the NEH definition, setting it equal to the required NEH and reducing all the coefficients as much as possible.
Once again, this would be easily possible to do for your specific armor/health/resist using only one NEH formula calculation, but plotting the isoNEH surface would let you see what other possibilities gear choices you could make, as well as which gear possibility uses the least itemization points to meet the NEH requirements. Furthermore, you can plot a similar isoNEH surface for each class (and spec when considering death knights) to see where they lie in relation to each other if you are really curious.
Kimurellia  Holy/Protection Paladin  Scions of Destiny  EredarUS

Xenix  Posts: 244
 Joined: Thu Jun 25, 2009 4:56 am
Re: "New EH"  incorporating different damage types into EH
I had a nagging doubt about your calculation, and now that I've sat down and started to work through it I'm certain that there's a mistake in the derivation. Mostly because it's the same one that I battled through for a few hours while working on the derivation in the OP.
To make it obvious where the error is, let's go back to the EH expression. To make it easier to read, I'm going to convert back to an abbreviated notation. The particular damage types aren't important at the moment to identify the error. Instead of PNEH, PnNEH, MNEH, and MnNEH, let's just let the damage types be X, Y, Z, and W, with total mitigations Mx, My, Mz, and Mw, so that the EH formula is:
or, defining Px through Pw as the damagespecific EH contributions:
Here's where the error occurs. You then say you want to talk about gear changes which change the damagespecific EH contributions. So you introduce dPx, dPy, dPz, and dPw to represent those changes, you're looking for the plane with zero change in EH. In other words, you're differentiating this equation to get:
or using 1=X+Y+Z+W
From which you can easily find your intercepts Xo, Yo, and Zo
Unfortunately, all of those equations are wrong. While the EH equation is linear in X, Y, Z, and W, it is NOT linear in Mx, My, Mz, or Mw. Any change in Mx will change both Px and X due to the way X is defined (as a postmitigation value).
To do it properly, you'd have to differentiate like this:
Where dX would be the change in the observed damage intake percentage due to the change in mitigation for damage type X, dY would be the change in observed damage intake percentage due to the change in mitigation for damage type Y, and so forth.
Needless to say, this can get very messy very fast, and the algebra became tedious enough that after an hour or so of trying to make it work out nicely I gave up. I'm sure it's possible, but the algebra is so annoying that you're much more likely to make a mistake.
Note that for small changes, such that the observed damage intake percentages dX, dY, dZ, and dW are small, your formula will give a close enough approximation. But for anything more than a few percent (i.e. the most trivial gear changes), it starts to give erroneous results.
This is why I went back to the definition in equation (12) to start differentiating:
Here P, B, and G are the percentages of raw boss output, which are constants. So when differentiating this equation, we get an accurate representation of how changing any of those mitigation factors Mi changes EH.
The general form of the differential equation would look like this, using <stuff> to represent the denominator of equation 12:
You could convert this to a general form in X, Y, and Z:
But as you see, that's not the same as X*dPx + Y*dPy + Z*dPz + W*dPw (and, sadly, still has <stuff> in it, which requires knowledge of P, B, and G, though these can also be solved in terms of X, Y, and Z).
Just to check, you can plug in algebraically if you want  dPx is [dH + dMa*H/(1Ma) + dMt*H/(1Mt)]/(1Ma)(1Mt), and so on. If you work through it, you get:
To make it obvious where the error is, let's go back to the EH expression. To make it easier to read, I'm going to convert back to an abbreviated notation. The particular damage types aren't important at the moment to identify the error. Instead of PNEH, PnNEH, MNEH, and MnNEH, let's just let the damage types be X, Y, Z, and W, with total mitigations Mx, My, Mz, and Mw, so that the EH formula is:
 Code: Select all
EH =H*[X/(1Mx) + Y/(1My) + Z/(1Mz) + W/(1Mw)]
or, defining Px through Pw as the damagespecific EH contributions:
 Code: Select all
Px = H/(1Mx)
Py = H/(1My)
Pz = H/(1Mz)
Pw = H/(1Mw)
 Code: Select all
EH = X*Px + Y*Py + Z*Pz + W*Pw
Here's where the error occurs. You then say you want to talk about gear changes which change the damagespecific EH contributions. So you introduce dPx, dPy, dPz, and dPw to represent those changes, you're looking for the plane with zero change in EH. In other words, you're differentiating this equation to get:
 Code: Select all
d(EH) = X*dPx + Y*dPy + Z*dPz + W*dPw = 0
or using 1=X+Y+Z+W
 Code: Select all
d(EH) = X*(dPxdPw) + Y*(dPydPw) + Z*(dPzdPw) + dPw = 0
From which you can easily find your intercepts Xo, Yo, and Zo
 Code: Select all
Xo = dPw/(dPxdPw)
Yo = dPw/(dPydPw)
Zo = dPw/(dPzdPw)
Unfortunately, all of those equations are wrong. While the EH equation is linear in X, Y, Z, and W, it is NOT linear in Mx, My, Mz, or Mw. Any change in Mx will change both Px and X due to the way X is defined (as a postmitigation value).
To do it properly, you'd have to differentiate like this:
 Code: Select all
d(EH) = dX*Px + X*dPx + dY*Py + Y*dPY + ...
Where dX would be the change in the observed damage intake percentage due to the change in mitigation for damage type X, dY would be the change in observed damage intake percentage due to the change in mitigation for damage type Y, and so forth.
Needless to say, this can get very messy very fast, and the algebra became tedious enough that after an hour or so of trying to make it work out nicely I gave up. I'm sure it's possible, but the algebra is so annoying that you're much more likely to make a mistake.
Note that for small changes, such that the observed damage intake percentages dX, dY, dZ, and dW are small, your formula will give a close enough approximation. But for anything more than a few percent (i.e. the most trivial gear changes), it starts to give erroneous results.
This is why I went back to the definition in equation (12) to start differentiating:
 Code: Select all
H
EH = H*D/d =  (12)
P(1Ma)(1Mt) + B(1Mt) + G(1Mg)(1Mr)
Here P, B, and G are the percentages of raw boss output, which are constants. So when differentiating this equation, we get an accurate representation of how changing any of those mitigation factors Mi changes EH.
The general form of the differential equation would look like this, using <stuff> to represent the denominator of equation 12:
 Code: Select all
dH H
d(EH) =  + *[ dMa*P*(1Mt) + dMt*(P*(1Ma)+B) + dMg*G*(1Mr) + dMr*G*(1Mg) ]
<stuff> <stuff>^2
You could convert this to a general form in X, Y, and Z:
 Code: Select all
1 dMa*H*X dMt*H*(X+Y) dMg*H*Z dMr*H*Z
d(EH) = *[ dH +  +  +  +  ]
<stuff> (1Ma) (1Mt) (1Mg) (1Mr)
But as you see, that's not the same as X*dPx + Y*dPy + Z*dPz + W*dPw (and, sadly, still has <stuff> in it, which requires knowledge of P, B, and G, though these can also be solved in terms of X, Y, and Z).
Just to check, you can plug in algebraically if you want  dPx is [dH + dMa*H/(1Ma) + dMt*H/(1Mt)]/(1Ma)(1Mt), and so on. If you work through it, you get:
 Code: Select all
X*dPx+Y*dPy+Z*dPz = dH*(EH)/H + dMa*H*X/(1Mt)(1Ma)^2 + dMt*(HX/(1Ma)+HY)/(1Mt)^2 + dMg*HZ/(1Mr)(1Mg)^2 + dMr*Hz/(1Mg)(1Mr)^2
Last edited by theckhd on Wed Dec 02, 2009 9:09 am, edited 1 time in total.
"Theck, Bringer of Numbers and Pounding Headaches," courtesy of GrehnSkipjack.
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty

theckhd  Moderator
 Posts: 8003
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: "New EH"  incorporating different damage types into EH
As a separate thought  if your interest is doing things numerically in Matlab, there's very little point in bothering with the differentiation. We could just start from Equation 12, or a variation that included nonresistable magic damage (i.e. spellfire):
We have H, and all of the Mi's. What we don't have are P, B, G, and J  instead we have X, Y, Z, and W, along with the definitions (again using <stuff> for the denominator):
Those are three equations in four variables (since one is redundant due to the constraint of W=1XYZ). But with P+B+G+J=1 we have four, which means we can solve for P, B, G, and J in terms of X, Y, Z, and W. Putting this system of linear equations in matrix form, we have:
Solving this (I used Mathematica, but you could do it by hand if you wanted) gives us:
Plugging these into P+B+G+J=1 gives:
You could then plug this in to get definitions of P, B, and G in terms of only X, Y, and Z. That's a lot of algebra, so again I'll enlist the help of Mathematica to simplify all four expressions:
So now we have expressions for P, B, G, and J that depend only on X, Y, Z, and the Mi's (i.e. known values).
This means that to answer questions about how changing our gear affects a fight, we can follow this procedure:
1) Take X, Y, Z, and the Mi's to calculate P, B, G, and J for a given boss fight.
2) Using those known values of P, B, G, and J, use equation (12) to calculate EH based on the mitigation factors Mi. For example, this could plot EH as you vary any of the Mi's.
3) Rather than differentiate, we can just calculate EH twice for the two cases we're interested in and subtract. For example, if you want to find out if A armor is better or worse than S stamina, calculate EH for both cases and subtract to get the net difference in EH. This can easily be done for a variety of P, B, G, and J values just as you've done already, and plotted against X, Y, Z, and W instead of P, B, G, or J just by using the definitions.
 Code: Select all
H
EH = H*D/d = 
P(1Ma)(1Mt) + B(1Mt) + G(1Mg)(1Mr) + J(1Mg)
We have H, and all of the Mi's. What we don't have are P, B, G, and J  instead we have X, Y, Z, and W, along with the definitions (again using <stuff> for the denominator):
 Code: Select all
W = P(1Ma)(1Mt)/<stuff>
X = B(1Mt)/<stuff>
Y = G(1Mg)(1Mr)/<stuff>
Z = J(1Mg)/<stuff>
Those are three equations in four variables (since one is redundant due to the constraint of W=1XYZ). But with P+B+G+J=1 we have four, which means we can solve for P, B, G, and J in terms of X, Y, Z, and W. Putting this system of linear equations in matrix form, we have:
 Code: Select all
 P(1Ma)(1Mt)
 X (1X) X X  * B(1Mt)  = 0
 Y Y (1Y) Y  G(1Mg)(1Mr)
 Z Z Z (1Z) J(1Mg) 
Solving this (I used Mathematica, but you could do it by hand if you wanted) gives us:
 Code: Select all
P = ((1XYZ)/Z) * J(1Mg)/(1Ma)(1Mt)
B = (X/Z) * J(1Mg)/(1Mt)
G = (Y/Z) * J/(1Mr)
Plugging these into P+B+G+J=1 gives:
 Code: Select all
(1XYZ) J(1Mg) X J(1Mg) Y J
* + * + * + J = 1
Z (1Ma)(1Mt) Z (1Mt) Z (1Mr)
J = 1/[(1XYZ)/Z*(1Mg)/((1Ma)(1Mt)) + X/Z*(1Mg)/(1Mt) + Y/Z*1/(1Mr) + 1]
You could then plug this in to get definitions of P, B, and G in terms of only X, Y, and Z. That's a lot of algebra, so again I'll enlist the help of Mathematica to simplify all four expressions:
 Code: Select all
(1Mg)(1Mr)*(1XYZ)
P = 
(1Mg)(1Mr)(1X*MaYZ) + (1Ma)(1Mt)*(Y+(1Mr)Z)
(1Ma)(1Mg)(1Mr)*X
B = 
(1Mg)(1Mr)(1X*MaYZ) + (1Ma)(1Mt)*(Y+(1Mr)Z)
(1Ma)(1Mt)*Y
G = 
(1Mg)(1Mr)(1X*MaYZ) + (1Ma)(1Mt)*(Y+(1Mr)Z)
(1Ma)(1Mr)(1Mt)*Z
J = 
(1Mg)(1Mr)(1X*MaYZ) + (1Ma)(1Mt)*(Y+(1Mr)Z)
So now we have expressions for P, B, G, and J that depend only on X, Y, Z, and the Mi's (i.e. known values).
This means that to answer questions about how changing our gear affects a fight, we can follow this procedure:
1) Take X, Y, Z, and the Mi's to calculate P, B, G, and J for a given boss fight.
2) Using those known values of P, B, G, and J, use equation (12) to calculate EH based on the mitigation factors Mi. For example, this could plot EH as you vary any of the Mi's.
3) Rather than differentiate, we can just calculate EH twice for the two cases we're interested in and subtract. For example, if you want to find out if A armor is better or worse than S stamina, calculate EH for both cases and subtract to get the net difference in EH. This can easily be done for a variety of P, B, G, and J values just as you've done already, and plotted against X, Y, Z, and W instead of P, B, G, or J just by using the definitions.
Last edited by theckhd on Wed Dec 02, 2009 9:08 am, edited 1 time in total.
"Theck, Bringer of Numbers and Pounding Headaches," courtesy of GrehnSkipjack.
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty

theckhd  Moderator
 Posts: 8003
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: "New EH"  incorporating different damage types into EH
You guys lost me somewhere on page 5....
Can you guys confirm some numbers for Theck's variables for Mt, Mg, and Mr. Currently in my spreadsheet, I am using the following:
Can you guys confirm some numbers for Theck's variables for Mt, Mg, and Mr. Currently in my spreadsheet, I am using the following:
 Code: Select all
Mt=0.1686
Mg=0.1156
Mr=0.1000
Dakiros wrote:Hear that sound? Its Wrathy breaking Wowhead and Wordpress while he quickly comes up with the Rival set.
Avenging Wrathy  A Protection Paladin Blog
Wrathy's Guide to Gear Sets
 Wrathy
 Maintankadonor
 Posts: 548
 Joined: Sat Feb 28, 2009 4:17 pm
Re: "New EH"  incorporating different damage types into EH
Wrathy wrote:You guys lost me somewhere on page 5....
Can you guys confirm some numbers for Theck's variables for Mt, Mg, and Mr. Currently in my spreadsheet, I am using the following:
 Code: Select all
Mt=0.1686
Mg=0.1156
Mr=0.1000
Those can't be right, Mg should be larger than Mt thanks to Guarded by the Light. Which also means that I made a typo in the article when I rewrote the long part of the derivation. I'll fix that when I get home and can make sure the mfile I used is accurate.
From here, it looks like:
Mg = 0.1686 without BoSanc, 0.1936 with BoSanc, and 0.2178 with BoSanc and Renewed Hope
Mt = 0.1156 without BoSanc, 0.1421 with BoSanc, and 0.1678 with BoSanc and Renewed Hope
Ma is just A/(A+K) as in the article
Mr should be 0.1 for having an aura up (128 resistance to guarantee 10% reduction).
I would say it's probably safe to use the BoSanc values since we bring that to the table automatically. Renewed Hope is a tossup, there's no guarantee you'll have a Disc priest around, so it's probably better to ignore it.
"Theck, Bringer of Numbers and Pounding Headaches," courtesy of GrehnSkipjack.
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty

theckhd  Moderator
 Posts: 8003
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: "New EH"  incorporating different damage types into EH
Use the numbers without renewed hope: BoSanc and Renewed Hope Don't Stack
So 0.1421 and 0.1936 should be the numbers of choice.
So 0.1421 and 0.1936 should be the numbers of choice.
 Meloree
 Maintankadonor
 Posts: 1420
 Joined: Wed Mar 12, 2008 10:15 am
Re: "New EH"  incorporating different damage types into EH
Meloree wrote:Use the numbers without renewed hope: BoSanc and Renewed Hope Don't Stack
So 0.1421 and 0.1936 should be the numbers of choice.
Ah, ok. So they did finally get around to fixing that.
"Theck, Bringer of Numbers and Pounding Headaches," courtesy of GrehnSkipjack.
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty

theckhd  Moderator
 Posts: 8003
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: "New EH"  incorporating different damage types into EH
By the way, just to drive home the point about the error in the derivation, I whipped up a quick matlab script to demonstrate it: newEH.m
After doing a few test plots, it calculates the Armor:Stamina ratio three ways:
This is the result:
As you can see, the computational form is very accurate (the difference between the green line and the blue line is around 0.02 armor/stam, which is good considering we're effectively doing a coarse differentiation rather than a proper one). Xenix's form agrees for small Y, but deviates considerably once Y grows appreciably.
Anyhow, here are some pretty plots to demonstrate how you'd do the type of calculations Xenix is talking about. If we let Z=0 and let X and Y each vary from 0 to 0.4, we can convert the 2dimensional plot above into a 3dimensional one:
And perhaps more conveniently, we can invert the ratio (i.e. plot Stamina:Armor). The advantage to doing this is that instead of blowing up like the Armor:Stam ratio does (since it varies as 1/(1XY)), it's a linear function of Y and X, so we can plot it out to Y=1 and X=1. This is probably more conveniently viewed in two dimensions with a colorbar:
In other words, if every point of armor is worth 1/11.6961 = 0.0855 stamina on a purely physical fight, it's worth less on a fight with magical or bleed damage. The exact amount can be figured out by picking X and Y values, locating the color on the plot, matching that up to an approximate value on the colorbar.
The effectiveness could be found by dividing that number by 0.0855, or I could just plot that for you:
After doing a few test plots, it calculates the Armor:Stamina ratio three ways:
 The analytical form dA/dS = 12.54*(K+A)/H*1/(1XYZ)
 The "computational" form, where it calculates P,B,G,J and then calculates EH for (H,A), (H+dH,A), and (H,A+dA) and from that calculates the ratio [EH(H,A+dA)EH(H,A)]/[EH(H+dH,A)EH(H,A)]
 Analytically using Xenix's form, where we differentiate incorrectly by ignoring dX, dY, and dZ
This is the result:
As you can see, the computational form is very accurate (the difference between the green line and the blue line is around 0.02 armor/stam, which is good considering we're effectively doing a coarse differentiation rather than a proper one). Xenix's form agrees for small Y, but deviates considerably once Y grows appreciably.
Anyhow, here are some pretty plots to demonstrate how you'd do the type of calculations Xenix is talking about. If we let Z=0 and let X and Y each vary from 0 to 0.4, we can convert the 2dimensional plot above into a 3dimensional one:
And perhaps more conveniently, we can invert the ratio (i.e. plot Stamina:Armor). The advantage to doing this is that instead of blowing up like the Armor:Stam ratio does (since it varies as 1/(1XY)), it's a linear function of Y and X, so we can plot it out to Y=1 and X=1. This is probably more conveniently viewed in two dimensions with a colorbar:
In other words, if every point of armor is worth 1/11.6961 = 0.0855 stamina on a purely physical fight, it's worth less on a fight with magical or bleed damage. The exact amount can be figured out by picking X and Y values, locating the color on the plot, matching that up to an approximate value on the colorbar.
The effectiveness could be found by dividing that number by 0.0855, or I could just plot that for you:
"Theck, Bringer of Numbers and Pounding Headaches," courtesy of GrehnSkipjack.
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty

theckhd  Moderator
 Posts: 8003
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: "New EH"  incorporating different damage types into EH
Edited after doing the math:
After looking at it, you are correct  I used the NEH formula which had X/Y/Z as the postmitigation damagetype ratio thinking that it was in fact the premitigation damage% ratio. The whole "this is equal to XX differential equation" thing was something I came up with after seeing the plot in mitigation%space of a change in stats calculated from the NEH formula. If you make such a 3d plot, you will see that the deltaNEH = 0 surface is in fact a plane with the given equation, but that equation doesn't quite represent what I though it did since my axis variables were different from what I thought they were.
The formula can still be used to calculate for which fights the gear change you made is good/bad, but using the formula to extrapolate beyond that will not work unless you transform back to premitigation% space.
After looking at it, you are correct  I used the NEH formula which had X/Y/Z as the postmitigation damagetype ratio thinking that it was in fact the premitigation damage% ratio. The whole "this is equal to XX differential equation" thing was something I came up with after seeing the plot in mitigation%space of a change in stats calculated from the NEH formula. If you make such a 3d plot, you will see that the deltaNEH = 0 surface is in fact a plane with the given equation, but that equation doesn't quite represent what I though it did since my axis variables were different from what I thought they were.
The formula can still be used to calculate for which fights the gear change you made is good/bad, but using the formula to extrapolate beyond that will not work unless you transform back to premitigation% space.
Last edited by Xenix on Wed Dec 02, 2009 2:21 pm, edited 2 times in total.
Kimurellia  Holy/Protection Paladin  Scions of Destiny  EredarUS

Xenix  Posts: 244
 Joined: Thu Jun 25, 2009 4:56 am
Re: "New EH"  incorporating different damage types into EH
eh... woosh?
wtb tankadin plugin, lol
"Do I have any gear that would've boosted my EH for the past fight?"
wtb tankadin plugin, lol
"Do I have any gear that would've boosted my EH for the past fight?"

trellian  Posts: 671
 Joined: Wed Jul 16, 2008 3:02 am
 Location: Silvermoon, EU
Re: "New EH"  incorporating different damage types into EH
Theck,
Awesome work. I look forward to going through this line by line.
If cataclysm wasn't now on the horizon with its' promised simplifications, i would advocate the creation of a Theck style Ratingbuster addon, complete with a layman's term plugin :p
Edit: The 3D color graphs are awesome btw, just watch out as you may start giving people seizures.
Awesome work. I look forward to going through this line by line.
If cataclysm wasn't now on the horizon with its' promised simplifications, i would advocate the creation of a Theck style Ratingbuster addon, complete with a layman's term plugin :p
Edit: The 3D color graphs are awesome btw, just watch out as you may start giving people seizures.
 Horanur
 Posts: 65
 Joined: Tue Jun 09, 2009 9:38 am
Re: "New EH"  incorporating different damage types into EH
<edit> Looks like you were editing your post while I was replying to it.
I'm going to leave my response here just so I have something to point to in case anyone else makes the same mistake later. Which is likely  I made the same mistake in my first few tries at this calculation, and only realized something was up when I started plotting the results in Matlab and getting weird answers.
Except that's not the formula. If you write it as:
Then X, Y, Z, and W are by definition postmitigation. This is very clear from the derivation  look back at the section going from equations (8) to (12) in the original post.
If you're going to use premitigation values, then the form has to be the same as eq. (12), since that's the formula for effective health derived from first principles. The only way to get it in the nice, intuitive form of equation (19) is to use postmitigation values.
The first plot in my previous post demonstrates the discrepancy as well. It wouldn't matter whether I used the analytical form of your expression or the "computational" equivalent  it would still give the wrong result.
This is the fundamental error highlighted. dX/dPw through dW/dPw are not zero if you define EH the way you just have. This is also why it doesn't matter whether you computationally determine the dPi/dPw's or whether you do it analytically, because you've just thrown away half of the relevant information in the equation.
I'm going to leave my response here just so I have something to point to in case anyone else makes the same mistake later. Which is likely  I made the same mistake in my first few tries at this calculation, and only realized something was up when I started plotting the results in Matlab and getting weird answers.
Xenix wrote: My own XYZW were premitigation percentages for exactly that reason  so they would not change with any change in the gear variables. Remember that EH is how much unmitigated damage of a specific type you can take before dying. That would necessitate the percentages in my own formula being premitigation ones.
Except that's not the formula. If you write it as:
 Code: Select all
EH = X*Px + Y*Py + Z*Pz + W*Pw
Then X, Y, Z, and W are by definition postmitigation. This is very clear from the derivation  look back at the section going from equations (8) to (12) in the original post.
If you're going to use premitigation values, then the form has to be the same as eq. (12), since that's the formula for effective health derived from first principles. The only way to get it in the nice, intuitive form of equation (19) is to use postmitigation values.
The first plot in my previous post demonstrates the discrepancy as well. It wouldn't matter whether I used the analytical form of your expression or the "computational" equivalent  it would still give the wrong result.
Xenix wrote:However, if you were to start with the NEH equation and differentiate it, this is what you would do (to get my equations):
 Code: Select all
Your starting equation, where Px, Py, Pz and Pw are your 100% damagespecific EH's, and X,Y,Z and W are your :
EH = X*Px + Y*Py + Z*Pz + W*Pw
Take the partial derivative with to Pw for:
dEH dPx dPy dPz dPw dX dY dZ dW
 = X* + Y* + Z* + W* + Px* + Py* + Pz* + Pw*
dPw dPw dPw dPw dPw dPw dPw dPw dPw
Now, in the plane I plotted, EH = constant. Also, dPw/dPw = 1, and the last four terms are all zero since I'm using premitigation numbers for them (If you're taking 50,000 raw Pmit damage and 50,000 raw Mmit damage, changing your gear still means you're taking that much raw damage and still need 100,000 NEH to survive, and you'll always be on the 50%X,0%Y,50%Z point in mitigation% space).
This is the fundamental error highlighted. dX/dPw through dW/dPw are not zero if you define EH the way you just have. This is also why it doesn't matter whether you computationally determine the dPi/dPw's or whether you do it analytically, because you've just thrown away half of the relevant information in the equation.
"Theck, Bringer of Numbers and Pounding Headaches," courtesy of GrehnSkipjack.
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty
Simcraft 6.x, Call to Arms 6.0, Talent Spec & Glyph Guide 6.x, Blog: Sacred Duty

theckhd  Moderator
 Posts: 8003
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: "New EH"  incorporating different damage types into EH
Yeah, definitely a good idea to keep that post for reference.
Also, I could redo my original visualization by just changing the neh.m file to the correct formula which would give me the same plots for the corrected axes, but with the derivations you did, it's much simpler to avoid the bruteforce method and instead just calculate the dNEH=0 surface directly for a certain gear change and compare that to the full range of possible fights.
Once again, this will not be worth doing if you only care about a single fight  in that case, you should just calculate the dNEH for that fight for each piece of gear available and sort them in order. It would only be worth doing if you care about a single piece of gear and want to see over what ranges of fights it's an upgrade.
Also, if you want to try and avoid confusion, the following image shows the generalized formulas 12 and 19 in a format that's a bit easier to read for people who are used to math notation:
In these formulas, H is health, Phi_i is the percent unmitigated damage (of the total unmitigated damage) of the i'th type, Phihat_i is the percent mitigated damage (of the total mitigated damage) of the i'th type, and M_j is the percent reduction in damage of that type from your j'th source. For damage types we're used to these products are wellknown, but I left it as a product over j types of damage reduction since that's the true form of the equation.
Furthermore, in these forms you can manually differentiate with respect to any variable U and find a closedform solution that's only slightly messy (what Theckd ended up using Mathematica for when considering the four damage types we currently encounter), but that might be taking it a bit far. I'll see how bored I get studying for finals and might end up doing it to see if the result is enlightening.

<Edit>: I really was bored tonight, enough to complete the derivation of the full differential form of the NEH equation using premitigation variables (e.g. the first one.) So as not to scare everyone away from this thread (the final equation should do that alone), I won't post all 10 steps of the derivation, but if you want to check my work, I made a PDF of the derivation.
The final equation is the following, when you differentiate with respect to ANY variable U:
where Qbar is what I am calling your "Weighted Damage Intake %", defined as the denominator of the original NEH equation (or simply your Health divided by your NEH):
Now, before your eyes glaze over from trying to comprehend that cold, let's see what it says. The change in NEH with any other variable can be broken down into three terms:
As a quick example of an easy use of this, let's see how NEH changes with a change in stamina. Terms 2 and 3 would be zero in this case because stamina has no effect on the damage percentages or mitigation percentages, which means the two scary terms disappear, leaving you with:
And even better, dH/dS is a simple constant for any class (12.54 for paladins), which means that your change in NEH per point of stamina is equal to 12.54 divided by Qbar.
To check my work against Theckd's equations, I then took dNEH/dA. For this case, the first two terms disappear as those values do not change with armor, and all of the nonpmit damage parts of the final summation term disappear as well. In the end, you are left with:
Where Phi_p is the % of raw damage affected by armor, Mp is your physical damage mitigation, Ma is your armor mitigation and K is the armor constant.
Now, you can invert one and multiply the two to get the following:
which gives for dA/dS:
Note that the first equation is only in terms of premitigation variables, but as Theckd noticed in his derivation of the same equation, the second fraction is the same as 1/(Phihat_p), or 1 over the postmitigation % of damage that is physical. Also, dH/dS is how much health you get from a point of stamina, or 12.54 for paladins, and you set dA/dS equal to zero to find the equivalence points. Furthermore, just to make it clear (since I didn't realize this initially from Theckd's previous posts), dS/dA is linear only with the % of physical damage postmitigation. If you're using raw damage percentages, you'll have to use the first version of the equation.
Now, you may ask yourself  what is the big deal since I just rederived an equation that we already knew (aside from proving the differential form is correct)? In short, we can use the same method to calculate how ANY two variables relate to each other.
Want to know dPhi_p/dPhi_m for some strange reason? Just take (dNEH/dPhi_m) / (dNEH/dPhi_p). This equation lets you analytically determine the differential ratio between any two variables related to NEH, or even just the change in NEH versus one variable. It's probably not something more than a few people will use, but we now actually have it posted if someone were to want to derive a new relationship analytically instead of numerically, and it is valid for any number of damage types.
Also, I could redo my original visualization by just changing the neh.m file to the correct formula which would give me the same plots for the corrected axes, but with the derivations you did, it's much simpler to avoid the bruteforce method and instead just calculate the dNEH=0 surface directly for a certain gear change and compare that to the full range of possible fights.
Once again, this will not be worth doing if you only care about a single fight  in that case, you should just calculate the dNEH for that fight for each piece of gear available and sort them in order. It would only be worth doing if you care about a single piece of gear and want to see over what ranges of fights it's an upgrade.
Also, if you want to try and avoid confusion, the following image shows the generalized formulas 12 and 19 in a format that's a bit easier to read for people who are used to math notation:
In these formulas, H is health, Phi_i is the percent unmitigated damage (of the total unmitigated damage) of the i'th type, Phihat_i is the percent mitigated damage (of the total mitigated damage) of the i'th type, and M_j is the percent reduction in damage of that type from your j'th source. For damage types we're used to these products are wellknown, but I left it as a product over j types of damage reduction since that's the true form of the equation.
Furthermore, in these forms you can manually differentiate with respect to any variable U and find a closedform solution that's only slightly messy (what Theckd ended up using Mathematica for when considering the four damage types we currently encounter), but that might be taking it a bit far. I'll see how bored I get studying for finals and might end up doing it to see if the result is enlightening.

<Edit>: I really was bored tonight, enough to complete the derivation of the full differential form of the NEH equation using premitigation variables (e.g. the first one.) So as not to scare everyone away from this thread (the final equation should do that alone), I won't post all 10 steps of the derivation, but if you want to check my work, I made a PDF of the derivation.
The final equation is the following, when you differentiate with respect to ANY variable U:
where Qbar is what I am calling your "Weighted Damage Intake %", defined as the denominator of the original NEH equation (or simply your Health divided by your NEH):
Now, before your eyes glaze over from trying to comprehend that cold, let's see what it says. The change in NEH with any other variable can be broken down into three terms:
 Term 1: How your health changes with that variable.
 Term 2: How the damage percentages change with that variable.
 Term 3: How the mitigation percentages change with that variable.
As a quick example of an easy use of this, let's see how NEH changes with a change in stamina. Terms 2 and 3 would be zero in this case because stamina has no effect on the damage percentages or mitigation percentages, which means the two scary terms disappear, leaving you with:
And even better, dH/dS is a simple constant for any class (12.54 for paladins), which means that your change in NEH per point of stamina is equal to 12.54 divided by Qbar.
To check my work against Theckd's equations, I then took dNEH/dA. For this case, the first two terms disappear as those values do not change with armor, and all of the nonpmit damage parts of the final summation term disappear as well. In the end, you are left with:
Where Phi_p is the % of raw damage affected by armor, Mp is your physical damage mitigation, Ma is your armor mitigation and K is the armor constant.
Now, you can invert one and multiply the two to get the following:
 Code: Select all
dA dA dNEH
 = *
dS dNEH dS
which gives for dA/dS:
Note that the first equation is only in terms of premitigation variables, but as Theckd noticed in his derivation of the same equation, the second fraction is the same as 1/(Phihat_p), or 1 over the postmitigation % of damage that is physical. Also, dH/dS is how much health you get from a point of stamina, or 12.54 for paladins, and you set dA/dS equal to zero to find the equivalence points. Furthermore, just to make it clear (since I didn't realize this initially from Theckd's previous posts), dS/dA is linear only with the % of physical damage postmitigation. If you're using raw damage percentages, you'll have to use the first version of the equation.
Now, you may ask yourself  what is the big deal since I just rederived an equation that we already knew (aside from proving the differential form is correct)? In short, we can use the same method to calculate how ANY two variables relate to each other.
Want to know dPhi_p/dPhi_m for some strange reason? Just take (dNEH/dPhi_m) / (dNEH/dPhi_p). This equation lets you analytically determine the differential ratio between any two variables related to NEH, or even just the change in NEH versus one variable. It's probably not something more than a few people will use, but we now actually have it posted if someone were to want to derive a new relationship analytically instead of numerically, and it is valid for any number of damage types.
Last edited by Xenix on Thu Dec 03, 2009 7:22 am, edited 1 time in total.
Kimurellia  Holy/Protection Paladin  Scions of Destiny  EredarUS

Xenix  Posts: 244
 Joined: Thu Jun 25, 2009 4:56 am
Re: "New EH"  incorporating different damage types into EH
You two are both totally batshit insane. And I love you for it.
 Meloree
 Maintankadonor
 Posts: 1420
 Joined: Wed Mar 12, 2008 10:15 am
Return to Advanced Theorycraft and Calculations
Who is online
Users browsing this forum: Alexa [Bot], Donatist and 1 guest