Select the mode in which the column has to be sign reversed. Below is an heuristic algorithm but a fully rational choice is hard to come by. Maximal number of sign reversals = p+q+r-2, but this number can be much smaller. Sign reverse a component, determine which if any of p, q and r is available for reversal. If one of them is wholly positieve way never choose it, else if one is wholly negative choose that one from A, B, C respectively; else if there is a component with a largest absolute value which is negative choose that one, or the one from A,B,C in that order; else choose the column of the longest mode; end if FreeA, FreeB, FreeC = 0 component is not available; = 1 component is available.
selmod(aptr, bptr, cptr, posptrA, negptrA, bigptrA, posptrB, negptrB, bigptrB,
posptrC, negptrC, bigptrC, IA, IB, IC, I, J, K, p, q, r, longest)
The flag variable to indicate if one of the components has to be sign reversed.
Select the mode (1, 2 or 3) in which the column has to be sign reversed.
The pointer to the columns of the component matrices (A, B or C)
that are responsible for the value in the ordered core array.
The pointer to the first component matrix.
The pointer to the second component matrix.
The pointer to the third component matrix.
The pointer to the positive component of the first component matrix.
The pointer to the negative component of the first component matrix.
The pointer to the biggest component (a larger negative positive value than a positive one) of the first component matrix.
The pointer to the positive component of the first component matrix.
The pointer to the negative component of the second component matrix.
The pointer to the biggest component (a larger negative positive value than a positive one) of the second component matrix.
The pointer to the positive component of the third component matrix.
The pointer to the negative component of the third component matrix.
The pointer to the biggest component (a larger negative positive value than a positive one) of the third component matrix.
The pointer to the columns of the first component matrix, given the pointer to an element in core.
The pointer to the columns of the second component matrix, given the pointer to an element in core.
The pointer to the columns of the third component matrix, given the pointer to an element in core.
The row number of the three-way contingency table.
The column number of the three-way contingency table.
The tube number of the three-way contingency table.
The dimension number of the first mode.
The dimension number of the second mode.
The dimension number of the third mode.
The component matrix of the longest mode to change sign (when no special reason for selection could be found).
Rosaria Lombardo and Pieter M Kroonenberg.
Kroonenberg PM (1994) The TUCKALS line: a suite of programs for three-way data analysis. Computational Statistics and Data Analysis, 18, 73--96.