Theck's MATLAB TPS analysis  WotLK/3.x
Moderators: Fridmarr, Worldie, Aergis, theckhd
Re: Theck's MATLAB TPS analysis
The normal TAiaJ requires 8 motes before it does damage. However, the 8th mote doesn't get logged in the combat log. Instead, an aura fade is logged. An example:
That means that the number of mote procs in the "buffs gained" tab of WoL doesn't include all the procs. Thus, the observed rate (OR) should be calculated with the following formula.
Also, I think it would be better to compare the observed value with a practical estimated value and then compare those two with the theoretical estimated value.
Note: The following were found to be inaccurate.
The theoretical estimated rate (TER) is calculated by theck's formula (reposting for reference):
The practical estimated rate (PER) is something like the following (it uses data taken directly from WoL parse):
Let's take the Festergut fight for example:
237 seconds
274 motes
39 MA (38 success)
138 melees (132 successful)
34 HotR (32 success)
35 ShoR (35 success)
24 Judgements (24 success)
7 unsuccessful HV applications
OR = (274+39)/237 = 1.32
PER = 0.5*[4*24+3*32+3*35+2*(132+38)7]/237 = 1.33
TER = 0.5*(4*24*p1+2*(34+35)*p2+(34+35)*p2^2)/237 + 0.5*p2*(2+p2)*(138+39)/237 = 1.61
I was expecting PER to be closer to OR than TER but not that close. I was surprised. I guess that TER has a 21% difference from PER, cause it assumes a static fight, a perfect rotation and no latency.
The Saurfang fight:
196 seconds
255 motes
36 MA (35 success)
122 melees (119 successful)
28 HotR (26 success)
27 ShoR (26 success)
19 Judgements (19 success)
12 unsuccessful HV applications
OR = (255+36)/196 = 1.4847
PER = 0.5*[4*19+3*26+3*26+2*(119+35)12]/196 = 1.347
TER = 0.5*(4*19*p1+2*(28+27)*p2+(28+27)*p2^2)/196 + 0.5*p2*(2+p2)*(122+36)/196 = 1.67
I think I got lucky in this fight with the procs. I had 55% proc chance there. TER is 24% larger than PER this time.
[EDIT]
I'm not satisfied with the above. Let's give it one more try.
Fester10:
204 seconds
246 motes
35 MA (34 success)
101 melees (99 successful)
31 HotR (30 success)
32 ShoR (29 success)
21 Judgements (21 success)
5 unsuccessful HV applications
OR = (246+35)/204 = 1.38
PER = 0.5*[4*21+3*30+3*29+2*(99+34)5]/204 = 1.28
TER = 0.5*(4*21*p1+2*(31+32)*p2+(31+32)*p2^2)/204 + 0.5*p2*(2+p2)*(101+35)/204 = 1.53
Again the same thing. 54% proc chance. TER 20% larger than PER.
Note: The above don't imply that theck's (TER) formula is wrong. On the contrary. It just lives in its own perfect world looking down like a god at its lesser subordinates
 Code: Select all
[19:25:09.854] Marblehead gains Mote of Anger (4) from Marblehead
[19:25:09.854] Marblehead gains Mote of Anger (5) from Marblehead
[19:25:09.988] Marblehead gains Mote of Anger (6) from Marblehead
[19:25:13.066] Marblehead gains Mote of Anger (7) from Marblehead
[19:25:13.163] Marblehead's Mote of Anger fades
[19:25:13.182] Marblehead gains Mote of Anger from Marblehead
[19:25:13.523] Marblehead Manifest Anger Festergut *1539*
[19:25:14.691] Marblehead gains Mote of Anger (2) from Marblehead
[19:25:15.316] Marblehead gains Mote of Anger (3) from Marblehead
[19:25:16.159] Marblehead gains Mote of Anger (4) from Marblehead
That means that the number of mote procs in the "buffs gained" tab of WoL doesn't include all the procs. Thus, the observed rate (OR) should be calculated with the following formula.
 Code: Select all
OR = (mote of anger procs in buffs gained tab + manifest anger total attacks) / time
Also, I think it would be better to compare the observed value with a practical estimated value and then compare those two with the theoretical estimated value.
Note: The following were found to be inaccurate.
The theoretical estimated rate (TER) is calculated by theck's formula (reposting for reference):
 Code: Select all
