Aces High Bulletin Board

General Forums => Aces High General Discussion => Topic started by: oneway on April 11, 2011, 06:53:27 PM

Title: Math & Statistics Question
Post by: oneway on April 11, 2011, 06:53:27 PM
Anybody with a background in stats and number crunching....or anyone for that matter please chime in...

Predicate:

I want to calculate a Kill/Death ratio average across X blocks of data. Each block of data will produce its own unique value for K, and for D

In certain (but infrequent) circumstances, D may equal Zero. K can also equal Zero, but is irrelevant mathematically as well as practically.

Output Desired:

I want to output a true K/D value for use in averaging across X blocks.

Problem:

Division by Zero. If a block in X blocks returns D = 0, K/D will naturally fail.

Typical Solution:

Add 1 to D

Resultant Issue:

Adding 1 to D as a default assumption produces wildly inaccurate K/D ratios when dealing with narrow data sets, and is exacerbated when running further functions such as averaging.
Example: 15 K, 2 D will yield either 7.5 or 5.0; a 50% swing - totally unacceptable rate of return

Question/Proposed Solution:

Is their anything fundamentally wrong with Setting the value of K/D to K when D = 0?, and leaving all other K/D quotients at stock (K/D) ?

 :salute

Oneway


Edit: Whoops, just realized this should have been posted in the General Forum...not this Forum...my apologies (Skuzzy...clean up on Aisle 5)...
Title: Re: Math & Statistics Question
Post by: Hoff on April 11, 2011, 07:12:11 PM
Setting it to K will add 1 to your deaths when there really wasn't a death. I don't know what you're trying to do, but if you're just trying to average kills/death then you just need to take all kills and divide by all deaths. You can't really average an average since they have different scales. You might be 25/1 in one plane and 90/90 in another. If you just went by K/D averages this would come out to be 13, but if you went by total kills/total deaths it would be 1.26.

It would be easier to help you out if I knew exactly what you were trying to do. If, for some reason, you want to average the averages, then you could just use an IF statement for when D = 0 make it D+1 (which can be easily done in excel).
Title: Re: Math & Statistics Question
Post by: oneway on April 11, 2011, 07:34:40 PM
Setting it to K will add 1 to your deaths when there really wasn't a death. I don't know what you're trying to do, but if you're just trying to average kills/death then you just need to take all kills and divide by all deaths. You can't really average an average since they have different scales. You might be 25/1 in one plane and 90/90 in another. If you just went by K/D averages this would come out to be 13, but if you went by total kills/total deaths it would be 1.26.

It would be easier to help you out if I knew exactly what you were trying to do. If, for some reason, you want to average the averages, then you could just use an IF statement for when D = 0 make it D+1 (which can be easily done in excel).

Averaging ratios/quotients, not averages of an average

Potential input include divisors of zero for the initial round of quotient output...before the averaging loop

Read it one more time

If D = 0, then step around K/D and set K/D quotient/output to K

I thinks its pretty clear what the com problem is...I am mixing computer programming language with math...

Would it be correct to step out of the Math flow, and do a direct return assignment?

 :salute

Title: Re: Math & Statistics Question
Post by: Hoff on April 11, 2011, 07:39:55 PM
Averaging ratios/quotients, not averages of an average

Potential input include divisors of zero for the initial round of quotient output...before the averaging loop

Read it one more time

I thinks its pretty clear what the problem is

 :salute




Ratio, quotient, and average can all mean the same thing.

