Manuscript Offprint
arXiv:2609.00084Stochastic complexity of vectors containing cluster structure
Abstract
This paper studies the problem of computing the stochastic probability (shortest code length) of the encoded vectors containing cluster structure using Normalized Maximum Likelihood (NML) model. This is of great theoretical and practical importance in data clustering based on Minimum Description Length (MDL) principle, such as for estimating the best number of clusters and best cluster structure for the data. Straightforward computation of the shortest code length of the vector containing cluster structure based on the NML model requires polynomial time with respect to the size of the vector and number of clusters. We show that this is a tractable problem by introducing a recursion formula for the efficient computation of normalizing constant from the NML model. The time complexity of the new formula is linear opposed to previous polynomial time with respect to the size of the vector and number of clusters.
Keywords: minimum description length, normalized maximum likelihood, stochastic complexity, MDL clustering, estimating number of clusters, finding cluster structure.
1 Introduction
The MDL principle for statistical model selection and statistical inference is based on the simple idea that the best way to capture regular features in data is to construct a model in a certain class which permits the shortest description of the data and the model itself [1, 2, 3, 4, 5]. This principle chooses a model such that it trades off between goodness-of-fit on the observed data with “complexity” of the model [6]. Also, the MDL approach fits models to the data and no assumption that the data are a sample from a “true” random variable is needed [3, 5]. This eliminates the difficulty in other approaches to modeling that the more complex model is fitted to the data the better estimate of the data one gets [3, 4]. The MDL principle [1, 3, 5] has been widely used in statistical inference in an asymptotically justified form [7].
Recently, a more efficient form of MDL principle based on the normalized maximum likelihood model, which effects a universal sufficient statistics decomposition to separate noise from the learnable information in data has been found [7]. The NML model provides a better yardstick for comparison of performance of different model classes than other alternative ways of computing the code length, e.g. two-part codes [3, 4, 7]. The stochastic complexity, based on the NML model, is the shortest description length of a given data for a given model class [8].
The scenario we follow is that the encoder and the decoder agree beforehand on the NML model for a specific class of models that is being used to design the codes for encoding the message, e.g. the vector containing the cluster structure. The optimal length of the message is well known in information theory and it can be achieved based on practical coding methods [7]. However, our goal is to compute the code length of the encoded message and not to write down the encoded message. We choose the model which gives the smallest encoded message based on the MDL principle.
Clustering is one of the central concepts in the field of unsupervised data analysis. The problem of finding the cluster structure and number of clusters for the given data, based on the MDL principle, when no information other than the observed values is available is known as MDL clustering and its goal is to partition the data into several non-hierarchical groups of items [9]. The approach of the MDL clustering is based on the idea that a good clustering is such that one can encode the cluster structure together with the data based on the NML models so that the resulting total code length is minimized [9]. The models, representing the different ways of clustering the data, are compared based on the code lengths. The problems of finding the number of clusters and the cluster structure are solved simultaneously by choosing the best model, which gives the shortest code length for the data.
The efficient encoding based on NML model of the vector containing the cluster structure, also called clustering vector throughout this study, is of great importance in the MDL clustering framework. Our previous study [10] introduced an efficient NML model for encoding the clustering vector and a polynomial time method to compute its NML code length. This had been used in our previous work [10, 11] for finding the number of clusters and the cluster structure in gene expression data from microarray experiments. The previously introduced polynomial time method, which is similar to Kontkanen et al. [9], is infeasible for large of even moderate size data sets. In this study, our main goal is to derive a linear time recursive method for the computation of the NML code length of the encoded clustering vector, based on properties of generating functions [12]. The properties of the generating functions have been previously used for finding asymptotic expansions for sums arising in coding theory [13, 14, 12] and for computing the stochastic complexity in the case of multinomial data [8].
In section 2 we introduce introduce the notation and review MDL clustering. The NML model for encoding clustering vector is presented in section 3. The properties of generating function is presented in section 4 and the new recursion formula for computing the NML code length of the encoded clustering vector is derived using a generating function in section 5. Finally, section 6 gives the concluding remarks.
The MDL code length (two part-code) [1, 9] of the encoded data together with the clustering vector considering the model [9] is
where the first term gives the cost of encoding the clustering vector and the last term gives the cost of encoding . In the case that the data contains discrete values one can compute its code length as in [9, 15]. When the data contains no quantized values the approach in [11] can be used for computing .
3 NML model for encoding clustering vector
In the approach of Kontkanen et al. [9] the clustering vector is encoded considering all possible m-ary sequences of length n. We introduced a refinement in the NML model for computing code length of the encoded clustering vector by taking into account more faithfully the number of clustering vectors. This allows us to encode more efficiently the clustering vector using the NML model and to discriminate better between different models.
The NML approach is used for encoding the clustering vector by postulating a simple parametric model . The clustering vector contains in general values of and for the ML estimate of is , where . The probability of the becomes . The NML model is known to be a solution of two minmax problems, which gives it strong optimality properties [4]. The normalized maximum likelihood is
where
(3) is the normalizing constant for the probability and is chosen to include all the possible sequences representing clustering vectors containing exactly clusters and that are unique among them. Two clustering vectors are considered not unique when they describe the same cluster structure, i.e. RAND index=1. The RAND index [16] ranges between 0 and 1 and it is a measure of agreement between alternative data partitions (data clusters).
For instance, one has for and , the following space of 7 unique clustering vectors
(1,2,2,2)
(2,1,2,2)
(2,2,1,2)
(2,2,2,1)
(1,1,2,2)
(1,2,1,2)
(1,2,2,1)
instead of all 14 possible clustering vectors
(1,1,1,2)
(1,1,2,1)
(1,1,2,2)
(1,2,1,1)
(1,2,1,2)
(1,2,2,1)
(1,2,2,2)
(2,1,1,1)
(2,1,1,2)
(2,1,2,1)
(2,1,2,2)
(2,2,1,1)
(2,2,1,2)
(2,2,1,2)
(2,2,2,1)
which are not all unique between them, e.g. the clustering vectors and represent the same way of clustering the data (the first three samples are clustered together and the fourth sample is clustered separately), i.e. RAND Index=1.
One can notice that the normalization constant in (3) for encoding the clustering vector with m unique clusters is [10],
where is the normalizing constant for the NML model for encoding m-ary sequences of length n such that all symbols from the m-alphabet appear at least once in every sequence; includes all possible such m-ary sequences. Thus one has
An efficient way of computing the [10, 12, 9] is as following
where and . The values for and can be pre-computed and tabulated to speed up the computations.
The code length, in bits, of the encoded clustering vector with m clusters based on the NML model is
(7)
For instance, for a clustering vector with clusters (each sample is clustered separately), one has from (7) that , which is what one would expect. In this case no additional information is needed for encoding the clustering vector beside the order of the model. It is enough for the decoder to know that in order to decode the clustering vector. When the method from [9] for is used, one has and the code length of the encoded clustering vector is longer and not so efficient as in (7).
4 Generating Function
The generating functions are a popular analytic tool in establishing recurrence formulas, finding asymptotic expansions, and proving combinatorial identities [12].
The generating function of a sequence is defined [12] as
An useful tree function that generates the sequence is Cayley's tree function [12, 13, 14] where
and one of its basic properties is
Differentiating (9) and multiplying with z yields
where
generates the sequence . From (11) one has
Also, by differentiating (10) one has
By plugging (10) in (14) one has
Also, by plugging (15) in (11) one has
and
To show the connection between and we compute , which yields
where the last equality follows from (6) for m = 2. Therefore it is straightforward to prove this to
which generates the sequence . Thus our generating function of interest is .
Plugging (17) in (19) yields
5 Recursion formula
Based on (20), let define a special tree function
Differentiating the right-hand term of (21) and multiplying with z, one has
Also, differentiating the left-hand term of (21) and multiplying with z, one has
Comparing the coefficients of in (22) and (23), one has
(24)
and it yields
which holds for . For recursively computing (25) one needs to know and which are straightforward to compute using (5). Therefore one has
and
The computation of starts with and and then are computed using the recursion formula (25). The plot of the normalizing constant computed using the recursion formula (25) is represented in Figure 1. It can be seen that the maximum of is achieved for for a given .