TER = (50% proc)*[(4 chances per Judgement)*(# Judgements)*(prob Judgement succeeds) +
(2 chances per HotR/ShoR)*(# HotR/ShoR) *(prob HotR/ShoR succeeds) +
(1 chance per HV app from H/S)*(# HotR/ShoR) * (prob HotR/ShoR and HV app both succeed)]/time
+ (50% proc)*[(chance of melee success)(2 procs per successful melee + chance at HV app success)]*(# melees)/time
The practical estimated rate (PER) is something like the following (it uses data taken directly from WoL parse):
 Code: Select all
PER = (50% proc)*[(4 chances per Judgement)*(# successful Judgements) +
(3 chances per HotR)*(# successful HotR) +
(3 chances per ShoR)*(# successful ShoR) +
(2 chances per melee)*(# successful melees) 
(# unsuccessful HV)]/time
Let's take the Festergut fight for example:
237 seconds
274 motes
39 MA (38 success)
138 melees (132 successful)
34 HotR (32 success)
35 ShoR (35 success)
24 Judgements (24 success)
7 unsuccessful HV applications
OR = (274+39)/237 = 1.32
PER = 0.5*[4*24+3*32+3*35+2*(132+38)7]/237 = 1.33
TER = 0.5*(4*24*p1+2*(34+35)*p2+(34+35)*p2^2)/237 + 0.5*p2*(2+p2)*(138+39)/237 = 1.61
I was expecting PER to be closer to OR than TER but not that close. I was surprised. I guess that TER has a 21% difference from PER, cause it assumes a static fight, a perfect rotation and no latency.
The Saurfang fight:
196 seconds
255 motes
36 MA (35 success)
122 melees (119 successful)
28 HotR (26 success)
27 ShoR (26 success)
19 Judgements (19 success)
12 unsuccessful HV applications
OR = (255+36)/196 = 1.4847
PER = 0.5*[4*19+3*26+3*26+2*(119+35)12]/196 = 1.347
TER = 0.5*(4*19*p1+2*(28+27)*p2+(28+27)*p2^2)/196 + 0.5*p2*(2+p2)*(122+36)/196 = 1.67
I think I got lucky in this fight with the procs. I had 55% proc chance there. TER is 24% larger than PER this time.
[EDIT]
I'm not satisfied with the above. Let's give it one more try.
Fester10:
204 seconds
246 motes
35 MA (34 success)
101 melees (99 successful)
31 HotR (30 success)
32 ShoR (29 success)
21 Judgements (21 success)
5 unsuccessful HV applications
OR = (246+35)/204 = 1.38
PER = 0.5*[4*21+3*30+3*29+2*(99+34)5]/204 = 1.28
TER = 0.5*(4*21*p1+2*(31+32)*p2+(31+32)*p2^2)/204 + 0.5*p2*(2+p2)*(101+35)/204 = 1.53
Again the same thing. 54% proc chance. TER 20% larger than PER.
Note: The above don't imply that theck's (TER) formula is wrong. On the contrary. It just lives in its own perfect world looking down like a god at its lesser subordinates
Last edited by Marblehead on Thu May 06, 2010 8:12 am, edited 2 times in total.

Marblehead  Posts: 202
 Joined: Sun Aug 02, 2009 9:28 pm
 Location: Bloodhoof (EU)
Re: Theck's MATLAB TPS analysis
That explains why the observed rate was so low. Good catch.
The PER and OR should be pretty close, since they both use data directly pulled from the WoL parse  the only assumption in the PER is that the proc rate is 50%, which we're pretty sure is correct.
The TER is simply too high, and seems to be consistently so. If it were one parse, we could chalk it up to RNG, but the consistency leads me to believe that there's probably something wrong with the formula. It should be pretty easy to troubleshoot if I find some time, as TER and PER have very similar forms. It's just a matter of tweaking probabilities to see what reasonable changes lead to good agreement between PER and TER.
This could mean that I just made a mistake in the formula, or that one of these effects doesn't actually work like we think it does. The former is probably more likely, but it's worth investigating just in case the latter is true.
The PER and OR should be pretty close, since they both use data directly pulled from the WoL parse  the only assumption in the PER is that the proc rate is 50%, which we're pretty sure is correct.
The TER is simply too high, and seems to be consistently so. If it were one parse, we could chalk it up to RNG, but the consistency leads me to believe that there's probably something wrong with the formula. It should be pretty easy to troubleshoot if I find some time, as TER and PER have very similar forms. It's just a matter of tweaking probabilities to see what reasonable changes lead to good agreement between PER and TER.
This could mean that I just made a mistake in the formula, or that one of these effects doesn't actually work like we think it does. The former is probably more likely, but it's worth investigating just in case the latter is true.
"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: 8001
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: Theck's MATLAB TPS analysis
I don't have a whole lot of time to play with this any more today, but here's something that may help if you're going to look into it at all:
http://sites.google.com/site/theckhd/mf ... atch_taj.m
It's an mfile that has the data from your 3 parses coded into it. It calculates OR, PER, and TER as well as a breakdown of the contribution to each from different sources (see the mfile).
Here are the values it gives me for your three parses:
What I've been trying to do is figure out what combination of factors would account for the differences we're seeing in TER and PER. For example, for Saurfang25, TERPER=0.3697. If you look at the breakdown of TER:
It's clear, for example, that since Judgement only accounts for 0.1939, that can't be the cause (or the only cause, it could be part of it I guess). Some other obvious breakdowns don't work either  HV applications (set phv=0) and SoV procs (sum the +SoV rows and divide by 2) individually cause more of a swing than the difference. It's unlikely that some HV procs and/or some SoV procs work while others don't, so we can rule out either of those being the cause for discrepancy, I think.
http://sites.google.com/site/theckhd/mf ... atch_taj.m
It's an mfile that has the data from your 3 parses coded into it. It calculates OR, PER, and TER as well as a breakdown of the contribution to each from different sources (see the mfile).
Here are the values it gives me for your three parses:
 Code: Select all
OR PER TER
Fester25: 1.3207 1.3291 1.6570
Saur25: 1.4847 1.3469 1.7167
Fester10: 1.3775 1.2794 1.5728
What I've been trying to do is figure out what combination of factors would account for the differences we're seeing in TER and PER. For example, for Saurfang25, TERPER=0.3697. If you look at the breakdown of TER:
 Code: Select all
TERb = 0.5/T*[4*j*p1; %Judgements (J+ JotJ, JoW, SoV)
2*h*p2; %HotR (+SoV)
2*s*p2; %ShoR (+SoV)
h*phv; %HV from HotR
s*phv; %HV from ShoR
2*me*p2; %melee (+SoV)
me*phv; %HV from melee
2*ma*p2; %ma procs (+SoV)
ma*phv]; %HV from MA
TERb =
0.1939
0.1357
0.1309
0.0645
0.0622
0.5913
0.2809
0.1745
0.0829
It's clear, for example, that since Judgement only accounts for 0.1939, that can't be the cause (or the only cause, it could be part of it I guess). Some other obvious breakdowns don't work either  HV applications (set phv=0) and SoV procs (sum the +SoV rows and divide by 2) individually cause more of a swing than the difference. It's unlikely that some HV procs and/or some SoV procs work while others don't, so we can rule out either of those being the cause for discrepancy, I think.
"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: 8001
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: Theck's MATLAB TPS analysis
After some more testing on the dummies and reviewing the formulas, I came to the conclusion that both the TER and PER formulas are incorrect due to faulty assumptions.
I'll try to analyze the TAiaJ procs, while building the formulas at the same time from scratch.

1. Judgements
When a Judgement is cast the following happen:
i. it does damage
ii. it applies the appropriate debuff depending on which judgement was cast
iii. it applies HotC
iv. it applies JotJ
v. the JotJ debuff procs a SoV attack
Note: Judgements don't refresh or apply HV stacks
From the above, actions (i), (ii), (iv) and (v) proc motes. Also, none of those can by parry or dodge. However, a judgement can miss and in that case nothing of the above will happen.
All these have the following impact on PER:
And TER:
2. Hammer of the Righteous
When a HotR is cast the following happen:
i. it does damage
ii. it procs a SoV attack
iii. it refreshes or applies a HV stack
From the above, actions (i), (ii) and (iii) proc motes. A HotR can miss or be dodged or parried and in that case nothing of the above will happen. Furthermore, the HV refresh can miss or be dodged or parried.
PER:
TER:
3. Shield of Righteousness
When a ShoR is cast the following happen:
i. it does damage
ii. it procs a SoV attack
Note: ShoR doesn't refresh or apply HV stacks
From the above, actions (i) and (ii) proc motes. A ShoR can miss or be dodged or parried and in that case nothing of the above will happen.
PER:
TER:
4. Melee attacks
When attacking with a melee weapon the following happen:
i. it does damage
ii. it procs a SoV attack
iii. it refreshes or applies a HV stack
From the above, actions (i), (ii) and (iii) proc motes. A melee attack can miss or be dodged or parried and in that case nothing of the above will happen. Furthermore, the HV refresh can miss or be dodged or parried.
PER:
TER:
5. Manifest Anger
When a MA procs the following happen:
i. it does damage
ii. it procs a SoV attack
Note: MA doesn't refresh or apply HV stacks
From the above, only action (ii) procs motes. A MA can miss or be dodged or parried and in that case nothing of the above will happen.
PER:
TER:

(prob Judgement succeeds) = 1  miss
(prob HotR/ShoR/melee/MA succeeds) = 1  miss  dodge  parry
(prob HotR/melee and HV app both succeed) = (1  miss  dodge  parry)^2

Adding all of the above and multiplying with 50% proc chance while dividing with the duration of the fight in seconds.

Recalculating the previous scenarios:
The numbers look better now, but the fester25 fight bothers me. Maybe yesterday's raid will help us a bit.
Hmmm, looks good, but I'm under the impression that something is still missing.
I'll try to analyze the TAiaJ procs, while building the formulas at the same time from scratch.

1. Judgements
When a Judgement is cast the following happen:
i. it does damage
ii. it applies the appropriate debuff depending on which judgement was cast
iii. it applies HotC
iv. it applies JotJ
v. the JotJ debuff procs a SoV attack
Note: Judgements don't refresh or apply HV stacks
From the above, actions (i), (ii), (iv) and (v) proc motes. Also, none of those can by parry or dodge. However, a judgement can miss and in that case nothing of the above will happen.
All these have the following impact on PER:
 Code: Select all
(4 chances per Judgement)*(# successfull Judgements)
And TER:
 Code: Select all
(4 chances per Judgement)*(# Judgements)*(prob Judgement succeeds)
2. Hammer of the Righteous
When a HotR is cast the following happen:
i. it does damage
ii. it procs a SoV attack
iii. it refreshes or applies a HV stack
From the above, actions (i), (ii) and (iii) proc motes. A HotR can miss or be dodged or parried and in that case nothing of the above will happen. Furthermore, the HV refresh can miss or be dodged or parried.
PER:
 Code: Select all
(3 chances per HotR)*(# successfull HotR)  (# unsuccessful HV from HotR)
TER:
 Code: Select all
(2 chances per HotR)*(# HotR)*(prob HotR succeeds) + (1 chance per HV app from HotR)*(# HotR)*(prob HotR and HV app both succeed)
3. Shield of Righteousness
When a ShoR is cast the following happen:
i. it does damage
ii. it procs a SoV attack
Note: ShoR doesn't refresh or apply HV stacks
From the above, actions (i) and (ii) proc motes. A ShoR can miss or be dodged or parried and in that case nothing of the above will happen.
PER:
 Code: Select all
(2 chances per ShoR)*(# successfull ShoR)
TER:
 Code: Select all
(2 chances per ShoR)*(# ShoR)*(prob ShoR succeeds)
4. Melee attacks
When attacking with a melee weapon the following happen:
i. it does damage
ii. it procs a SoV attack
iii. it refreshes or applies a HV stack
From the above, actions (i), (ii) and (iii) proc motes. A melee attack can miss or be dodged or parried and in that case nothing of the above will happen. Furthermore, the HV refresh can miss or be dodged or parried.
PER:
 Code: Select all
(3 chances per melee)*(# successfull melee)  (# unsuccessful HV from melee)
TER:
 Code: Select all
(2 chances per melee)*(# melee)*(prob melee succeeds) + (1 chance per HV app from melee)*(# melee)*(prob melee and HV app both succeed)
5. Manifest Anger
When a MA procs the following happen:
i. it does damage
ii. it procs a SoV attack
Note: MA doesn't refresh or apply HV stacks
From the above, only action (ii) procs motes. A MA can miss or be dodged or parried and in that case nothing of the above will happen.
PER:
 Code: Select all
(1 chance per MA)*(# successfull MA)
TER:
 Code: Select all
(1 chance per MA)*(# MA)*(prob MA succeeds)

(prob Judgement succeeds) = 1  miss
(prob HotR/ShoR/melee/MA succeeds) = 1  miss  dodge  parry
(prob HotR/melee and HV app both succeed) = (1  miss  dodge  parry)^2

Adding all of the above and multiplying with 50% proc chance while dividing with the duration of the fight in seconds.
 Code: Select all
PER = (50% proc)*[(4 chances per Judgement)*(# successfull Judgements) +
(3 chances per HotR)*(# successfull HotR) +
(2 chances per ShoR)*(# successfull ShoR) +
(3 chances per melee)*(# successfull melee) +
(1 chance per MA)*(# successfull MA) 
(# total unsuccessful HV)]/time
 Code: Select all
TER = (50% proc)*[(4 chances per Judgement)*(# Judgements)*(prob Judgement succeeds) +
(2 chances per HotR)*(# HotR)*(prob HotR succeeds) + (1 chance per HV app from HotR)*(# HotR)*(prob HotR and HV app both succeed) +
(2 chances per ShoR)*(# ShoR)*(prob ShoR succeeds) +
(2 chances per melee)*(# melee)*(prob melee succeeds) + (1 chance per HV app from melee)*(# melee)*(prob melee and HV app both succeed) +
(1 chance per MA)*(# MA)*(prob MA succeeds)]/time

Recalculating the previous scenarios:
 Code: Select all
OR PER TER
Fester25: 1.3207 1.4536 1.4011
Saur25: 1.4847 1.4949 1.4458
Fester10: 1.3775 1.3676 1.3094
The numbers look better now, but the fester25 fight bothers me. Maybe yesterday's raid will help us a bit.
 Code: Select all
OR PER TER
Saur25b: 1.5219 1.5244 1.4686
Fester25b: 1.3727 1.4636 1.4374
Hmmm, looks good, but I'm under the impression that something is still missing.

Marblehead  Posts: 202
 Joined: Sun Aug 02, 2009 9:28 pm
 Location: Bloodhoof (EU)
Re: Theck's MATLAB TPS analysis
Marblehead wrote:Note: ShoR doesn't refresh or apply HV stacks
Note: MA doesn't refresh or apply HV stacks
From the above, only action (ii) procs motes
These changes, plus the error in the PER formula (3 chances per melee rather than 2) account for the error. Good catch.
Just to doublecheck your math, here's my new code and the values I get:
 Code: Select all
%Fester10
%length of parse (sec)
T=204;
%mote procs
moa=246;
%manifest anger procs; ma successes
ma=35;
mas=34;
%melees; melee successes
me=101;mes=99;
%hotr; successful
h=31;hs=30;
%shor; successful
s=32;ss=29;
%Judgements; successful
j=21;js=21;
%holy vengeance application fails
hvf=5;
%Fester25
T=237;
moa=274;
ma=39;mas=38;
me=138;mes=132;
h=34;hs=32;
s=35;ss=35;
j=24;js=24;
hvf=7;
%Saur25
T=196;
moa=255;
ma=36;mas=35;
me=122;mes=119;
h=28;hs=26;
s=27;ss=26;
j=19;js=19;
hvf=12;
%Saur25b
T=3*60+25;
moa=273;
ma=39;mas=38;
me=49+27+6+39+6;mes=me6;
h=19+8+3;hs=h;
s=22+6+2;ss=s2;
j=16+5;js=j;
hvf=6;
%Fester25b
T=3*60+40;
moa=264;
ma=27+7+1+3;mas=ma3;
me=56+38+2+27+9;mesme9;
h=24+8+1;hs=h1;
s=22+9+1+1;ss=s1;
j=18+4;js=j;
hvf=8;
%attack probabilities (1miss) and (1missparrydodge)
p1=1; %hitcapped
p2=p10.075+0.025; %27 expertise
phv=p2^2; %HV proc chance (p2^2 for all cases)
OR = (moa + ma)/T;
PERb = 0.5/T*[4*js; %successful judgements
3*hs; %successful HotR
2*ss; %successful ShoR
3*mes; %successful melees
1*mas; %successful ma procs
hvf]; %holy vengeance fails
PER=sum(PERb);
TERb = 0.5/T*[4*j*p1; %Judgements (J+ JotJ, JoW, SoV)
2*h*p2; %HotR (+SoV)
2*s*p2; %ShoR (+SoV)
h*phv; %HV from HotR
s*phv*0; %HV from ShoR
2*me*p2; %melee (+SoV)
me*phv; %HV from melee
1*ma*p2; %ma procs (+SoV)
0*ma*phv]; %HV from MA
TER=sum(TERb);
rates=[OR PER TER abs([PER TER]OR)./OR.*100]
 Code: Select all
OR PER TER dPER(%) dTER(%)
Fester25: 1.3207 1.4536 1.4379 10.0639 8.8786
Saur25: 1.4847 1.4949 1.4844 0.6873 0.0215
Fester10: 1.3775 1.3676 1.3431 0.7117 2.4947
Saur25b: 1.5220 1.5244 1.5074 0.1603 0.9547
Fester25b: 1.3727 1.4500 1.4755 5.6291 7.4855
dPER is (PEROR)/OR in %, and similarly for dTER. The Saur25 and Fester10 prases are close enough to be statistically insignificant. Both Fester25 parses seem a bit off, but even a 10% variation isn't all that surprising in a <4minute sample. It's also possible there's something particular to that fight that we're overlooking (though I can't think of anything off the top of my head).
"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: 8001
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: Theck's MATLAB TPS analysis
Being hit by the goo maybe? But then the OR and PER should be close, and the TER be different, right? Unless the goo does something to the motes specifically, maybe it gives them a fail chance?
Just guessing here, this is mostly chinese to me.
Just guessing here, this is mostly chinese to me.

Awyndel  Posts: 672
 Joined: Sat Feb 14, 2009 8:49 am
 Location: The Netherlands
Re: Theck's MATLAB TPS analysis
maybe something already mentioned, but on this subject, it's manifest of anger first proc that will determine the target for it's dmg. If the target is too far or dead, you don't get any proc. this on deathbringer, can alter the procs since you may get 1 on the adds, depending if you're made 1 hammer at that time.
As retri, I see that 1 or 2 motes of anger don't make a seal dmg at the start, because I still don't have the 5 stacks at that point, that can also account for 1 or 2 less seal on vengeance proc, but 2 seems really high as protection through.
As retri, I see that 1 or 2 motes of anger don't make a seal dmg at the start, because I still don't have the 5 stacks at that point, that can also account for 1 or 2 less seal on vengeance proc, but 2 seems really high as protection through.
While tanking new content, one rule is important  it's not about taking less damage; it's about being able to take more.
Ragingsoul, Palatank, Tsunadee, Resto Druid, Bisoul, Mutilate Rogue
Ragingsoul, Palatank, Tsunadee, Resto Druid, Bisoul, Mutilate Rogue

Ragingsoul  Posts: 346
 Joined: Sat Jul 26, 2008 10:01 pm
Re: Theck's MATLAB TPS analysis
Quick Calculation: How does defense compare to armor in ICC? We know that armor is very strong in ICC because it mitigates damage, giving us EH while at the same time interacting favorably with healing. But block rating below the cap has the same essential qualities  rather than mitigating 100 more damage on every attack, you might block for 2k on every 20th attack. Since defense gives us avoidance and block rating, it might be premature to write it off as many have with dodge and parry.
To answer this, we need a slightly more complicated model than I've used in the dodge vs. agility article. In that analysis, we've ignored block entirely. In this one, we have to include it explicitly.
Simple model of blocking:
There are three possible outcomes to an incoming attack event. You can take the attack (normal hit), Block the attack (taking some damage), or Avoid the attack entirely (taking no damage). We will use B and A to represent our block and avoidance chances respectively, and BV to represent the amount of damage we block for. M will represent our mitigation due to armor.
Thus, our incoming average damage taken from a swing of size D is
D_avg = 0*A + (D(1M)BV)*B + D(1M)(1AB)
Check: We have an A chance to take 0 damage, a B chance to take D(1M)BV, and a 1AB chance to take D(1M).
Note that if we let B go to zero, we get the same formula as the agility article: D(1M)(1A), where D was the incoming DTPS.
The main difference here is that we cannot rearrange this to make it independent of D like we could with agility. Because block value isn't multiplicative, we have to approach it slightly differently. Let BV/D(1M) = BF be the percentage of an unblocked hit that we prevent when we block. In other words, BF is the effective mitigation factor of a block given D and M. We can rearrange the equation as such then:
D_avg = D(1M)*[(1A)  BF*B]
and if we consider the net DTPS reduction we get by changing our mitigation, avoidance, and block values to M', A', BV', and B', we get:
To do some quick calculations, I plugged in my current gear to get my raidbuffed stats from the matlab code. They are:
Gear_Defense: 918
Gear_Parry: 302
Gear_Dodge: 521
Raidbuffed AGI: 387
Total avoidance: 59.1519%, 39.1519% after Chill
Block chance: 44.4275% with Holy Shield up, ignoring Redoubt
Block value: 1803
Unbuffed Armor: 36823 (from Armory)
Buffed Armor: 36823 + 1807 (devo) + 2*(38790) (armor from agi buffs) = 39224
Mitigation: 70.2197%
Now let's see the effect of ten defense rating.
New Avoidance (A') = 39.2887% after Chill
New Block chance (B'): 44.5088%
For the Block Factor, let's assume the boss hits for 20k and we block for around 2k to make it a clean 10%.
Since D and M are unaffected, the net damage intake reduction is just the ratio of the two terms in brackets:
[(1A')BF*B']/[(1A)BF*B] = 0.9974 = 99.7431%, or a reduction of 0.2569%
To get that same effect from armor, let's see what we'd need. Since the terms in brackets are independent of armor, all we're interested in is what value of M' it takes to get 0.9974 out of (1M')/(1M), which is:
M'=10.9974*(1M) = 0.702971
Mitigation from armor is M=Ar/(Ar+K), where Ar is your net armor and K is 16635 for a level 83 boss. Rearranging, we find
Ar = MK/(1M') = 39370 armor
which is a net increase of about 146 armor. So it takes about 146 armor to equal the DTPS reduction of 10 defense rating. Let's see how that stacks up to the available gem and enchant options:
Cloak Enchant: 16 defense vs 225 armor  roughly 14 armor for every point of defense rating, very close to the 15:1 break point
Shield Enchant: 81 block value brings you up to a BF of 10.41%, for a net reduction of 0.3190%. If we estimate the 20 defense rating shield enchant to be double the effect of 10 rating (not entirely correct due to DR, but close enough since I'm not at work and don't have the code on me), it's a reduction of 0.5139%.
Gems: The article shows agility clocking in at a 0.2284% reduction, slightly below a defense gem. The numbers may have changed slightly since then, I'll have to run the exact numbers when I get back to the office. That said, since Agi is a red gem and Def is a yellow gem, they don't directly compete for sockets.
I haven't had time to thoroughly vet this yet, so feel free to poke holes in the math. It's entirely possible I've made an oversight. I mostly want to get the groundwork laid so we can get a slightly more accurate idea of how much the block component of Defense is worth to us.
To answer this, we need a slightly more complicated model than I've used in the dodge vs. agility article. In that analysis, we've ignored block entirely. In this one, we have to include it explicitly.
Simple model of blocking:
There are three possible outcomes to an incoming attack event. You can take the attack (normal hit), Block the attack (taking some damage), or Avoid the attack entirely (taking no damage). We will use B and A to represent our block and avoidance chances respectively, and BV to represent the amount of damage we block for. M will represent our mitigation due to armor.
Thus, our incoming average damage taken from a swing of size D is
D_avg = 0*A + (D(1M)BV)*B + D(1M)(1AB)
Check: We have an A chance to take 0 damage, a B chance to take D(1M)BV, and a 1AB chance to take D(1M).
Note that if we let B go to zero, we get the same formula as the agility article: D(1M)(1A), where D was the incoming DTPS.
The main difference here is that we cannot rearrange this to make it independent of D like we could with agility. Because block value isn't multiplicative, we have to approach it slightly differently. Let BV/D(1M) = BF be the percentage of an unblocked hit that we prevent when we block. In other words, BF is the effective mitigation factor of a block given D and M. We can rearrange the equation as such then:
D_avg = D(1M)*[(1A)  BF*B]
and if we consider the net DTPS reduction we get by changing our mitigation, avoidance, and block values to M', A', BV', and B', we get:
 Code: Select all
D(1M')*[(1A')  BF'*B']
D% = 
D(1M)*[(1A)  BF*B]
To do some quick calculations, I plugged in my current gear to get my raidbuffed stats from the matlab code. They are:
Gear_Defense: 918
Gear_Parry: 302
Gear_Dodge: 521
Raidbuffed AGI: 387
Total avoidance: 59.1519%, 39.1519% after Chill
Block chance: 44.4275% with Holy Shield up, ignoring Redoubt
Block value: 1803
Unbuffed Armor: 36823 (from Armory)
Buffed Armor: 36823 + 1807 (devo) + 2*(38790) (armor from agi buffs) = 39224
Mitigation: 70.2197%
Now let's see the effect of ten defense rating.
New Avoidance (A') = 39.2887% after Chill
New Block chance (B'): 44.5088%
For the Block Factor, let's assume the boss hits for 20k and we block for around 2k to make it a clean 10%.
Since D and M are unaffected, the net damage intake reduction is just the ratio of the two terms in brackets:
[(1A')BF*B']/[(1A)BF*B] = 0.9974 = 99.7431%, or a reduction of 0.2569%
To get that same effect from armor, let's see what we'd need. Since the terms in brackets are independent of armor, all we're interested in is what value of M' it takes to get 0.9974 out of (1M')/(1M), which is:
M'=10.9974*(1M) = 0.702971
Mitigation from armor is M=Ar/(Ar+K), where Ar is your net armor and K is 16635 for a level 83 boss. Rearranging, we find
Ar = MK/(1M') = 39370 armor
which is a net increase of about 146 armor. So it takes about 146 armor to equal the DTPS reduction of 10 defense rating. Let's see how that stacks up to the available gem and enchant options:
Cloak Enchant: 16 defense vs 225 armor  roughly 14 armor for every point of defense rating, very close to the 15:1 break point
Shield Enchant: 81 block value brings you up to a BF of 10.41%, for a net reduction of 0.3190%. If we estimate the 20 defense rating shield enchant to be double the effect of 10 rating (not entirely correct due to DR, but close enough since I'm not at work and don't have the code on me), it's a reduction of 0.5139%.
Gems: The article shows agility clocking in at a 0.2284% reduction, slightly below a defense gem. The numbers may have changed slightly since then, I'll have to run the exact numbers when I get back to the office. That said, since Agi is a red gem and Def is a yellow gem, they don't directly compete for sockets.
I haven't had time to thoroughly vet this yet, so feel free to poke holes in the math. It's entirely possible I've made an oversight. I mostly want to get the groundwork laid so we can get a slightly more accurate idea of how much the block component of Defense is worth to us.
"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: 8001
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: Theck's MATLAB TPS analysis
Gear_Defense: 918
Gear_Parry: 302
Gear_Dodge: 521
These values seem slightly odd. Typos ?
Total avoidance: 59.1519%, 39.1519% after Chill
+dynamic effects (libram/weap ench/4pt10/trinket)
Block chance: 44.4275% with Holy Shield up, ignoring Redoubt
Why ?
Block value: 1803; "For the Block Factor, let's assume the boss hits for 20k and we block for around 2k to make it a clean 10%."
+STR/BV dynamic effects (libram/trinket)
Buffed Armor: 36823 + 1807 (devo) + 2*(38790) (armor from agi buffs) = 39224
+raid environment (MotW/SST), +dynamic effects (IS,FFD)

tlitp  Posts: 556
 Joined: Mon Jul 27, 2009 3:25 pm
Re: Theck's MATLAB TPS analysis
tlitp wrote:Theck wrote:Gear_Defense: 918
Gear_Parry: 302
Gear_Dodge: 521
These values seem slightly odd. Typos ?
That's what the MATLAB code was spitting out for my net defense, parry, and dodge rating contributions from my normal gear set. Looking at my armory, this is likely to be about right (I'm wearing different gear right now, but the numbers are at least in the same ballpark). 500600 dodge, 300400 parry, and 800+ defense. The full gearset I used is here.
That said, running the code today is giving me different numbers (edit  see next post, these are probably wrong for the given gear set):
Gear_Dodge: 775
Gear_Parry: 251
Gear_Defense: 777
AGI (buffed): 437
player_dodge: 32.0810%
player_parry: 19.1936%
player_avoid: 63.3316%
player_block: 42.7318%
adding 10 def rating:
player_dodge: 32.1501%
player_parry: 19.2721%
player_avoid: 63.5420%
player_block: 42.8131%
It's possible that it was still using the old T10 progression set yesterday. If I find some time, I'll write up the whole calculation in one mfile (possibly combined with the old agi vs. dodge calculations). I'm hesitant to do too much rewriting of anything right now, since I want to clean up the code base a LOT in cataclysm anyway.
tlitp wrote:Theck wrote:Total avoidance: 59.1519%, 39.1519% after Chill
+dynamic effects (libram/weap ench/4pt10/trinket)
Libram was SoV, enchant was Accuracy, 4p10 wasn't equipped, and trinkets were Key and Organ (so no procs). The Librams can be added in as a static bonus through the gear module if we want to include them.
tlitp wrote:Theck wrote:Block chance: 44.4275% with Holy Shield up, ignoring Redoubt
Why ?
Mostly because I was in a hurry, and didn't have time to incorporate the Redoubt code. If I write a full mfile to treat this using the standard modules it will be easy to include. I was just pulling the net values off and doing the math by hand to get a quick estimate.
tlitp wrote:Theck wrote:Block value: 1803; "For the Block Factor, let's assume the boss hits for 20k and we block for around 2k to make it a clean 10%."
+STR/BV dynamic effects (libram/trinket)
Again, Libram is treated as a static bonus, and I've ignored the skeleton key trinket since it's mostly irrelevant (it'll take 6k absorb off of any unavoided attack or series of attacks, so it shouldn't affect this calculation).
I believe MotW is included in the agi buffs, that was pulled from AGI after stats_recalc. Ironshield and FFD could be incorporated though. Apparently we never actually calculated net armor values in stats_recalc, so I had to put those together by hand based on my agi vs dodge mfile.
"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: 8001
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: Theck's MATLAB TPS analysis
Aha, I think I figured out what was going wrong. I have a local copy (on my laptop) of the files, and a "master" copy on a network drive. I think I may have been editing the network version but running the local version. That would explain some of discrepancies in the numbers. The ones in the last post are definitely from the local copy, and thus erroneous.
I'll throw together a quick mfile that should solve a bunch of the issues. I may quickly modify stats_recalc to include a rough estimate of armor as well (ignoring procs like IS and FFD for the moment).
I'll throw together a quick mfile that should solve a bunch of the issues. I may quickly modify stats_recalc to include a rough estimate of armor as well (ignoring procs like IS and FFD for the moment).
"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: 8001
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: Theck's MATLAB TPS analysis
theckhd wrote:I believe MotW is included in the agi buffs, (I)
that was pulled from AGI after stats_recalc. Ironshield and FFD could be incorporated though. (II)
Apparently we never actually calculated net armor values in stats_recalc, so I had to put those together by hand based on my agi vs dodge mfile. (III)
I. MotW_armor (the direct armor component) is definitely not, on the code off repo. (read below)
II. You can use a simplistic/rudimentary linear combination, in order to gauge the average. Armor values a0/a1/a2, uptimes u1/u2, timeaveraged value. Don't forget to enforce the 75% mitigation cap.
 Code: Select all
a0*(1u1)(1u2)+(a0+a1)*u1(1u2)+(a0+a2)*(1u1)u2+(a0+a1+a2)*u1u2
∑(min(mit(armor_combination),0.75)*uptime_combination)
III. The repo code doesn't compute armor values, I have a version which does (using a generalized algo for dynamic effects) but it never got submitted.
theckhd wrote:I want to clean up the code base a LOT in cataclysm anyway.
O rly ?
The wotlkedition got messier and messier with each iteration, and keeping the repo updated with our own experimental code was a struggle never won.

tlitp  Posts: 556
 Joined: Mon Jul 27, 2009 3:25 pm
Re: Theck's MATLAB TPS analysis
tlitp wrote:theckhd wrote:I believe MotW is included in the agi buffs, (I)
that was pulled from AGI after stats_recalc. Ironshield and FFD could be incorporated though. (II)
Apparently we never actually calculated net armor values in stats_recalc, so I had to put those together by hand based on my agi vs dodge mfile. (III)
I. MotW_armor (the direct armor component) is definitely not, on the code off repo. (read below)
II. You can use a simplistic/rudimentary linear combination, in order to gauge the average. Armor values a0/a1/a2, uptimes u1/u2, timeaveraged value. Don't forget to enforce the 75% mitigation cap.
 Code: Select all
a0*(1u1)(1u2)+(a0+a1)*u1(1u2)+(a0+a2)*(1u1)u2+(a0+a1+a2)*u1u2
∑(min(mit(armor_combination),0.75)*uptime_combination)
III. The repo code doesn't compute armor values, I have a version which does (using a generalized algo for dynamic effects) but it never got submitted.
Ah, I was omitting the 750 static armor from Mark. I see what you mean now.
I don't have convenient uptime data onhand at the moment, which is why I've been ignoring some of the transient buffs. For the moment I don't think it's critical  the goal is to get a ballpark estimate, since this will fluctuate pretty significantly with your total armor. Something accurate to about 10% or so is probably fine for now. We can worry about getting all the details down when we start the Cataclysm rewrite.
One issue with adding armor calculations to the current code is that bonus armor is treated differently than the base armor on an item. Since the gear module doesn't record them separately, we'd have to edit the gear module data format to accurately predict armor. I don't see much point in doing that now, since I want to rewrite the entire gear module for cataclysm anyhow. In the mfile below, I've just estimated armor using the armory value from yesterday and adding in buffs by hand.
Here's the quickanddirty calculation file using stats_recalc:
http://sites.google.com/site/theckhd/mf ... ps_redux.m
Thus should include redoubt uptime and all known raid buffs. I've had to calculate armor from devo, stoneskin, motw, and agi buffs by hand:
 Code: Select all
ub_armor=36823; %from armory
player_armor=ub_armor+1807+1150+750+2*(AGIBase_AGI); %devo, stoneskin, agi
Here's what it spits out:
Gear_Defense: 918
Gear_Parry: 302
Gear_Dodge: 521
Gear_AGI: 32
AGI (buffed): 387
player_dodge: 8.8813% (after throne)
player_parry: 20.6348%
player_avoid: 39.1519% (after throne)
player_block: 48.8512%
M1 = 71.1993%
BF1 = 8.6800%
+10 def rating
Gear_Defense: 928
player_dodge: 8.9320%
player_avoid: 39.2887%
player_block: 48.8651%
def_redux = 0.2439%
equivalent armor: 100.55
This is quite a bit lower than yesterday, but it doesn't seem to be due to armor (dropping Stoneskin and MotW changes the result to 95) or hit size (changing to 10% block factor only raises it to 101). I must have made another error in either yesterday's calculation or the mfile to cause such a large discrepancy. Since I did a lot of the math yesterday by hand (i.e. in the MATLAB command window), I suspect that yesterday's result was the one in error.
I should also mention that I've uploaded a few files that I had newer local versions for. But none of them other than the gear set change should affect this calculation.
"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: 8001
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Re: Theck's MATLAB TPS analysis
Can't a man edit a post without Theck interfering ?
I'll look over the exact values later on.
Speaking of edits :
 use 80% for IS (doublepot, 5 min fight)
 10/(60+1/((1player_avoid)/boss_swing *0.03)) for FFD; 60 ICD, 3% off NPC hits
 10/(60+1/((1player_avoid)/boss_swing *0.25)) for Aegis; 45 ICD, 25% off NPC hits
I'll look over the exact values later on.
Speaking of edits :
 use 80% for IS (doublepot, 5 min fight)
 10/(60+1/((1player_avoid)/boss_swing *0.03)) for FFD; 60 ICD, 3% off NPC hits
 10/(60+1/((1player_avoid)/boss_swing *0.25)) for Aegis; 45 ICD, 25% off NPC hits
Last edited by tlitp on Thu May 20, 2010 9:11 am, edited 1 time in total.

tlitp  Posts: 556
 Joined: Mon Jul 27, 2009 3:25 pm
Re: Theck's MATLAB TPS analysis
tlitp wrote:theckhd wrote:I want to clean up the code base a LOT in cataclysm anyway.
O rly ?
The wotlkedition got messier and messier with each iteration, and keeping the repo updated with our own experimental code was a struggle never won.
To be honest, you and I should probably look into some sort of github or svc setup for the Cat code base. That might make the management a lot more convenient, because we'd reduce the risk of typos when I make updates that you've submitted.
I'm thinking about slightly more than just code cleanliness for cataclysm though. Our (okay, my) variable naming scheme is basically a mess. I'd like to standardize a bunch of stuff to make the modules more consistent and easier to sub in or out.
Simple example: The gear module stores gear stats in a simple array format, where each item looks like this:
 Code: Select all
%Format:
%Item = [STR STA AGI INT SPI Hit Crit Exp AP SP Haste ArP Def Dod Parr BV BR Armor]
%Cataclysmic Chestguard
Chest = [123 207 0 0 0 0 0 82 0 0 0 0 108 0 0 0 0 3817];
ChesGems= [0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
This is a pain for a few reasons:
The fields are arranged in no particular order, making it hard to find
If I want to add a field ("Bonus Armor"), I can't do it without adding it to every item in every version of the code that I want to use
It's not that easy to swap items around to test different gear configurations (c.f. the weapon TPS calc file)
What I'd rather do is store each item in a fieldlike structure:
 Code: Select all
cataclysmic_chestguard.type=chest
c_c.no=50968 %wowhead item #
c_c.STR=123+30+30+30 %Sta/Sta/Sta gems
c_c.STA=207
c_c.Exp=82
c_c.Def=108
c_c.Armor=3xxx
c_c.bonusarmor=1xxx
equip(c_c)
The "equip" call would set the Chest variable to contain the values that c_c has. Anything not defined in the c_c structure (i.e. INT) is assumed to be zero. The gear module would be split into two or three parts then:
gear_db  contains all the stats for relevant items
gear_X  A particular gear set (ex. gear_theck_T10_prog). This file would just be a bunch of equip() calls
gear_recalc  would recalculate the gear contributions from all items (i.e. Gear_AGI = Chest.AGI + Helm.AGI + ..., pretty much like it does now)
Why is this a good idea? When I write the new weapon comparison file, it will be a lot easier to manage which items go where and change the order on the fly.
equip(bonebreaker_scepter)
(run simulations)
equip(last_word)
(run simulations)
or
for i=1:size(weap_list,1)
equip(weap_list{1})
(run simulations)
end
It also means I have one location with all the relevant gear stats.
"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: 8001
 Joined: Thu Jul 31, 2008 3:06 pm
 Location: Harrisburg, PA
Return to Advanced Theorycraft and Calculations
Who is online
Users browsing this forum: No registered users and 1 guest