Index generation and usage methods (long)

Posted by Richard Reid on Sunday, 17 May 1998, at 4:49 p.m.

Greetings:

The following post is basically a repeat of another BJ21 post I made in response to Pete Moss which goes into some analytical detail regarding index generation and usage methods. I have modified it a bit to fit in better with the recent Index number discussion, but it is basically an expansion and followup on Pete Moss's "Rounding, Truncating" post which is archived on this site under the indices link in the table of contents.

Index Generation Methods

First, the method of generating the indices is an extremely important factor. Pete's post mentions two main methods. For clarification, I will repeat some of his ideas because they are very good and to explain things in more detail, I will split Pete's two groups into five categories as follows:

Category 1) simulation(truncating),
Truncating means to LOP off everything after the decimal point. For example, a value of +2.3 becomes +2, and a value of -1.6 becomes -1. The problem with truncating centers around the zero point on the number line. A value of +0.4 becomes zero and a value of -0.7 also becomes zero. Therefore any number between -1 and +1 becomes zero. And as Pete has correctly pointed out in his post, "the category corresponding to a true count of zero would then comprise twice as big a true count span as any other." Therefore, in my opinion the truncated setting should never be used to generate true count indices.

Category 2) simulation(general rounding),
General Rounding means to convert the number to the next larger integer magnitude if the first digit after the decimal point >= x or convert to the next smaller integer magnitude if the first digit after the decimal point < x. In most cases x = 5. For example, an index number of +1.3 would be converted to +1. An index number of +1.5 wuld be converted to +2. A value of -1.6 would be converted to -2 and an index number of -3.49 would be converted to -3. This method can be used in the generation of index number and we will have more to say later on about when it is appropriate to use.

Category 3) simulation(rounding down),
Rounding down means to always convert the number to the next smaller integer value (not magnitude) on the number line. This method is similar to truncating, but with one major difference. All negative numbers are rounded to the next lower value. For example, an index number of -1.2 is rounded down to -2. An index number of -2.6 is rounded down to -3. An integer value of -0.1 is rounded down to -1. An index number of +3.2 is rounded down to +3. And an index number of +5.9 is rounded down to +5. This method will also be mentioned later.

Category 4) simulation(rounding up),
Rounding up means to always convert the number to the next larger integer value on the number line. It is essentially rounding in the opposite direction of rounding down. For example, a value of -2.1 is rounded up to -2. A value of -0.8 is rounded up to 0. A value
of +2.4 is rounded up to +3 and a value of +1.9 is rounded up to +2. More later.

Category 5) calculation/floating point simulation.
Finally, we come to the method of calculating indices. The previous methods have used simulation and have converted the numbers to an integer value. This method calculates a floating point value and doesn't convert to an integer. In other words, a value of +2.3
stays at +2.3. However, during the calculations, some type of rounding (normally general rounding) is applied, but only to the first decimal place. In other words, a value of +2.478 is rounded to +2.5 and a value of -1.639 is rounded to -1.6. I do not distinguish the differnce between a calculated value rounded to one decimal place and a simulated value rounded or truncated to one decimal place. To me the difference in practical play is virtually indistinguishable. As with the other categories we will discuss this method
later.

Index Usage Methods

Although there are five categories of index number generation, practically speaking, there are only two methods that are commonly used in play. The two main usage methods are:
a) truncating
b) general rounding

In my previous post, I have proposed a third method I termed "hit on your left."

c) Hit on your left. This method takes any true count and compares it to the index number. If the true count value is less than the index number, then one hits. The accuracy of the method depends on how close one wishes to calculate the true count.

Combining Index Generation and Index Usage Methods

It is important to properly combine the methods. The reason is to reduce the amount of error. In other words, the worst case condition for some combinations is greater than for other combinations. We wish to select only those combinations that are susceptable to the minimum amount of worst case error.

Combining all the methods gives rise to 25 generation/use categories of which only 15 are reasonable choices:

1a) truncating/truncating
1b) truncating/general rounding
1c) truncating/Hit on your left

2a) general rounding/truncating
2b) general rounding/general rounding
2c) general rounding/Hit on your left

3a) rounding down/truncating
3b) rounding down/general rounding
3c) rounding down/Hit on your left

4a) rounding up/truncating
4b) rounding up/general rounding
4c) rounding up/Hit on your left