Figure 1: The NML normalizing constant that includes all possible m-ary sequences of length n and all symbols from the m-alphabet appear at least once in every sequence, where n = 100000 and m = 1 ... n.
From (4), (26), (27), and (25) one has the recursion formula for normalizing constant as follows,
which holds for 1 < m < n - 1, where
and
The computation of starts with and using (29) and (30), and then are computed using the recursion formula (28). The plot of the normalizing constant computed using the recursion formula (28) is represented in Figure 2. The whole computation has a linear time complexity which is a major improvement compared to the previous method [10].

Figure 2: The NML normalizing constant that includes all possible clustering vectors of length with unique clusters, where and .
6 Concluding remarks
The efficient encoding based on NML model of the encoded vector containing the cluster structure and efficient computation of its NML code length are of great importance in the MDL clustering framework. In this study we introduced a linear time complexity method for fast computation of the NML code length of the encoded vector containing cluster structure. The previous method has a polynomial time complexity with respect of the size and numbers of clusters in the vector. The newly introduced method is based on a recursion formula for efficient computation of normalizing constant from the NML model for clustering vectors.
References
[1] J. Rissanen, “Modelling by the shortest data description,” Automatica, vol. 14, pp. 465–471, 1978.
[2] J. Rissanen, “A universal prior for integers and estimation by minimum description length,” Annals of Statistics, vol. 11, no. 2, pp. 416–431, 1983.
[3] J. Rissanen, “MDL denoising,” IEEE Transactions on Information Theory, vol. 46, no. 7, pp. 2537–2543, 2000.
[4] J. Rissanen, “Strong optimality of the normalized ML models as universal codes and information in data,” IEEE Transactions on Information Theory, vol. 47, no. 5, pp. 1712–1717, 2001.
[5] J. Rissanen, “Complexity and information in modeling,” in Computability, Complexity and Constructivity in Economic Analysis, V. Velupillai, Ed. Blackwell Publications, Oxford, 2005.
[6] P. Grünwald, “Minimum description length principle tutorial,” in Advances in Minimum Description Length: Theory and Applications, P. Grünwald, I.J. Myung, and M. Pitt, Eds., pp. 22–79. MIT Press, Cambridge, 2005.
[7] I. Tābuš, J. Rissanen, and J. Astola, “Classification and feature gene selection using the normalized maximum likelihood model for discrete regression,” Signal Processing, Special Issue on Genomic Signal Processing, vol. 83, no. 4, pp. 713–727, 2003.
[8] P. Kontkanen and P. Myllymäki, “Analyzing the stochastic complexity via tree polynomials,” in Technical Report HIIT-2005-4, Helsinki, Finland, 2005, The Helsinki Institute for Information Technology.
[9] P. Kontkanen, P. Myllymäki, W. Buntine, J. Rissanen, and H. Tirri, "An MDL framework for data clustering," in Advances in Minimum Description Length: Theory and Applications, P. Grünwald, I.J. Myung, and M. Pitt, Eds., pp. 323–353. MIT Press, Cambridge, 2005.
[10] D. Nicorici, J. Astola, and O. Yli-Harja, "Estimating the number of clusters in microarray data sets based on an information theoretic criterion," in IEEE Workshop on Statistical Signal Processing (SSP'05), Bordeaux, France, July 17–20, 2005.
[11] D. Nicorici, O. Yli-Harja, and J. Astola, "Cluster structure inference for microarray data based on an information theoretic criterion," in IEEE International Workshop on Genomic Signal Processing and Statistics (GENSIPS'06), College Station, Texas, USA, May 28–30, 2006.
[12] W. Szpankowski, Average Case Analysis of Algorithms on Sequences, John Wiley & Sons, New York, USA, 2001.
[13] W. Szpankowski, "On asymptotics of certain sums arising in coding theory," IEEE Transactions on Information Theory, vol. 41, no. 6, pp. 2087–2090, February 1995.
[14] W. Szpankowski, "On asymptotics of certain recurrences arising in universal coding," Problems of Information Transmission, vol. 34, no. 2, pp. 55–61, February 1998.
[15] D. Nicorici, O. Yli-Harja, and J. Astola, "Cluster-structure inference for microarray data via MDL principle," in IEEE International Workshop on Genomic Signal Processing and Statistics (GENSIPS'05), Newport, Rhode Island, USA, May 22–24 2005.
[16] L. Hubert and P. Arabie, "Comparing partitions," Journal of Classification, vol. 2, pp. 193–218, 1985.