Anyways, like I said, if you really want to do that, just use an IF statement.
Title: Re: Math & Statistics Question
Post by: Jayhawk on April 11, 2011, 07:42:18 PM
(http://i666.photobucket.com/albums/vv23/Jayhawk1/excel.jpg)

Okay, so the numbers on the right indicate the problem you're having, being unable to divide by 0.

So total up all Kills, Total up all deaths, and you'll get an accurate number.  That's how I'm understanding the issue, and I believe that was the solution Hoff suggested.  But maybe I still don't quite understand the problem.
Title: Re: Math & Statistics Question
Post by: StokesAk on April 11, 2011, 07:44:17 PM
Couldn't you just substitute 1 for 0 in your program somehow, it would yield the same K/D as any number divided by 1 is the same?

29 kills
0 deaths

you would get 29/1 which is still a ratio of 29.
Title: Re: Math & Statistics Question
Post by: iaqmya on April 11, 2011, 07:45:32 PM
 :noid

This is a game, isn't it?
Title: Re: Math & Statistics Question
Post by: Hoff on April 11, 2011, 07:48:11 PM
Averaging ratios/quotients, not averages of an average

Potential input include divisors of zero for the initial round of quotient output...before the averaging loop

Read it one more time

If D = 0, then step around K/D and set K/D quotient/output to K

I thinks its pretty clear what the com problem is...I am mixing computer programming language with math...

Would it be correct to step out of the Math flow, and do a direct return assignment?

 :salute



(http://i666.photobucket.com/albums/vv23/Jayhawk1/excel.jpg)

Okay, so the numbers on the right indicate the problem you're having, being unable to divide by 0.

So total up all Kills, Total up all deaths, and you'll get an accurate number.  That's how I'm understanding the issue, and I believe that was the solution Hoff suggested.  But maybe I still don't quite understand the problem.

Using this excel file as an example. What you want to do, from what I can tell, is to average column C and not get the total average (C10). In that case you need to worry about dividing by zero. To fix this, simply use an IF statement in excel for column B. Any time a 0 is shown in column B, have excel change it to 1. Problem solved.
Title: Re: Math & Statistics Question
Post by: LLogann on April 11, 2011, 09:43:18 PM
I'm not so great at math, but I'll say this...

Don't think of it as a Death, think of it as Life..........  A Kill/Life ratio so to speak. 

At the end of the tour if you have no deaths, you have had 1 life. 

If you have died 64 times, you have had 65 lives. 

And thinking about K/D like this may nullify your need to do, what, ever, it may be you're trying to do sir!!!   :salute
Title: Re: Math & Statistics Question
Post by: grizz441 on April 11, 2011, 10:33:50 PM
I don't see the issue, as individual sortie output shouldn't matter and your K/D is INF if you do not die, however if you want it to be simply the number of kills you recorded, set the C2 cell to IF(B2<1,A2,A2/B2) and drag it down.
Title: Re: Math & Statistics Question
Post by: Ardy123 on April 11, 2011, 10:35:46 PM
Just change the stat to kills per life...

Then you start off on your first life...

thus...


its k/l and lets say you have 5 kills and one life, then its 5/1 = 5 and your an ace :aok
Title: Re: Math & Statistics Question
Post by: oneway on April 11, 2011, 10:49:21 PM
Just change the stat to kills per life...

Then you start off on your first life...

thus...


its k/l and lets say you have 5 kills and one life, then its 5/1 = 5 and your an ace :aok

That is fascinating Ardy
Title: Re: Math & Statistics Question
Post by: Hoff on April 11, 2011, 10:52:01 PM
Just change the stat to kills per life...

Then you start off on your first life...

thus...


its k/l and lets say you have 5 kills and one life, then its 5/1 = 5 and your an ace :aok

Otherwise known as deaths +1....lol
Title: Re: Math & Statistics Question
Post by: oneway on April 11, 2011, 10:55:52 PM
Couldn't you just substitute 1 for 0 in your program somehow, it would yield the same K/D as any number divided by 1 is the same?

29 kills
0 deaths

you would get 29/1 which is still a ratio of 29.

Exactly Srokes...your suggestion is exactly how I am leaning on this...I was hoping for input from the stat gurus who make a living crunching ratios......I think your right...I think I am right...I just wish those guys who professionally deal with this sort issue would chime in: IS it ok to replace K/D with K when D is zero?

Their has to be at least one pro stat guy lurking around here who can chime in...what say you ??? How do you handle averages of ratios across data blocks when an element divisor might be ZERO?

The bottom line is if a guy has zero deaths...does it foul or corrupt the data to simply say: When D = 0...then K/D = K
Title: Re: Math & Statistics Question
Post by: BaldEagl on April 11, 2011, 11:12:52 PM
See my reply in the other forum.
Title: Re: Math & Statistics Question
Post by: AAJagerX on April 12, 2011, 12:01:09 AM
Just substitute .00000000000000001 for your deaths in that catagory.  Close enough right?
Title: Re: Math & Statistics Question
Post by: Ardy123 on April 12, 2011, 12:23:31 AM
That is fascinating Ardy

Otherwise known as deaths +1....lol

no one gets my stupid humor...(except for hoff, maybe (can't tell if its at me or because of me)
Title: Re: Math & Statistics Question
Post by: Hoff on April 12, 2011, 12:24:59 AM
K/D would be infinity if you substituted a small number like that. Doing the averaging the way you want to do it is going to cause error in your final calculation. The best thing you can do is make, for example, 2/0 and 2/1 k/d the same. This is obviously not the same, but for whatever reason you need that specific ratio. Your best bet is to do what you are saying, just use an IF statement to make 0 = 1 for death purposes.


@ardy, it was at you, I was hoping you were being facetious  :aok.
Title: Re: Math & Statistics Question
Post by: Ardy123 on April 12, 2011, 12:27:21 AM
K/D would be infinity if you substituted a small number like that. Doing the averaging the way you want to do it is going to cause error in your final calculation. The best thing you can do is make, for example, 2/0 and 2/1 k/d the same. This is obviously not the same, but for whatever reason you need that specific ratio. Your best bet is to do what you are saying, just use an IF statement to make 0 = 1 for death purposes.


@ardy, it was at you, I was hoping you were being facetious  :aok.

seriously you don't have to divide it.. you can just have it as a fraction and reduce it as much as possible... so  5/0 or 5/1 (10 kills 2 deaths), etc..

Title: Re: Math & Statistics Question
Post by: Jayhawk on April 12, 2011, 12:34:01 AM
Just substitute .00000000000000001 for your deaths in that catagory.  Close enough right?

5 / .00000000000000001 = 500000000000000000
Title: Re: Math & Statistics Question
Post by: AAJagerX on April 12, 2011, 12:42:05 AM
5 / .00000000000000001 = 500000000000000000

I know.  That was a poor attempt at humor. 

Really though, if there's a zero in your K/D table, just cut out the middle man...  Take out the values in the spreadsheet and substitute your total kills in the sum area.  You don't need real-time calculations do you?
Title: Re: Math & Statistics Question
Post by: Jayhawk on April 12, 2011, 12:50:43 AM
Substituting a 5/0 K/D with 5 would be equivalent to substituting a 5/1 K/D.  Would it have an effect on your results, yes, how big of an effect, well that depends on how much data you've got.
Title: Re: Math & Statistics Question
Post by: AAJagerX on April 12, 2011, 12:55:52 AM
Substituting a 5/0 K/D with 5 would be equivalent to substituting a 5/1 K/D.  Would it have an effect on your results, yes, how big of an effect, well that depends on how much data you've got.

It wouldn't affect it at all if he was running his own spreadsheet (which I think was what he was trying to do).  All you'd have to do is go through and change the sums of your flights without a kill to the total of your kills in that plane.  Depending on how many 0 death planes you have for that tour, it wouldn't be difficult.

If he's talking about changing the K/D +1 in the AH score tables, that's a totally different story.
Title: Re: Math & Statistics Question
Post by: Ardy123 on April 12, 2011, 12:56:09 AM
Substituting a 5/0 K/D with 5 would be equivalent to substituting a 5/1 K/D.  Would it have an effect on your results, yes, how big of an effect, well that depends on how much data you've got.

no treat it as a fraction then do math on that fraction... but keep it in fraction form.
Title: Re: Math & Statistics Question
Post by: Jayhawk on April 12, 2011, 12:58:56 AM
no treat it as a fraction then do math on that fraction... but keep it in fraction form.

Except we don't know what he's doing for sure.
Title: Re: Math & Statistics Question
Post by: Hoff on April 12, 2011, 01:03:08 AM
It sounds like he's trying to average his K/D by averaging each individual plane K/D together, which doesn't make sense to me. Someone might have a 100/1 K/D in the 262 but if in their main ride, say a P51D, they have a 5000/4000 K/D then the averages are going to be way off if you average the two K/D's together instead of total kills divided by total deaths (50.625 vs. 1.275).
Title: Re: Math & Statistics Question
Post by: Vinkman on April 12, 2011, 07:28:41 AM
Setting it to K will add 1 to your deaths when there really wasn't a death. I don't know what you're trying to do, but if you're just trying to average kills/death then you just need to take all kills and divide by all deaths. You can't really average an average since they have different scales. You might be 25/1 in one plane and 90/90 in another. If you just went by K/D averages this would come out to be 13, but if you went by total kills/total deaths it would be 1.26.

It would be easier to help you out if I knew exactly what you were trying to do. If, for some reason, you want to average the averages, then you could just use an IF statement for when D = 0 make it D+1 (which can be easily done in excel).

This  :aok
Title: Re: Math & Statistics Question
Post by: MrRiplEy[H] on April 12, 2011, 07:48:38 AM
Just substitute .00000000000000001 for your deaths in that catagory.  Close enough right?

Umm you MIGHT want to rethink that a little.. :D

5 kills divided by .000000000000001 is how much again? :)
Title: Re: Math & Statistics Question
Post by: Dead Man Flying on April 12, 2011, 08:38:36 AM
I want to calculate a Kill/Death ratio average across X blocks of data. Each block of data will produce its own unique value for K, and for D

Just out of curiosity, what are you hoping to achieve by averaging the quotients?  In almost all cases, it's better to sum the divisors and the dividends and obtain an aggregated K/D score as you did in the last row.



Title: Re: Math & Statistics Question
Post by: hitech on April 12, 2011, 09:31:08 AM
oneway it makes no statistical sense to have a K/D and then trying to magically change the D in special situations. The output of this method would be meaningless because if you change it to 1 when it is zero you would get the same results for 5 kills zero death and 5 kills 1 death.

It may seem to you that your are upsetting the stats by using kill to life, but you are not. What you are seeing is the difference in number of sorties and simple variations do to sample size. And with a small sample size your results are statistically meaningless no matter what you do.

2nd what is it you are trying to accomplish?


HiTechb
Title: Re: Math & Statistics Question
Post by: AAJagerX on April 12, 2011, 01:58:56 PM
Umm you MIGHT want to rethink that a little.. :D

5 kills divided by .000000000000001 is how much again? :)

Read a few posts down from that post.   :D