|
NAG[g03ehc] NAG[nag_mv_dendrogram] - Construct dendogram following g03ecc (nag_mv_hierar_cluster_analysis)
|
|
Calling Sequence
g03ehc(orient, dord, dmin, dstep, nsym, c, 'n'=n, 'fail'=fail)
nag_mv_dendrogram(. . .)
Parameters
|
orient - String;
|
|
|
On entry: indicates which orientation the dendrogram is to take.
|
|
The end-points of the dendrogram are to the north.
|
|
The end-points of the dendrogram are to the south.
|
|
The end-points of the dendrogram are to the east.
|
|
The end-points of the dendrogram are to the west.
|
|
Constraint: "Nag_DendNorth", "Nag_DendSouth", "Nag_DendEast" or "Nag_DendWest". .
|
|
|
dord - Vector(1..n, datatype=float[8]);
|
|
|
Constraint: , for . .
|
|
|
dmin - float;
|
|
|
On entry: the clustering distance at which the dendrogram begins.
|
|
Constraint: . .
|
|
|
dstep - float;
|
|
|
On entry: the distance represented by one symbol of the dendrogram.
|
|
Constraint: . .
|
|
|
nsym - integer;
|
|
|
On entry: the number of character positions used in the dendrogram. Hence the clustering distance at which the dendrogram terminates is given by .
|
|
Constraint: . .
|
|
|
c - assignable;
|
|
|
Note: On exit the variable c will have a value of type character.
|
|
On entry/exit: a pointer to an array of character pointers, containing consecutive lines of the dendrogram. The memory to which c points is allocated internally.
|
|
"Nag_DendNorth" or "Nag_DendSouth" The number of lines in the dendrogram is nsym.
|
|
"Nag_DendEast" or "Nag_DendWest" The number of lines in the dendrogram is n.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the array dord.
|
|
On entry: the number of objects in the cluster analysis.
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Description
|
|
Hierarchical cluster analysis, as performed by g03ecc (nag_mv_hierar_cluster_analysis) can be represented by a tree that shows at which distance the clusters merge. Such a tree is known as a dendrogram. See Everitt (1974) and Krzanowski (1990) for examples of dendrograms. A simple example is,
Figure 1
The end-points of the dendrogram represent the objects that have been clustered. They should be in a suitable order as given by g03ecc (nag_mv_hierar_cluster_analysis). Object 1 is always the first object. In the example above the height represents the distance at which the clusters merge.
The dendrogram is produced in an array of character pointers using the ordering and distances provided by g03ecc (nag_mv_hierar_cluster_analysis). Suitable characters are used to represent parts of the tree.
There are four possible orientations for the dendrogram. The example above has the end-points at the bottom of the diagram which will be referred to as south. If the dendrogram was the other way around with the end-points at the top of the diagram then the orientation would be north. If the end-points are at the left-hand or right-hand side of the diagram the orientation is west or east. Different symbols are used for east/west and north/south orientations.
|
|
Error Indicators and Warnings
|
|
"NE_BAD_PARAM"
On entry, argument orient had an illegal value.
"NE_DENDROGRAM_ARRAY"
On entry, , . Constraint: , .
"NE_INT_ARG_LT"
On entry, n must not be less than 2: .
"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 consult NAG for assistance.
"NE_REAL_ARG_LE"
On entry, dstep must not be less than or equal to 0.0: .
"NE_REAL_ARG_LT"
On entry, dmin must not be less than 0.0: .
|
|
Further Comments
|
|
The scale of the dendrogram is controlled by dstep. The smaller the value of dstep the greater the amount of detail that will be given. However, nsym will have to be larger to give the full dendrogram. The range of distances represented by the dendrogram is dmin to . The values of dmin, dstep and nsym can thus be set so that only part of the dendrogram is produced.
The dendrogram does not include any labelling of the objects. The user can print suitable labels using the ordering given by the array iord returned by g03ecc (nag_mv_hierar_cluster_analysis).
|
|
|
Examples
|
|
>
|
n := 5:
dord := Vector([1, 36.25, 8, 4, 36.25], datatype=float[8]):
orient := "Nag_DendEast":
dmin := 0:
dstep := 1.1:
nsym := 40:
NAG:-g03ehc(orient, dord, dmin, dstep, nsym, c, 'n' = n):
for i from 1 to LinearAlgebra[Dimension](c) do
printf("%s\n",c[i]): end do:
orient := "Nag_DendSouth":
dmin := 0:
dstep := 1.0:
nsym := 40:
NAG:-g03ehc(orient, dord, dmin, dstep, nsym, c, 'n' = n):
for i from 1 to LinearAlgebra[Dimension](c) do
printf("%s\n",c[i]): end do:
|
...............................(
( .......
( ( ...
(........................(...(...
----------
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I ------*
I I I
I I I
I I I
I I ---*
I I I I
I I I I
---* I I I
I I I I I
|
|