TUdataStat TCL UTILITIES USER MANUAL TUdataStat
SYNOPSIS
Return the average value and varience of an array of numbers.
PACKAGE
TCLUTILS
NAME
TUdataStat
USAGE
set rV  [TUdataStat  D nE {Skip} {Off}]
INPUT DEFINITIONS
D - Input data array
nE - The number elements to process. The last data array element processed is (nE - 1) * Skip + Off.
Skip - Optional increment value to use when getting the next value in the data array. Default is 1.
Off - Optional offset into the data array. Processing starts at this element. Default is 0.
RETURN DEFINITION
rV - List containing the average and varience of the input data array.
DESCRIPTION
TUdataStat determines the average value and the varience from that average value of the imput data array.

ERRORS
None Generated
C BACKING
Yes
EXAMPLE(S)
# FIND the average and varience in a random data set.
#
# FORM a random data set positive and negative numbers from -1 to 1

TUdataRnd1 V 1000 PN

# DETERMINE the average and varience in the dataset

set rV [TUdataStat V 1000 ] 

# PRINT results

puts stderr "AVERAGE VALUE : [format "%.3f" [lindex $rV 0]]"
puts stderr "VARIENCE      : [format "%.3f" [lindex $rV 1]]"

AVERAGE VALUE : 0.014
VARIENCE      : 0.345

      
Sept 19, 2006