Next: Example: simulation program Up: GRASP Routines: Stochastic background Previous: Function: prelim_stats()   Contents

## Function: statistics()

0

void statistics(float *input, int n, int num_bins)
This function calculates and displays the mean value, standard deviation, signal-to-noise ratio, and confidence intervals for an input array of (assumed) statistically independent measurements of a random variable . This function also write output data to two files: histogram.dat and gaussian.dat. The first file contains a histogram of the input data ; the second file contains the Gaussian probability distribution that best matches this histogram. (See Sec.  for more details.)

The arguments of statistics() are:

input: Input. input[0..n-1] is an array of floating point variables containing the values of a set of (assumed) statistically independent measurements of a random variable .
n: Input. The length of the input data array. If , statistics() prints out an error message and aborts execution.
num_bins: Input. The number of bins to be used when constructing a histogram of the input data .

statistics() calculates and displays the mean value and standard deviation of the input data . It also calculates and displays the signal-to-noise ratio and 68%, 90%, and 95% confidence intervals for the input data, assuming that the are statistically independent measurements of a random variable . statistics() also writes output data to two files:

(i)
histogram.dat is a two-column file of floating point numbers containing a histogram of the input data . The length of each column of data is equal to num_bins, and the histogram is normalized so that it has unit area.
(ii)
gaussian.dat is a two-column file of floating point numbers containing the Gaussian probability distribution function that best matches the histogram of the input data . Each column of gaussian.dat has a length equal to 8192. There are also three markers included in the Gaussian probability distribution data: One marker for the mean, and two for the one standard deviation values of .
Authors: Bruce Allen, ballen@dirac.phys.uwm.edu, and Joseph Romano, romano@csd.uwm.edu
Comments: In the context of the stochastic background routines, statistics() is used to perform a statistical analysis of the cross-correlation signal values calculated by the function analyze().

Next: Example: simulation program Up: GRASP Routines: Stochastic background Previous: Function: prelim_stats()   Contents
Bruce Allen 2000-11-19