DIRECTORY IO, Histograms, LinearSystem; HistogramsOut: CEDAR DEFINITIONS = {OPEN Histograms; Stats1D: PROC [h: Histogram] RETURNS [sum0: INT, sum1, sum2, avg, stdDev: REAL, range: RealRange1]; Stats2D: PROC [h: Histogram, degree: NATURAL, log: BoolPair] RETURNS [sums: Sums2D, range: RealRange2]; Sums2D: TYPE ~ RECORD [ degree: NATURAL _ 0, exception: BOOL _ FALSE, Sy2: REAL _ 0.0, Sxky: ColumnN _ NIL, Sxkl: MatrixN _ NIL ]; RowN: TYPE ~ LinearSystem.RowN; ColumnN: TYPE ~ LinearSystem.ColumnN; MatrixN: TYPE ~ LinearSystem.MatrixN; Analyze: PROC [sums: Sums2D] RETURNS [ak: ColumnN _ NIL, s, r: REAL _ 0.0]; EvalError: PROC [sums: Sums2D, ak: ColumnN] RETURNS [s, r: REAL _ 0.0]; WriteTo: PROC [h: Histogram, to: IO.STREAM, create, data: BOOL]; }. THistogramsOut.Mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Last tweaked by Mike Spreitzer on June 28, 1988 3:36:10 pm PDT An interface for getting information out of Histograms. Consider the histogram a set of pairs, each saying that there are n counts in the bin centered on x. sum0 = S n sum1 = S n*x sum2 = S n*x2 avg = sum1/sum0 stdDev = SqRt[( S n*(x - avg)2 ) / ((Sn) - 1)] range.min = least x with non-zero n range.max = greatest x with non-zero n range.min>range.max W sum0=0 Returns the sums necessary to compute a least-squares fit of the given degree. The log argument tells whether to sum the or their natural logarithms. If exception, there's been a floating-point exception, and the other fields are worthless. Do a least-squares fit of the sums. The coefficients are in ak, error is s, and linear correlation is r. If there's a floating-point exception, ak will be NIL. s non-zero only if the number of samples exceeds the degree. In certain degenerate cases, r will not be evaluated, and left 0. Writes descriptions of the create and/or the data. Κ/˜codešœ™Kšœ Οmœ1™—K˜K™7K˜KšΟk œžœ˜'K˜KšΡbnx œžœž œžœ ˜4K˜š Οnœžœžœžœžœ˜cK™kKšœΟgœ™ Kšœ‘œ™ Kšœ‘œΟu™ K™Kšœ‘œ ’œ‘œ™.K™#K™&Kšœœ™K˜—š œžœžœžœ#˜gKšœTΟeœE™œ—K˜šœžœžœ˜Kšœžœ˜Kšœ žœžœ˜KšΠgn Πnuœžœ˜Kš€ ₯ œ žœ˜Kš€ ₯œ ž˜Kšœ˜Kšœ£ œN™Z—K˜Kšœžœ˜Kšœ žœ˜%Kšœ žœ˜%K˜š œžœžœΟdœ žœ‘œ‘œžœ˜KKš œ>¦œ ‘œ‘œ+¦œ‘œZ‘œ#™’—K˜Kš  œžœ¦œ žœ‘œ‘œžœ˜GK˜š  œžœžœžœžœ˜@K™2—K˜Kšœ˜K˜—…—ώ 