Difference between revisions of "Average"

 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Array-reducing functions]]
 
[[Category:Array-reducing functions]]
 +
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
  
Returns the mean value of all the elements of array X, averaged over index I.
 
  
= Declaration =
+
== Average(X, I)==
 +
Returns the mean value of all the elements of array «X», averaged over index «I». The full declaration of the function is
 +
:[[Average]](X: Numeric[I]; I: Index)
  
  Average( X : Numeric[I] ; I : Index )
+
<tip title=Note>
 +
The array «X» is evaluated in context. Thus, if you use [[Average]] to sum over the [[Run]] index, you may encounter a potential confusion, since <code>Average(A, I)</code> will be summing the [[Mid]]-value across «I», not the [[sample]].  To sum over the [[Run]] index, use the [[Mean]] function, unless your intention really is to [[Sum]] the mid-value.
 +
</tip>
  
= Notes =
+
==See Also==
 
+
* [[Mid]]()
X is evaluated in context.  Thus, if you use Average to sum over the [[Run]] index, you may encounter a potential confusion, since Average(A,I) will be summing the Mid-value across I, not the sample.  To sum over the Run index, use the [[Mean]] function, unless your intention really is to Sum the mid-value.
+
* [[Mean]]()
 +
* [[Median]]()
 +
* [[Array-reducing functions]]

Latest revision as of 01:46, 27 January 2016


Average(X, I)

Returns the mean value of all the elements of array «X», averaged over index «I». The full declaration of the function is

Average(X: Numeric[I]; I: Index)
Note

The array «X» is evaluated in context. Thus, if you use Average to sum over the Run index, you may encounter a potential confusion, since Average(A, I) will be summing the Mid-value across «I», not the sample. To sum over the Run index, use the Mean function, unless your intention really is to Sum the mid-value.

See Also

Comments


You are not allowed to post comments.