Metodolos¡ki zvezki, Vol. 2, No. 1, 2005, 109-113 Effect of Rounding on Expected Value and Standard Deviation 2 Anton Cedilnik1 and Katarina Kos¡melj Abstract We prove that the rounded expected value of the rounded random variable differs from the expected value of the original random variable by less then 25, where ö is the distance between two neighbouring rounded numbers. The same conclusion holds for standard deviation. Hence, in practice the influence of rounding to expected value and standard deviation is almost negligible. 1 Introduction Usually, rounding (Everitt, 2002; Lisman, 1985) is considered as a procedure for reporting numerical information to fewer digits than used during data collection or analysis. The most frequent rounding procedure is to discard all decimal digits right of the d-th one which may be corrected in a well known way; the set of all rounded values form the arithmetic sequence of all rational numbers of the form integer ¦ 10_d. In this paper, we understand rounding more generally: it is a procedure for reporting real-numerical information as a subset of an arbitrary arithmetic sequence. Suppose that rounded values form an arithmetic sequence (? + n?)n&Z. ? is the rounding level and is a positive real number, and the shift ? is the first non-negative rounded value (0 < ? < ?). The value ? + n? is the round-off of the interval In=[?+(n-?)? , ?+(n+1-?)?), where ? (0 < ? < 1), if different of |, presents the asymmetry of rounding. This rounding is described by the function x i-»- (x) := ? + int where int(.) denotes the integer function (also known as floor function) int(t) = [t\ := max{m | m E Z A m < t} . Example A. Rounding to d decimal places (or to |d| integer places, if d < 0): ? = 10_d, ? = 0, ? = \. It is worth noting that the standard rounding procedure differs slightly from 1 Biotechnical Faculty, University of Ljubljana, Slovenia; anton.cedilnik@bf.uni-lj.si 2 Biotechnical Faculty, University of Ljubljana, Slovenia; katarina.kosmelj@bf.uni-lj.si 110 Anton Cedilnik and Katarina Kos¡melj our one if we cut off an exact 5. For example, for d = - 2 the standard procedure rounds 7450 to 7400 (the last retained digit on the right should be even); but, according to our definition, (7450) = 7500. Example B. The value of a person’s age is usually truncated to its integer part: ?=1, ? = 0, ? = 0. Example C. The number of car accidents is given in classes, e.g., 0 to 9, 10 to 19,... The values of each class are rounded to its mid-point. The class width determines the rounding level, ? = 10 , the shift (the mid-point of the first class) is ? = 4, 5 , and ?=. The problem of rounding random variable occurs most frequently in the following two cases. 1. A discrete random variable is given entirely, but with rounded values (as in Example B, the ages of some minor population). 2. By experimenting we obtain a huge number of rounded values of certain random variable, so huge that the Law of large numbers already works perfectly, and we would wish to know the relation between the expected value and the arithmetic mean of obtained values. Suppose that X is a real random variable with the distribution function F(x). Its rounded image (X) is then a discrete random variable X=?+int(X-? +?)'M::: ?+n?:::] (1.1) vn = F (-> ? + (n + 1 - ?) ?) - F (-> ? + (n - ?) ?) (where —> indicates the left limit of possibly discontinuous distribution function). The objective of our work is to assess the effect of rounding on the expected value and standard deviation. The following four differences will be under study: the two of theoretical significance E((X))-E(X), (1.2) ?({X))-?(X), (1.3) and the two of more practical significance (E((X)))-E(X), (1.4) (?((X)))-?(X). (1.5) Let us write (X) = X + W , where the perturbation W is a bounded random variable W = ??- with the obvious range W={X)-X e(-(1-?)?,??]. (1.6) Effect of Rounding on Expected Value and Standard Deviation 111 The existence of the expected value E({X)) and standard deviation ?({X)) has its justification in the following lemma with a simple proof which we omit. LEMMA. Let X be any random variable and W a bounded random variable. X + W has an n-th moment about origin (and accordingly all other moments of the same or lower orders) if and only ifX has it. 2 Expected value Taking into account (1.6), we immediately obtain the following result on the difference (1.2): E(W) = E((X)) - E(X) E (-(1-?)?,??], (2.1) which is an interval of the length ?. Now, we consider the difference (1.4). Denote a = (E(X) + E(W) - ?)/? + ?. Then {E({X})} - E(X) = ? + int (a) • ? - E(X) = ? + int (a) • ? - ((a - ?)? + ? - E(W)) = E(W) +??-(a- int(a))?. Since ?? - (a - int(a))? G (-(1 - ?)?, ??], then (E((X))) - E(X) E (-2(1 - ?)?, 2??], (2.2) which is an interval of the length 2?. The intervals in (2.1) and (2.2) are as narrow as possible for arbitrary values of the parameters ?, ?, and ? of the rounding function (1.1). The example where the upper bound in (2.1) and (2.2) is atteined is \ ?-?? ?-?? + ?] ? 1-? , and the example for both lower bounds is [ ? - ?? - ?? ?-?? + ?-??] 2~ ? + ? 1-?-? , where ? should be extremely small positive. 3 Standard deviation 2 Let S be a random variable with P (? < S < ß) = 1. Then?(S) < ^-^, and?(S) = if and only if ?ß . 2 2 Hence, if P(? < S < ß) = 1 then ?(S) < ^2. We shall use this fact to estimate the standard deviation of W. Suppose that X has a variance as well. Firstly, we estimate ?(W) < ?/2, since the length of the interval (-(1 - ?)?,??] from (1.6) is precisely ?. Then, also using the Cauchy - Schwarz inequality (Jamnik, 1971), ?(X) - ?/2 < ?(X) - ?(W) < ?(X + W)< ?(X) + ?(W) < ?(X) + ?/2. 112 Anton Cedilnik and Katarina Kos¡melj Shortly, ?({X))-?(X) E (-?/2,?/2) (3.1) which is the result about the difference (1.3). The following two random variables are examples which confirm that the interval in (2.2) is as narrow as possible, X3 for the upper bound, and X4 for the lower bound. I ?-??-? ?-??'l 2 2 T?-?? ?-?? + ?-?l 2 2 where ? is extremely small positive. Now, let us deal with the last difference (1.5). Denote a = (?((X)) - ?)/? + ?. Then ?((X))-? (?((X))) - ?(X) = ? + int HT1L1----1 + ?\ ¦ ? - ?(X) = = ??+ [?({X)) - ?(X)] -[a- int(a)]?. Hence, (?((X))) - ?(X) G (-(1.5 - ?)?, (0.5 + ?)?) (3.2) We do not know if the bounds of this interval are the best possible for any selection of ?, ? and ?. However, for special selections of these numbers this is the case. For example: X3 for ? = 0 and ? = 1/2, and X4 for ? = 0 and ? = 1 - ?. The following theorem summarizes previous results. THEOREM. Let X be a random variable. If E(X) exists, then -(1-?)?< E((X)) - E(X) < ??, -2(1-?)?< (E((X))) - E(X) < 2??, and if ?(X) also exists, then -?/2 < ?((X)) - ?(X) < ?/2, -(1.5 - ?)? < (?((X))) - ?(X) < (0.5 + ?)?. The first three inequalities are the best possible for any selection of the parameters of the rounding function. The conclusion is that, in case of rounding random variables, nothing very uncontrolled can happen with the expected values and standard deviations. The effect of rounding can be assessed in terms of the parameters of the rounding function. The most important is the rounding level ?. In concrete cases, when the distribution of observed random variable is in hand, we expect that the intervals in Theorem are in fact much narrower. For simmetric rounding and in the case of normal distribution with standard deviation equal to the rounding level ? we calculated (numerically, since the exact calculation demands to evaluate an intricate series that cannot be found in standard handbooks like Gradshteyn and Ryzhik (1994)): \E((X)) - E(X)\ < 10_9-times standard deviation . So, even in this case of standard deviation unusually small and/or the rounding extremely rough, the influence of rounding is negligible. Effect of Rounding on Expected Value and Standard Deviation 113 References [1] Everitt, B.S. (2002): The Cambridge Dictionary of Statistics. Cambridge: Cambridge University Press, 2nd edition. [2] Gradshteyn, I.S., Ryzhik, I.M. (1994): Table of Integrals, Series, and Products. Jeffrey, A. (Ed.), San Diego: Academic Press, Inc. (5th edition). [3] Jamnik, R. (1971): Verjetnostni rac¡un. Ljubljana: Mladinska knjiga. [4] Lisman, J.H.C. (1985): Conditional rounding: Letter to the editor. Statistica, XLV, 571-573.