next up previous contents
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 $x_i$ of a random variable $x$. This function also write output data to two files: histogram.dat and gaussian.dat. The first file contains a histogram of the input data $x_i$; 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 $x_i$ of a random variable $x$.
n: Input. The length $N$ of the input data array. If $N<2$, 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 $x_i$.

statistics() calculates and displays the mean value and standard deviation of the input data $x_i$. It also calculates and displays the signal-to-noise ratio and 68%, 90%, and 95% confidence intervals for the input data, assuming that the $x_i$ are statistically independent measurements of a random variable $x$. 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 $x_i$. 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 $x_i$. 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 $x$.
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 $S_i$ calculated by the function analyze().


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