5a) calculation/truncating
5b) calculation/general rounding
5c) calculation/Hit on your left

Of these fifteen categories, 1a, 1b and 1c can be immediately eliminated because of the truncating problem associated with generation of a true count = 0 as described in the Category 1 section above. This leaves us with 12 categories to analyze. What we are looking for is those combinations that have the smallest amount of worst case error. We will eliminate any combinations with a greater amount of inherent error than that of the determinined minimum worst case condition.

So starting with 2a) we'll determine the worst case condition error.

2a) general rounding/truncating: (1.4999)
The worst case would be when the index generated number would be at a range minimum and the true count is at a range maximum. For example, if the index number value was +.5, it would be rounded up to +1. And if the true count is now at +1.9999, it would be truncated to +1, the difference (error) is +1.4999.

2b) general rounding/general rounding: (0.9999)
Again we're looking for a differnce between range minimum and range maximum. Using the same example as before, we see that the index number of +0.5 is rounded up to +1. In this case though, the maximum range for a true count of +1 is +1.4999, for a worst case condition difference (error) of only 0.9999. The worst case error in this category is clearly lower than that of category 2a.

2c) general rounding/Hit on your left (rounded down) (0.5)
An index number of +0.5 is rounded up to +1. Using the hit on your left method, one would hit at +0.9999 or lower. But general rounding covers the fact that one should be standing at a value as low as +0.5. This means that the worst case error is only 0.4999. This is clearly the best method so far.

3a) rounding down/truncating (1.4999)
Same worse case condition to that of 2a. Category 2C is still best.

3b) rounding down/general rounding (1.4999)
A index value of +1.999 would be rounded down to +1 and a true count of +0.5 would be rounded up to +1. the difference is +1.4999. Category 2c is still best.

3c) rounding down/Hit on your left (0.9999)
An index value of +1.999 is rounded down to +1. A hit on your left value of +0.999 would be hit. The difference is +0.999. Same error as in category 2b

4a) rounding up/truncating (1.4999)
Reverse of 3a, but with same associated error.

4b) rounding up/general rounding (1.4999)
Reverse of 3b, with same associated error.

4c) rounding up/Hit on your left (0.9998)
An index of +1.0001 would be rounded up to +2. A value of +1.9999 would be rounded down to +1. The difference is +0.9998 Unless I've missed something, it certainly seems that the "general rounding/hit on your left" method (2c) is clearly the most accurate simulation method displayed thus far, with the following categories next in line:

4c) rounding up/Hit on your left (0.9998)
2b) general rounding/general rounding: (0.9999)
3c) rounding down/Hit on your left (0.9999)

Let's look at the various calculation methods. The calculation methods are unique because the indices can be used as is, or the indices can be coverted using one of the first four category techniques. If a conversion is done then the converted numbers should be treated exactly the same as those in category associted with the type of conversion. for example, if these index numbers are rounded down then they should be treated exactly like those in Category 3.

If left unconverted, the worst case error in the following method is:
5a) calculation/truncating (0.099)
An index value of +1.9 is kept at +1.9. A true count of +1.999 is rounded to +1.9. The difference is 0.099.

5b) calculation/general rounding (0.05)
An index value of +1.9 is kept at +1.9. A true count of +1.85 is rounded up to +1.9. the difference is 0.05. this method is better than that of 5a.

5c) calculation/Hit on your left (approx 0.0001)
An index value of +1.9 is kept at +1.9. A true count of +1.8999 is hit. The difference is negligible. Again, the hit on your left method looks pretty good to me.

Summary

For most practical purposes, the combination that leads to the least amount of worst case error is that of general rounding index generation along with "Hit to the Left" index usage. It has a worst case error of 0.5. The other popular method is that of generating indexes via general rounding, while using the truncating method to vary strategy. This method has virtually three times the worst case error (1.499) of the the rounding/"Hit on the left" method. Therefore, my recommendation is to generate indices via general rounding and then use "Hit on the left" method as described in my previous post to vary ones play.

For the calculated indices, the combination that minimizes worst case error is that of calculation for index generation along with "Hit to the Left" for index usage. The worst case error is virtally non-existent and, therefore, this is the combination that I recommend for those situations where one has memorized floating point index numbers.

Sincerely,
Richard Reid