# NAG CL Interfaceg01auc (summary_​onevar_​combine)

Settings help

CL Name Style:

## 1Purpose

g01auc combines sets of summaries produced by g01atc.

## 2Specification

 #include
 void g01auc (Integer b, const double mrcomm[], Integer *pn, double *xmean, double *xsd, double *xskew, double *xkurt, double *xmin, double *xmax, double rcomm[], NagError *fail)
The function may be called by the names: g01auc, nag_stat_summary_onevar_combine or nag_summary_stats_onevar_combine.

## 3Description

Assume a dataset containing $n$ observations, denoted by $x=\left\{{x}_{i}:i=1,2,\dots ,n\right\}$ and a set of weights, $w=\left\{{w}_{i}:i=1,2,\dots ,n\right\}$, has been split into $b$ blocks, and each block summarised via a call to g01atc. Then g01auc takes the $b$ communication arrays returned by g01atc and returns the mean ($\overline{x}$), standard deviation (${s}_{2}$), coefficients of skewness (${s}_{3}$) and kurtosis (${s}_{4}$), and the maximum and minimum values for the whole dataset.
For a definition of $\overline{x},{s}_{2},{s}_{3}$ and ${s}_{4}$ see Section 3 in g01atc.
West D H D (1979) Updating mean and variance estimates: An improved method Comm. ACM 22 532–555

## 5Arguments

1: $\mathbf{b}$Integer Input
On entry: $b$, the number of blocks the full dataset was split into.
Constraint: ${\mathbf{b}}\ge 1$.
2: $\mathbf{mrcomm}\left[20×{\mathbf{b}}\right]$const double Communication Array
Note: where ${\mathbf{MRCOMM}}\left(i,j\right)$ appears in this document, it refers to the array element ${\mathbf{mrcomm}}\left[\left(j-1\right)×20+i-1\right]$.
On entry: the $j$th column of MRCOMM must contain the information returned in rcomm from one of the runs of g01atc.
3: $\mathbf{pn}$Integer * Output
On exit: the number of valid observations, that is the number of observations with ${w}_{i}>0$, for $\mathit{i}=1,2,\dots ,n$.
4: $\mathbf{xmean}$double * Output
On exit: $\overline{x}$, the mean.
5: $\mathbf{xsd}$double * Output
On exit: ${s}_{2}$, the standard deviation.
6: $\mathbf{xskew}$double * Output
On exit: ${s}_{3}$, the coefficient of skewness.
7: $\mathbf{xkurt}$double * Output
On exit: ${s}_{4}$, the coefficient of kurtosis.
8: $\mathbf{xmin}$double * Output
On exit: the smallest value.
9: $\mathbf{xmax}$double * Output
On exit: the largest value.
10: $\mathbf{rcomm}\left[\mathit{dim}\right]$double Communication Array
Note: the dimension, dim, of the array rcomm must be at least
• $20$, when ${\mathbf{rcomm}}\phantom{\rule{0.25em}{0ex}}\text{is not}\phantom{\rule{0.25em}{0ex}}\mathbf{NULL}$.
On exit: an amalgamation of the information held in mrcomm. This is in the same format as rcomm from g01atc.
If rcomm is NULL, rcomm is not referenced.
11: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, argument $⟨\mathit{\text{value}}⟩$ had an illegal value.
NE_CASES_ONE
On exit we were unable to calculate xsd, xskew or xkurt. A value of $0$ has been returned.
NE_CASES_ZERO
On entry, the number of valid observations is zero.
NE_ILLEGAL_COMM
On entry, mrcomm is not in the expected format.
NE_INT
On entry, ${\mathbf{b}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{b}}\ge 1$.
NE_INTERNAL_ERROR
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 for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_ZERO_VARIANCE
On exit we were unable to calculate xskew or xkurt. A value of $0$ has been returned.

Not applicable.

## 8Parallelism and Performance

g01auc is not threaded in any implementation.

The order that the $b$ 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 g01auc and 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.

## 10Example

This example summarises some simulated data. The data is supplied in three blocks, the first consisting of $21$ observations, the second $51$ observations and the last $28$ observations. Summaries are produced for each block of data separately and then an overall summary is produced.

### 10.1Program Text

Program Text (g01auce.c)

### 10.2Program Data

Program Data (g01auce.d)

### 10.3Program Results

Program Results (g01auce.r)
{"ft_lang_label":"__label__en","ft_lang_prob":0.8798473,"math_prob":0.9847336,"size":2008,"snap":"2023-40-2023-50","text_gpt3_token_len":403,"char_repetition_ratio":0.11526946,"word_repetition_ratio":0.054237287,"special_character_ratio":0.18824701,"punctuation_ratio":0.10843374,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.997732,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-05T03:11:12Z\",\"WARC-Record-ID\":\"<urn:uuid:26647ae6-48d6-40b4-aa7a-6d2137144816>\",\"Content-Length\":\"28703\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6377c3d1-ac35-4217-a07a-ff8cd0d55c35>\",\"WARC-Concurrent-To\":\"<urn:uuid:d302034d-7ca2-4add-8d1a-f281763ae50c>\",\"WARC-IP-Address\":\"78.129.168.4\",\"WARC-Target-URI\":\"https://support.nag.com/numeric/nl/nagdoc_28.5/clhtml/g01/g01auc.html\",\"WARC-Payload-Digest\":\"sha1:RRFWMDDUGGFZUV46M2JVFY2QEARSJE3D\",\"WARC-Block-Digest\":\"sha1:VGYEITKYSMVPTSQCJ4KPSXX27YVA77U3\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100540.62_warc_CC-MAIN-20231205010358-20231205040358-00151.warc.gz\"}"}