NAG CL Interface
g02jgc (lmm_​init_​combine)

1 Purpose

g02jgc combines output from multiple calls to g02jfc or g02jcc.

2 Specification

#include <nag.h>
void  g02jgc (void *hlmm, double xrcomm[], Integer xlrcomm, Integer xicomm[], Integer xlicomm, const double yrcomm[], const Integer yicomm[], NagError *fail)
The function may be called by the names: g02jgc or nag_correg_lmm_init_combine.

3 Description

Let Dx and Dy denote two sets of data, each with m variables and nx and ny observations respectively. Let Cx and Cy denote two sets of communication arrays constructed by g02jfc or g02jcc from datasets Dx and Dy respectively. Then, given Cx and Cy, g02jgc constructs a set of communication arrays, Cw, as if a dataset Dz, with m variables and nx+ny observations were supplied to g02jfc or g02jcc, with Dz constructed as
Dz = Dx Dy .  
Splitting, and then recombining, the data in this manner allows for datasets with an arbitrarily large number of observations (n) to be analysed and the preprocessing routines, g02jfc or g02jcc, to be run in parallel.
It should be noted that, while the information in Cz, should be consistent with the information in the communication arrays obtained by supplying Dz to g02jfc or g02jcc, the ordering of that information may change. In practice, this means that whilst an analysis run using a set of communication arrays constructed using g02jgc should give similar results to an analysis run using a set of communication arrays constructed directly from g02jfc or g02jcc they will not necessarily be identical. In addition, the order of the parameter estimates, ν and β may differ.

4 References

None.

5 Arguments

1: hlmm void * Input
On entry: if the two sets of communication arrays were generated using g02jfc, then a G22 handle as generated by one of the calls to g02jfc.
If the two sets of communication arrays were generated using g02jcc, then this argument is not referenced and need not be set.
2: xrcomm[xlrcomm] double Communication Array
On entry: communication array as returned by g02jfc or g02jcc for the dataset, Dx.
On exit: communication array for the combined dataset, DW.
3: xlrcomm Integer Input
On entry: the dimension of the array xrcomm. Ideally this should be large enough to hold the information for the combined dataset Dw.
If xlicomm or xlrcomm are not large enough to hold the information for the combined dataset then fail.code= NW_ARRAY_SIZE is returned and the minimum size for xicomm is returned in xicomm[0] and the minimum size for xrcomm in xicomm[1]. In this case xicomm and xrcomm must be reallocated to these new sizes, preserving their contents, for example by allocating two new arrays and copying the old values across, and the function called again.
4: xicomm[xlicomm] Integer Communication Array
On entry: communication array as returned by g02jfc or g02jcc for the dataset, Dx.
On exit: communication array for the combined dataset, Dz.
5: xlicomm Integer Input
On entry: the dimension of the array xicomm. Ideally this should be large enough to hold the information for the combined dataset Dw.
If xlicomm or xlrcomm are not large enough to hold the information for the combined dataset then fail.code= NW_ARRAY_SIZE is returned and the minimum size for xicomm is returned in xicomm[0] and the minimum size for xrcomm in xicomm[1]. In this case xicomm and xrcomm must be reallocated to these new sizes, preserving their contents, for example by allocating two new arrays and copying the old values across, and the function called again.
6: yrcomm[dim] const double Communication Array
On entry: communication array as returned by g02jfc or g02jcc for the dataset, Dy.
7: yicomm[dim] const Integer Communication Array
On entry: communication array as returned by g02jfc or g02jcc for the dataset, Dy.
8: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error 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.
NE_ARRAY_SIZE
On entry, xlicomm=value and xlrcomm=value
Constraint: xlicommvalue and xlrcommvalue.
The communication arrays must be large enough to hold the information for the combined dataset Dw. In addition, xlicomm<2 and so the minimum sizes cannot be returned.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_HANDLE
hlmm has not been initialized or is corrupt.
hlmm is not a G22 handle as generated by g02jfc.
NE_ILLEGAL_COMM
On entry, xicomm has not been initialized correctly.
On entry, yicomm has not been initialized correctly.
NE_INCOMPAT_PARAM
On entry, the information stored in xicomm and yicomm is not compatible.
Check that the same model was used when generating xicomm and yicomm.
On entry, xlicomm=value and k=value.
Constraint: xlicomm is not compatible with information stored in xicomm, was expecting xlicommk.
On entry, xlrcomm=value and k=value.
Constraint: xlrcomm is not compatible with information stored in xicomm, was expecting xlrcommk.
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.
NW_ARRAY_SIZE
On entry, xlicomm=value and xlrcomm=value
Constraint: xlicommvalue and xlrcommvalue.
The communication arrays must be large enough to hold the information for the combined dataset Dw. The minimum size for xicomm is returned in xicomm[0] and the minimum size for xrcomm in xicomm[1]. The parameters xicomm and xrcomm must be reallocated to these new sizes, preserving their contents, and the function called again.

7 Accuracy

Not applicable.

8 Parallelism and Performance

g02jgc is not threaded in any implementation.

9 Further Comments

The data preprocessing routines, g02jcc and g02jfc return the quantities, fnlsv, nff, rnlsv, nrf and nvpr. These values are data dependent and therefore the values obtained when preprocessing the datasets, Dx and Dy are likely to be different to those obtained if you had preprocessed the combined dataset Dz. In order to obtain these values for Dz you can call g02zlc after the call to g02jgc. Valid values for optstr are:

10 Example

This example fits a random effects model to a simulated dataset. The dataset is split into four blocks, with 10,31, 40 and 9 observations respectively. Each block is read in, processed by g02jfc and then combined using g02jgc. Once all four blocks have been processed the model is fitted using g02jhc and the results are printed.

10.1 Program Text

Program Text (g02jgce.c)

10.2 Program Data

Program Data (g02jgce.d)

10.3 Program Results

Program Results (g02jgce.r)