NAG Library Function Document
nag_summary_stats_onevar_combine (g01auc) combines sets of summaries produced by nag_summary_stats_onevar (g01atc)
||nag_summary_stats_onevar_combine (Integer b,
const double mrcomm,
Assume a dataset containing
observations, denoted by
and a set of weights,
, has been split into
blocks, and each block summarised via a call to nag_summary_stats_onevar (g01atc)
. Then nag_summary_stats_onevar_combine (g01auc) takes the
communication arrays returned by nag_summary_stats_onevar (g01atc)
and returns the mean (
), standard deviation (
), coefficients of skewness (
) and kurtosis (
), and the maximum and minimum values for the whole dataset.
For a definition of
see Section 3
in nag_summary_stats_onevar (g01atc).
West D H D (1979) Updating mean and variance estimates: An improved method Comm. ACM 22 532–555
b – IntegerInput
On entry: , the number of blocks the full dataset was split into.
mrcomm – const doubleCommunication Array
Note: where appears in this document, it refers to the array element
th column of MRCOMM
must contain the information returned in rcomm
from one of the runs of nag_summary_stats_onevar (g01atc)
pn – Integer *Output
On exit: the number of valid observations, that is the number of observations with
, for .
xmean – double *Output
On exit: , the mean.
xsd – double *Output
On exit: , the standard deviation.
xskew – double *Output
On exit: , the coefficient of skewness.
xkurt – double *Output
On exit: , the coefficient of kurtosis.
xmin – double *Output
On exit: the smallest value.
xmax – double *Output
On exit: the largest value.
rcomm – doubleCommunication Array
: an amalgamation of the information held in mrcomm
. This is in the same format as rcomm
from nag_summary_stats_onevar (g01atc)
is not referenced.
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, argument had an illegal value.
On exit we were unable to calculate xsd
. A value of
has been returned.
On entry, the number of valid observations is zero.
On entry, mrcomm
is not in the expected format.
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG
On exit we were unable to calculate xskew
. A value of
has been returned.
8 Parallelism and Performance
The order that the
communication arrays are stored in mrcomm
is arbitrary. Different orders can lead to slightly different results due to numerical accuracy of floating-point calculations.
Both nag_summary_stats_onevar_combine (g01auc) and nag_summary_stats_onevar (g01atc)
consolidate results from multiple summaries. Whereas the former can only be used to combine summaries calculated sequentially, the latter combines summaries calculated in an arbitrary order allowing, for example, summaries calculated on different processing units to be combined.
This example summarises some simulated data. The data is supplied in three blocks, the first consisting of observations, the second observations and the last observations. Summaries are produced for each block of data separately and then an overall summary is produced.
10.1 Program Text
Program Text (g01auce.c)
10.2 Program Data
Program Data (g01auce.d)
10.3 Program Results
Program Results (g01auce.r)