## 3 Grade Data Analysis
discrete distribution too, and it is possible to calculate Spearman \(\rho^{*}\) for the probability table \(P\) with m rows and \(k\) columns, where \(p_{ls}\) is the probability of \(i\)-th row in \(s\)-th column:  
\[\rho^{*}(P)=3\sum_{i=1}^{m}\sum_{s=0}^{k}\Bigl{(}p_{ls}\Bigl{(}2S_{row(i)}-1 \Bigr{)}\Bigl{(}2S_{col(s)}-1\Bigr{)}\Bigr{)}, \tag{1}\]  
where  
\[S_{row(i)}=\left(\sum_{j=1}^{i-1}p_{j+}\right)+\frac{1}{2}p_{i+},\ \ S_{col(s)}= \left(\sum_{t=1}^{s-1}p_{+t}\right)+\frac{1}{2}p_{+s} \tag{2}\]  
and \(p_{j+}\) and \(p_{+t}\) are marginal sums defined as: \(p_{j+}=\sum_{s=1}^{k}p_{js},\ p_{+t}=\sum_{t=1}^{m}p_{ls}\). GCA is supposed to maximize \(\rho^{*}\) by ordering the columns and the rows taking into account their grade regression value, which represents the gravity center for each column or each row. The grade regression for the rows is defined as:  
\[regr_{row(i)}=\frac{\sum_{s=1}^{k}p_{is}S_{col(s)}}{p_{i+}} \tag{3}\]  
and, similarly, for the columns:  
\[regr_{col(s)}=\frac{\sum_{i=1}^{m}p_{is}S_{row(i)}}{p_{+s}}. \tag{4}\]  
The idea behind the algorithm is to measure the grade regression for columns and to sort the columns by its values, which results in an increase of the regression for columns. At the same time, the regression for rows changes as well. Similarly, if the regression for rows is sorted then regression for columns changes. As evidenced in [23], each sorting iteration with respect to grade regression values, in fact, increases the value of Spearman \(\rho^{*}\). The number of possible combinations with rows and columns permutations is finite and it is equal to k!m!. With the increasing value of Spearman \(\rho^{*}\), the last sorting iteration produces the largest \(\rho^{*}\), called local maximum of Spearman \(\rho^{*}\). In consecutive steps, GCA randomly permutes rows and columns and reorders them so local maximum can be achieved. In practical application, when the data volume and dimension is huge, the search over the all possible combinations of rows and columns is a computationally demanding and long-lasting process. Therefore, in order to find a global maximum of \(\rho^{*}\), Monte Carlo simulations are used. To achieve it, the algorithm is iteratively searching for such a representation where \(\rho^{*}\) reaches local maximum, starting from randomly ordered rows and columns. From the whole set of local maxima, the highest value of \(\rho^{*}\) is chosen and it is assumed to be close to the global maximum, which usually happens after 100 iterations of the algorithm. Importantly, the calculation of grade regression requires non-zero sum for each and every row and column in a table, so this requirement is applicable also to the GCA. A more detailed description on grade transformation mechanics can be found in [22; 24]. As far as grade cluster analysis (GCCA) is concerned, its framework is based on optimal permutations provided by the GCA. The following assumptions are associated with the cluster analysis: the number of clusters is provided, and the rows and columns of the data table (variables, say X and Y) are optimally aggregated. The respective, aggregated probabilities in the table for cluster analysis, are derived from the sums of component probabilities which are found in initial, optimally ordered table, and number of rows in the aggregated table equals the specified number of clusters. The optimal clustering is supposed to be achieved when \(\rho^{*}\)(X, Y) is maximal in the set of aggregated rows and/or columns, which are adjacent in optimal permutations. The rows and the columns may be combined either separately-by maximizing \(\rho^{*}\) for aggregated X and non-aggregated Y, or for non-aggregated X and aggregated Y, or simultaneously. Details of the maximization procedure can be found in [23]. Finally, the grade analysis is highly supported by visualizations using over-representation maps.