muHVT: Collection of functions used for vector quantization and construction of hierarchical Voronoi Tessellations for data analysis in R

Sangeet Moy Das, Zubin Dowlaty, Meet Dave, Avinash Joshi

2020-08-04

1 Abstract

The muHVT package is a collection of R functions for vector quantization and construction of hierarchical voronoi tessellations as a data visualization tool to visualize cells using quantization. The hierarchical cells are computed using Hierarchical K-means where a quantization threshold governs the levels in the hierarchy for a set \(k\) parameter (the maximum number of cells at each level). The package is particularly helpful to visualize rich mutlivariate data.

This package additionally provides functions for computing the Sammon’s projection and plotting the heat map of the variables on the tiles of the tessellations.

2 Vector Quantization

This package performs vector quantization using the following algorithm -

2.1 Hierarchical VQ using k-means

2.1.1 k-means

  1. The k-means algorithm randomly selects k data points as initial means
  2. k clusters are formed by assigning each data point to its closest cluster mean using the Euclidean distance
  3. Virtual means for each cluster are calculated by using all datapoints contained in a cluster

The second and third steps are iterated until a predefined number of iterations is reached or the clusters converge. The runtime for the algorithm is O(n).

2.1.2 Hierarchical VQ using k-means

The algorithm divides the dataset recursively into cells. The \(k-means\) algorithm is used by setting \(k\) to, say two, in order to divide the dataset into two subsets. These two subsets are further divided into two subsets by setting \(k\) to two, resulting in a total of four subsets. The recursion terminates when the cells either contain a single data point or a stop criterion is reached. In this case, the stop criterion is set to when the cell error exceeds the quantization threshold.

The steps for this method are as follows :

  1. Select k(number of cells), depth and quantization error threshold
  2. Perform k-means on the input dataset
  3. Calculate quantization error for each of the k cells
  4. Compare the quantization error for each cell to quantization error threshold
  5. Repeat steps 2 to 4 for each of the k cells whose quantization error is above threshold until stop criterion is reached.

The stop criterion is when the quantization error of a cell satisfies one of the below conditions

  • reaches below quantization error threshold
  • there is a single point in the cell
  • the user specified depth has been attained

The quantization error for a cell is defined as follows :

\[QE = \max_i(||A-F_i||_{p})\]

where

  • \(A\) is the centroid of the cell
  • \(F_i\) represents a data point in the cell
  • \(m\) is the number of points in the cell
  • \(p\) is the \(p\)-norm metric. Here \(p\) = 1 represents L1 Norm and \(p\) = 2 represents L2 Norm.

2.1.3 Quantization Error

Let us try to understand quantization error with an example.

Figure 1: The Voronoi tessellation for level 1 shown for the 5 cells with the points overlayed

Figure 1: The Voronoi tessellation for level 1 shown for the 5 cells with the points overlayed

An example of a 2 dimensional VQ is shown above.

In the above image, we can see 5 cells with each cell containing a certain number of points. The centroid for each cell is shown in blue. These centroids are also known as codewords since they represent all the points in that cell. The set of all codewords is called a codebook.

Now we want to calculate quantization error for each cell. For the sake of simplicity, let’s consider only one cell having centroid A and m data points \(F_i\) for calculating quantization error.

For each point, we calculate the distance between the point and the centroid.

\[ d = ||A - F_i||_{p} \]

In the above equation, p = 1 means L1_Norm distance whereas p = 2 means L2_Norm distance. In the package, the L1_Norm distance is chosen by default. The user can pass either L1_Norm, L2_Norm or a custom function to calculate the distance between two points in n dimensions.

\[QE = \max_i(||A-F_i||_{p})\]

Now, we take the maximum calculated distance of all m points. This gives us the furthest distance of a point in the cell from the centroid, which we refer to as Quantization Error. If the Quantization Error is higher than the given threshold, the centroid/codevector is not a good representation for the points in the cell. Now we can perform further Vector Quantization on these points and repeat the above steps.

Please note that the user can select mean, max or any custom function to calculate the Quantization Error. The custom function takes a vector of m value (where each value is a distance between point in n dimensions and centroids) and returns a single value which is the Quantization Error for the cell.

If we select mean as the error metric, the above Quantization Error equation will look like this :

\[QE = \frac{1}{m}\sum_{i=1}^m||A-F_i||_{p}\]

3 Voronoi Tessellations

A Voronoi diagram is a way of dividing space into a number of regions. A set of points (called seeds, sites, or generators) is specified beforehand and for each seed, there will be a corresponding region consisting of all points within proximity of that seed. These regions are called Voronoi cells. It is complementary to Delaunay triangulation.

3.1 Sammon’s projection

Sammon’s projection is an algorithm that maps a high-dimensional space to a space of lower dimensionality while attempting to preserve the structure of inter-point distances in the projection. It is particularly suited for use in exploratory data analysis and is usually considered a non-linear approach since the mapping cannot be represented as a linear combination of the original variables. The centroids are plotted in 2D after performing Sammon’s projection at every level of the tessellation.

Denoting the distance between \(i^{th}\) and \(j^{th}\) objects in the original space by \(d_{ij}^*\), and the distance between their projections by \(d_{ij}\). Sammon’s mapping aims to minimize the below error function, which is often referred to as Sammon’s stress or Sammon’s error

\[E=\frac{1}{\sum_{i<j} d_{ij}^*}\sum_{i<j}\frac{(d_{ij}^*-d_{ij})^2}{d_{ij}^*}\]

The minimization of this can be performed either by gradient descent, as proposed initially, or by other means, usually involving iterative methods. The number of iterations need to be experimentally determined and convergent solutions are not always guaranteed. Many implementations prefer to use the first Principal Components as a starting configuration.

3.2 Constructing Voronoi Tesselations

In this package, we use sammons from the package MASS to project higher dimensional data to a 2D space. The function hvq called from the HVT function returns hierarchical quantized data which will be the input for construction of the tesselations. The data is then represented in 2D coordinates and the tessellations are plotted using these coordinates as centroids. We use the package deldir for this purpose. The deldir package computes the Delaunay triangulation (and hence the Dirichlet or Voronoi tesselation) of a planar point set according to the second (iterative) algorithm of Lee and Schacter. For subsequent levels, transformation is performed on the 2D coordinates to get all the points within its parent tile. Tessellations are plotted using these transformed points as centroids. The lines in the tessellations are chopped in places so that they do not protrude outside the parent polygon. This is done for all the subsequent levels.

3.2.1 Example Usage 1

In this section, we will use the Prices of Personal Computers dataset. This dataset contains 6259 observations and 10 features. The dataset observes the price from 1993 to 1995 of 486 personal computers in the US. The variables are price, speed, ram, screen, cd, etc. The dataset can be downloaded from here.

In this example, we will compress this dataset by using hierarhical VQ via k-means and visualize the Voronoi Tesselation plots using Sammons projection. Later on, we will overlay price, speed and screen variables as a heatmap to generate further insights.

Here, we load the data and store into a variable computers.

Let’s have a look at some of the data

X price speed hd ram screen cd multi premium ads trend
1 1499 25 80 4 14 no no yes 94 1
2 1795 33 85 2 14 no no yes 94 1
3 1595 25 170 4 15 no no yes 94 1
4 1849 25 170 8 14 no no no 94 1
5 3295 33 340 16 14 no no yes 94 1
6 3695 66 340 16 14 no no yes 94 1

Now let us check the structure of the data

Let’s get a summary of the data

Let us first split the data into train and test. We will use 80% of the data as train and remaining as test.

K-means is not suitable for factor variables as the sample space for factor variables is discrete. A Euclidean distance function on such a space isn’t really meaningful. Hence, we will delete the factor variables in our dataset.

Here we keep the original trainComputers and testComputers as we will use the price variable from this dataset to overlay as heatmap and generate some insights.

Let us try to understand the HVT function first.

Each of the parameters have been explained below

  • dataset - A dataframe with numeric columns

  • nlcust - An integer indicating the number of cells per hierarchy (level)

  • depth - An integer indicating the number of levels. (1 = No hierarchy, 2 = 2 levels, etc …)

  • quant.error - A number indicating the quantization error threshold. A cell will only breakdown into further cells if the quantization error of the cell is above the defined quantization error threshold

  • projection.scale - A number indicating the scale factor for the tesselations so as to visualize the sub-tesselations efficiently

  • normalize - A logical value indicating whether the columns in your dataset need to be normalized. Default value is TRUE. The algorithm supports Z-score normalization

  • distance_metric - The distance metric can be L1_Norm or L2_Norm. L1_Norm is selected by default. The distance metric is used to calculate the distance between an n dimensional point and centroid. The user can also pass a custom function to calculate this distance

  • error_metric - The error metric can be mean or max. max is selected by default. max will return the max of m values and mean will take mean of m values where each value is a distance between a point and centroid of the cell. Moreover, the user can also pass a custom function to calculate the error metric

First we will perform hierarchical Vector Quantization at level 1 by setting the parameter depth to 1 and the number of cells to 15. Here, level 1 signifies no hierarchy.

Now let’s try to understand plotHVT function. The parameters have been explained in detail below

  • hvt.results - A list containing the ouput of the HVT function which has the details of the tessellations to be plotted

  • line.width - A vector indicating the line widths of the tessellation boundaries for each level

  • color.vec - A vector indicating the colors of the tessellations boundaries at each level

  • pch1 - Symbol type of the centroids of the tessellations (parent levels). Refer points (default = 21)

  • centroid.size - Size of centroids of first level tessellations (default = 3)

  • title - Set a title for the plot (default = NULL)

Let’s plot the voronoi tesselation

Figure 2: The Voronoi Tessellation for level 1 shown for the 15 cells in the dataset ’computers’

Figure 2: The Voronoi Tessellation for level 1 shown for the 15 cells in the dataset ’computers’

As per the manual, hvt.results[[3]] gives us detailed information about the hierarchical vector quantized data.

hvt.results[[3]][['summary']] gives a nice tabular data containing no of points, Quantization Error and the codebook.

Now let us understand what each column in the summary table means

  • Segment Level - Level of the cell. In this case, we have performed Vector Quantization for depth 1. Hence Segment Level is 1

  • Segment Parent - Parent segment of the cell

  • Segment Child - The children of a particular cell. In this case, first level has 15 cells hence we can see Segment Child 1,2,3,4,5 ,..,15.

  • n - No of points in each cell

  • Quant.Error - Quantization Error for each cell

All the columns after this will contain centroids for each cell. They can also be called a codebook, which represents a collection of all centroids or codewords.

Segment.Level Segment.Parent Segment.Child n Quant.Error price speed hd ram screen ads
1 1 1 480 0.33 0.69 0.70 0.24 -0.02 0.06 0.57
1 1 2 390 0.49 0.83 0.21 0.05 0.10 2.88 0.10
1 1 3 145 0.35 0.27 2.67 0.17 -0.20 -0.17 0.71
1 1 4 505 0.26 -0.17 -0.80 0.24 -0.04 -0.31 0.42
1 1 5 241 0.28 -0.34 0.66 -0.73 -0.75 -0.40 -0.40
1 1 6 150 0.49 0.90 -0.55 2.71 2.32 0.29 -0.60
1 1 7 286 0.23 0.75 -0.71 0.79 1.61 -0.41 0.35
1 1 8 258 0.3 -0.39 0.76 0.71 0.00 -0.16 -0.54
1 1 9 324 0.25 -1.08 -0.79 -0.56 -0.69 -0.38 -0.76
1 1 10 401 0.29 -0.54 0.56 -0.62 -0.76 -0.32 0.76
1 1 11 288 0.34 1.19 1.24 0.74 1.61 0.13 0.38
1 1 12 917 0.22 -0.98 -0.91 -0.82 -0.77 -0.44 0.55
1 1 13 229 0.45 1.09 0.33 -0.16 0.33 -0.15 -1.94
1 1 14 97 0.57 2.01 1.24 3.36 2.46 0.20 0.01
1 1 15 296 0.29 -0.33 -0.53 -0.81 -0.51 -0.43 -2.16

Let’s have a look at Quant.Error variable in the above table. It seems that none of the cells have hit the quantization threshold error.

Now let’s check the compression summary. The table below shows no of cells, no of cells having quantization error below threshold and percentage of cells having quantization error below threshold for each level.

segmentLevel noOfCells noOfCellsBelowQuantizationError percentOfCellsBelowQuantizationErrorThreshold
1 15 0 0

As it can be seen in the table above, percentage of cells in level 1 having Quantization Error below threshold is 0%. Hence, we can go one level deeper and try to compress it further.

We will now overlay the Quant.Error variable as heatmap over the Voronoi Tesselation plot to visualize the quantization error better.

Let’s have look at the function hvtHmap which we will use to overlay a variable as heatmap.

  • hvt.results - A list of hvt.results obtained from the HVT function

  • dataset - A dataframe containing the variables to overlay as a heatmap. The user can pass an external dataset or the dataset that was used to perform hierarchical vector quantization. The dataset should have the same number of points as the dataset used to perform hierarchical Vector Quantization in the HVT function

  • child.level - A number indicating the level for which the heat map is to be plotted

  • hmap.cols - The column number of column name from the dataset indicating the variables for which the heat map is to be plotted. To plot the quantization error as heatmap, pass 'quant_error'. Similary to plot the no of points in each cell as heatmap, pass 'no_of_points' as a parameter

  • color.vec - A color vector such that length(color.vec) = child.level (default = NULL)

  • line.width - A line width vector such that length(line.width) = child.level (default = NULL)

  • palette.color - A number indicating the heat map color palette. 1 - rainbow, 2 - heat.colors, 3 - terrain.colors, 4 - topo.colors, 5 - cm.colors, 6 - BlCyGrYlRd (Blue,Cyan,Green,Yellow,Red) color (default = 6)

  • show.points - A boolean indicating whether the centroids should be plotted on the tesselations (default = FALSE)

Now let’s plot the quantization error for each cell at level one as a heatmap.

Figure 3: The Voronoi Tessellation with the heat map overlaid for variable ’quant_error’ in the ’computers’ dataset

Figure 3: The Voronoi Tessellation with the heat map overlaid for variable ’quant_error’ in the ’computers’ dataset

Now let’s go one level deeper and perform hierarchical vector quantization.

Let’s plot the voronoi tesselation for both the levels.

Figure 4: The Voronoi Tessellation for level 2 shown for the 225 cells in the dataset ’computers’

Figure 4: The Voronoi Tessellation for level 2 shown for the 225 cells in the dataset ’computers’

In the table below, Segment Level signifies the depth.

Level 1 has 15 cells

Level 2 has 225 cells .i.e. each cell in level 1 is divided into 15 cells each

Let’s analyze the summary table again for Quant.Error and see if any of the cells in the 2nd level have Quantization Error below the Quantization Error threshold. In the table below, the values for Quant.Error of the cells which have hit the Quantization Error threshold are shown in red. Here we are showing just top 50 rows for the sake of brevity.

Segment.Level Segment.Parent Segment.Child n Quant.Error price speed hd ram screen ads
1 1 1 480 0.33 0.69 0.70 0.24 -0.02 0.06 0.57
1 1 2 390 0.49 0.83 0.21 0.05 0.10 2.88 0.10
1 1 3 145 0.35 0.27 2.67 0.17 -0.20 -0.17 0.71
1 1 4 505 0.26 -0.17 -0.80 0.24 -0.04 -0.31 0.42
1 1 5 241 0.28 -0.34 0.66 -0.73 -0.75 -0.40 -0.40
1 1 6 150 0.49 0.90 -0.55 2.71 2.32 0.29 -0.60
1 1 7 286 0.23 0.75 -0.71 0.79 1.61 -0.41 0.35
1 1 8 258 0.3 -0.39 0.76 0.71 0.00 -0.16 -0.54
1 1 9 324 0.25 -1.08 -0.79 -0.56 -0.69 -0.38 -0.76
1 1 10 401 0.29 -0.54 0.56 -0.62 -0.76 -0.32 0.76
1 1 11 288 0.34 1.19 1.24 0.74 1.61 0.13 0.38
1 1 12 917 0.22 -0.98 -0.91 -0.82 -0.77 -0.44 0.55
1 1 13 229 0.45 1.09 0.33 -0.16 0.33 -0.15 -1.94
1 1 14 97 0.57 2.01 1.24 3.36 2.46 0.20 0.01
1 1 15 296 0.29 -0.33 -0.53 -0.81 -0.51 -0.43 -2.16
2 1 1 41 0.17 0.98 0.88 -0.31 -0.18 0.55 0.44
2 1 2 55 0.11 0.48 0.92 0.59 0.05 0.55 0.54
2 1 3 57 0.13 0.40 0.08 -0.02 0.01 0.55 0.51
2 1 4 22 0.19 1.95 0.77 0.68 -0.01 -0.61 0.58
2 1 5 53 0.11 0.78 0.92 0.31 0.03 -0.61 0.70
2 1 6 45 0.13 0.15 1.03 0.34 -0.01 -0.61 1.04
2 1 7 31 0.17 0.85 0.81 0.00 -0.16 -0.61 0.01
2 1 8 28 0.15 -0.01 0.70 0.42 0.04 0.55 1.37
2 1 9 50 0.12 0.51 0.09 0.19 0.00 -0.61 0.62
2 1 10 35 0.18 2.13 0.87 0.64 -0.16 0.55 0.48
2 1 11 39 0.1 -0.03 0.92 -0.06 0.04 0.55 0.50
2 1 12 24 0.2 1.10 0.64 0.33 0.00 0.55 -0.21
2 1 13 0 NA NA NA NA NA NA NA
2 1 14 0 NA NA NA NA NA NA NA
2 1 15 0 NA NA NA NA NA NA NA
2 2 1 24 0.19 2.32 0.92 0.32 -0.03 2.88 0.53
2 2 2 12 0.32 1.25 -0.49 1.29 1.37 2.88 -1.03
2 2 3 19 0.22 1.25 0.31 -0.31 -0.43 2.88 0.80
2 2 4 6 0.32 3.80 2.08 1.45 0.06 2.88 -0.25
2 2 5 16 0.18 0.73 -0.67 -0.52 -0.13 2.88 -1.75
2 2 6 19 0.31 0.76 0.96 1.19 1.22 2.88 -0.33
2 2 7 56 0.2 -0.52 -0.90 -0.50 -0.71 2.88 0.40
2 2 8 63 0.22 0.46 -0.80 -0.11 -0.23 2.88 0.51
2 2 9 23 0.18 1.21 0.52 -0.54 -0.14 2.88 -2.06
2 2 10 17 0.18 -0.04 0.19 -0.12 -0.30 2.88 0.46
2 2 11 43 0.24 2.40 0.72 0.26 1.63 2.88 0.29
2 2 12 20 0.21 -0.28 0.71 0.02 -0.33 2.88 -0.46
2 2 13 48 0.16 0.71 0.80 0.14 0.02 2.88 0.39
2 2 14 13 0.24 0.96 2.67 0.49 0.55 2.88 0.56
2 2 15 11 0.15 0.65 0.77 0.32 0.06 2.88 1.34
2 3 1 6 0.15 1.53 2.67 1.98 0.06 -0.61 -0.49
2 3 2 14 0.16 0.08 2.67 0.25 -0.27 -0.53 -0.41
2 3 3 38 0.2 -0.19 2.67 -0.78 -0.83 -0.37 0.99
2 3 4 14 0.09 0.37 2.67 0.59 0.06 -0.61 0.33
2 3 5 27 0.09 0.50 2.67 0.32 0.06 -0.61 1.33

The users can look at the compression summary to get a quick summary on the compression as it becomes quite cumbersome to look at the summary table above as we go deeper.

segmentLevel noOfCells noOfCellsBelowQuantizationError percentOfCellsBelowQuantizationErrorThreshold
1 15 0 0
2 134 118 0.88

As it can be seen in the table above, only 5% cells in the 2nd level have Quantization Error below threshold. Therefore, we can go another level deeper and try to compress the data further.

We will look at the heatmap for Quantization Error for level 2.

Figure 5: The Voronoi Tessellation with the heat map overlaid for variable ’quant_error’ in the ’computers’ dataset

Figure 5: The Voronoi Tessellation with the heat map overlaid for variable ’quant_error’ in the ’computers’ dataset

As the Quantization Error criteria is not met, let’s perform hierarchical Vector Quantization at level 3.

Let’s plot the Voronoi Tesselation for all 3 levels.

Figure 6: The Voronoi Tessellation for level 3 shown for the 1905 cells in the dataset ’computers’

Figure 6: The Voronoi Tessellation for level 3 shown for the 1905 cells in the dataset ’computers’

Each of the 225 cells whose quantization is above the defined threshold in level 2 will break down into 15 cells each in level 3. Hence, as it can be seen below, level 3 has 3375 rows. So it will have 3615 rows in total. We will only show first 500 rows here.

Segment.Level Segment.Parent Segment.Child n Quant.Error price speed hd ram screen ads
1 1 1 480 0.33 0.69 0.70 0.24 -0.02 0.06 0.57
1 1 2 390 0.49 0.83 0.21 0.05 0.10 2.88 0.10
1 1 3 145 0.35 0.27 2.67 0.17 -0.20 -0.17 0.71
1 1 4 505 0.26 -0.17 -0.80 0.24 -0.04 -0.31 0.42
1 1 5 241 0.28 -0.34 0.66 -0.73 -0.75 -0.40 -0.40
1 1 6 150 0.49 0.90 -0.55 2.71 2.32 0.29 -0.60
1 1 7 286 0.23 0.75 -0.71 0.79 1.61 -0.41 0.35
1 1 8 258 0.3 -0.39 0.76 0.71 0.00 -0.16 -0.54
1 1 9 324 0.25 -1.08 -0.79 -0.56 -0.69 -0.38 -0.76
1 1 10 401 0.29 -0.54 0.56 -0.62 -0.76 -0.32 0.76
1 1 11 288 0.34 1.19 1.24 0.74 1.61 0.13 0.38
1 1 12 917 0.22 -0.98 -0.91 -0.82 -0.77 -0.44 0.55
1 1 13 229 0.45 1.09 0.33 -0.16 0.33 -0.15 -1.94
1 1 14 97 0.57 2.01 1.24 3.36 2.46 0.20 0.01
1 1 15 296 0.29 -0.33 -0.53 -0.81 -0.51 -0.43 -2.16
2 1 1 41 0.17 0.98 0.88 -0.31 -0.18 0.55 0.44
2 1 2 55 0.11 0.48 0.92 0.59 0.05 0.55 0.54
2 1 3 57 0.13 0.40 0.08 -0.02 0.01 0.55 0.51
2 1 4 22 0.19 1.95 0.77 0.68 -0.01 -0.61 0.58
2 1 5 53 0.11 0.78 0.92 0.31 0.03 -0.61 0.70
2 1 6 45 0.13 0.15 1.03 0.34 -0.01 -0.61 1.04
2 1 7 31 0.17 0.85 0.81 0.00 -0.16 -0.61 0.01
2 1 8 28 0.15 -0.01 0.70 0.42 0.04 0.55 1.37
2 1 9 50 0.12 0.51 0.09 0.19 0.00 -0.61 0.62
2 1 10 35 0.18 2.13 0.87 0.64 -0.16 0.55 0.48
2 1 11 39 0.1 -0.03 0.92 -0.06 0.04 0.55 0.50
2 1 12 24 0.2 1.10 0.64 0.33 0.00 0.55 -0.21
2 1 13 0 NA NA NA NA NA NA NA
2 1 14 0 NA NA NA NA NA NA NA
2 1 15 0 NA NA NA NA NA NA NA
2 2 1 24 0.19 2.32 0.92 0.32 -0.03 2.88 0.53
2 2 2 12 0.32 1.25 -0.49 1.29 1.37 2.88 -1.03
2 2 3 19 0.22 1.25 0.31 -0.31 -0.43 2.88 0.80
2 2 4 6 0.32 3.80 2.08 1.45 0.06 2.88 -0.25
2 2 5 16 0.18 0.73 -0.67 -0.52 -0.13 2.88 -1.75
2 2 6 19 0.31 0.76 0.96 1.19 1.22 2.88 -0.33
2 2 7 56 0.2 -0.52 -0.90 -0.50 -0.71 2.88 0.40
2 2 8 63 0.22 0.46 -0.80 -0.11 -0.23 2.88 0.51
2 2 9 23 0.18 1.21 0.52 -0.54 -0.14 2.88 -2.06
2 2 10 17 0.18 -0.04 0.19 -0.12 -0.30 2.88 0.46
2 2 11 43 0.24 2.40 0.72 0.26 1.63 2.88 0.29
2 2 12 20 0.21 -0.28 0.71 0.02 -0.33 2.88 -0.46
2 2 13 48 0.16 0.71 0.80 0.14 0.02 2.88 0.39
2 2 14 13 0.24 0.96 2.67 0.49 0.55 2.88 0.56
2 2 15 11 0.15 0.65 0.77 0.32 0.06 2.88 1.34
2 3 1 6 0.15 1.53 2.67 1.98 0.06 -0.61 -0.49
2 3 2 14 0.16 0.08 2.67 0.25 -0.27 -0.53 -0.41
2 3 3 38 0.2 -0.19 2.67 -0.78 -0.83 -0.37 0.99
2 3 4 14 0.09 0.37 2.67 0.59 0.06 -0.61 0.33
2 3 5 27 0.09 0.50 2.67 0.32 0.06 -0.61 1.33
2 3 6 46 0.15 0.39 2.67 0.47 0.06 0.55 0.72
2 3 7 0 NA NA NA NA NA NA NA
2 3 8 0 NA NA NA NA NA NA NA
2 3 9 0 NA NA NA NA NA NA NA
2 3 10 0 NA NA NA NA NA NA NA
2 3 11 0 NA NA NA NA NA NA NA
2 3 12 0 NA NA NA NA NA NA NA
2 3 13 0 NA NA NA NA NA NA NA
2 3 14 0 NA NA NA NA NA NA NA
2 3 15 0 NA NA NA NA NA NA NA
2 4 1 227 0.16 -0.20 -0.77 0.27 -0.05 -0.61 0.75
2 4 2 147 0.19 -0.02 -0.82 0.25 -0.01 -0.61 -0.10
2 4 3 131 0.19 -0.28 -0.82 0.18 -0.04 0.55 0.43
2 4 4 0 NA NA NA NA NA NA NA
2 4 5 0 NA NA NA NA NA NA NA
2 4 6 0 NA NA NA NA NA NA NA
2 4 7 0 NA NA NA NA NA NA NA
2 4 8 0 NA NA NA NA NA NA NA
2 4 9 0 NA NA NA NA NA NA NA
2 4 10 0 NA NA NA NA NA NA NA
2 4 11 0 NA NA NA NA NA NA NA
2 4 12 0 NA NA NA NA NA NA NA
2 4 13 0 NA NA NA NA NA NA NA
2 4 14 0 NA NA NA NA NA NA NA
2 4 15 0 NA NA NA NA NA NA NA
2 5 1 16 0.08 -1.06 0.92 -0.54 -0.72 -0.61 -0.65
2 5 2 19 0.17 -0.27 0.66 -0.78 -0.74 0.55 -0.08
2 5 3 22 0.08 -0.25 0.92 -1.16 -1.02 -0.61 -0.02
2 5 4 10 0.08 -0.21 0.09 -0.66 -0.64 -0.61 -1.10
2 5 5 9 0.08 -0.72 0.09 -0.66 -0.76 -0.61 -0.71
2 5 6 13 0.11 -0.79 0.92 -0.91 -0.78 -0.61 -1.27
2 5 7 16 0.12 -0.09 0.92 -0.56 -0.52 -0.61 -0.88
2 5 8 17 0.11 -0.19 0.92 -0.32 -0.58 -0.61 -0.02
2 5 9 21 0.06 -0.85 0.92 -0.80 -0.72 -0.61 0.06
2 5 10 6 0.07 -0.08 0.92 -0.89 -0.72 -0.61 -1.57
2 5 11 20 0.07 0.10 0.09 -0.64 -0.72 -0.61 -0.05
2 5 12 12 0.15 -0.87 0.57 -0.48 -0.75 0.55 -0.55
2 5 13 20 0.09 -0.57 0.09 -1.10 -1.01 -0.61 -0.03
2 5 14 26 0.09 0.40 0.92 -0.60 -0.72 -0.61 -0.14
2 5 15 14 0.2 -0.27 0.56 -0.77 -0.63 0.55 -1.18
2 6 1 5 0.01 0.51 -0.78 1.73 1.63 0.55 -1.30
2 6 2 5 0.01 0.19 -0.78 1.73 1.63 0.55 -1.30
2 6 3 5 0.14 1.24 -0.78 4.82 -0.09 -0.38 0.49
2 6 4 7 0.03 0.50 -0.78 1.73 1.63 0.55 -0.68
2 6 5 3 0.17 1.30 -0.78 3.06 1.63 -0.61 -0.03
2 6 6 20 0.14 0.55 0.38 1.82 1.63 0.55 -1.06
2 6 7 51 0.2 1.29 -0.54 3.06 3.19 0.82 -0.87
2 6 8 11 0.2 0.03 -0.78 3.16 0.06 -0.40 -0.36
2 6 9 32 0.08 1.19 -0.78 3.06 3.19 -0.54 0.10
2 6 10 6 0.01 0.12 -0.78 1.73 1.63 0.55 -0.84
2 6 11 5 0.01 0.19 -0.78 1.73 1.63 0.55 -0.62
2 6 12 0 NA NA NA NA NA NA NA
2 6 13 0 NA NA NA NA NA NA NA
2 6 14 0 NA NA NA NA NA NA NA
2 6 15 0 NA NA NA NA NA NA NA
2 7 1 45 0.15 0.62 -0.83 0.75 1.63 0.55 0.43
2 7 2 54 0.17 1.18 0.01 0.76 1.51 -0.61 0.54
2 7 3 149 0.13 0.65 -0.91 0.85 1.63 -0.61 0.53
2 7 4 38 0.19 0.66 -0.81 0.65 1.63 -0.46 -0.69
2 7 5 0 NA NA NA NA NA NA NA
2 7 6 0 NA NA NA NA NA NA NA
2 7 7 0 NA NA NA NA NA NA NA
2 7 8 0 NA NA NA NA NA NA NA
2 7 9 0 NA NA NA NA NA NA NA
2 7 10 0 NA NA NA NA NA NA NA
2 7 11 0 NA NA NA NA NA NA NA
2 7 12 0 NA NA NA NA NA NA NA
2 7 13 0 NA NA NA NA NA NA NA
2 7 14 0 NA NA NA NA NA NA NA
2 7 15 0 NA NA NA NA NA NA NA
2 8 1 37 0.2 -0.53 0.72 0.87 0.00 0.55 -1.02
2 8 2 57 0.16 -0.37 0.87 0.57 0.04 0.55 -0.15
2 8 3 64 0.12 -0.27 0.92 0.47 0.02 -0.61 -0.10
2 8 4 61 0.15 -0.61 0.90 0.47 -0.09 -0.61 -0.83
2 8 5 13 0.19 -0.11 0.54 3.06 0.06 -0.26 -0.81
2 8 6 26 0.17 -0.19 -0.08 0.76 0.06 -0.53 -0.95
2 8 7 0 NA NA NA NA NA NA NA
2 8 8 0 NA NA NA NA NA NA NA
2 8 9 0 NA NA NA NA NA NA NA
2 8 10 0 NA NA NA NA NA NA NA
2 8 11 0 NA NA NA NA NA NA NA
2 8 12 0 NA NA NA NA NA NA NA
2 8 13 0 NA NA NA NA NA NA NA
2 8 14 0 NA NA NA NA NA NA NA
2 8 15 0 NA NA NA NA NA NA NA
2 9 1 29 0.14 -1.33 -0.66 -0.07 -0.70 0.55 -0.54
2 9 2 37 0.18 -0.85 -0.82 -0.78 -0.68 0.55 -0.93
2 9 3 258 0.2 -1.08 -0.79 -0.58 -0.69 -0.61 -0.76
2 9 4 0 NA NA NA NA NA NA NA
2 9 5 0 NA NA NA NA NA NA NA
2 9 6 0 NA NA NA NA NA NA NA
2 9 7 0 NA NA NA NA NA NA NA
2 9 8 0 NA NA NA NA NA NA NA
2 9 9 0 NA NA NA NA NA NA NA
2 9 10 0 NA NA NA NA NA NA NA
2 9 11 0 NA NA NA NA NA NA NA
2 9 12 0 NA NA NA NA NA NA NA
2 9 13 0 NA NA NA NA NA NA NA
2 9 14 0 NA NA NA NA NA NA NA
2 9 15 0 NA NA NA NA NA NA NA
2 10 1 65 0.2 -0.62 0.38 0.07 -0.62 -0.61 0.72
2 10 2 75 0.16 -0.71 0.99 -0.98 -0.94 -0.61 0.92
2 10 3 45 0.15 -0.69 0.09 -0.52 -0.72 0.55 0.62
2 10 4 92 0.15 -0.70 0.09 -0.90 -0.82 -0.61 0.74
2 10 5 67 0.11 -0.02 0.89 -0.66 -0.68 -0.61 0.76
2 10 6 57 0.18 -0.49 0.95 -0.53 -0.68 0.55 0.76
2 10 7 0 NA NA NA NA NA NA NA
2 10 8 0 NA NA NA NA NA NA NA
2 10 9 0 NA NA NA NA NA NA NA
2 10 10 0 NA NA NA NA NA NA NA
2 10 11 0 NA NA NA NA NA NA NA
2 10 12 0 NA NA NA NA NA NA NA
2 10 13 0 NA NA NA NA NA NA NA
2 10 14 0 NA NA NA NA NA NA NA
2 10 15 0 NA NA NA NA NA NA NA
2 11 1 19 0.1 0.97 1.14 0.82 1.63 -0.61 1.27
2 11 2 32 0.12 1.51 0.79 0.68 1.63 0.55 0.62
2 11 3 21 0.13 0.82 0.98 0.63 1.63 0.55 1.25
2 11 4 6 0.14 1.39 0.92 0.20 1.63 0.16 -1.08
2 11 5 15 0.38 1.44 2.67 1.16 1.21 0.01 -0.46
2 11 6 22 0.13 1.33 0.80 0.56 1.63 0.55 -0.24
2 11 7 20 0.15 1.22 2.67 1.05 1.63 -0.61 0.72
2 11 8 18 0.17 1.31 2.67 0.79 1.63 0.94 1.12
2 11 9 9 0.11 0.40 0.97 0.71 1.63 0.55 -0.74
2 11 10 5 0.29 2.72 0.92 0.59 1.94 0.32 0.13
2 11 11 18 0.12 0.65 0.92 1.07 1.63 -0.61 0.04
2 11 12 15 0.07 0.62 0.95 0.77 1.63 0.55 0.37
2 11 13 11 0.07 0.72 0.92 1.74 1.63 0.55 -0.66
2 11 14 43 0.09 1.51 0.92 0.77 1.63 -0.61 0.38
2 11 15 34 0.09 1.21 0.92 0.09 1.63 0.55 0.44
2 12 1 140 0.18 -0.92 -0.90 -0.76 -0.80 0.55 0.59
2 12 2 364 0.14 -0.61 -0.88 -0.83 -0.74 -0.61 0.41
2 12 3 413 0.17 -1.32 -0.94 -0.83 -0.79 -0.61 0.67
2 12 4 0 NA NA NA NA NA NA NA
2 12 5 0 NA NA NA NA NA NA NA
2 12 6 0 NA NA NA NA NA NA NA
2 12 7 0 NA NA NA NA NA NA NA
2 12 8 0 NA NA NA NA NA NA NA
2 12 9 0 NA NA NA NA NA NA NA
2 12 10 0 NA NA NA NA NA NA NA
2 12 11 0 NA NA NA NA NA NA NA
2 12 12 0 NA NA NA NA NA NA NA
2 12 13 0 NA NA NA NA NA NA NA
2 12 14 0 NA NA NA NA NA NA NA
2 12 15 0 NA NA NA NA NA NA NA
2 13 1 11 0.16 0.99 0.84 -0.21 -0.01 -0.61 -1.29
2 13 2 14 0.16 1.34 0.50 0.08 1.63 -0.61 -2.10
2 13 3 14 0.12 0.57 0.39 -0.54 -0.05 0.55 -2.24
2 13 4 13 0.14 0.80 0.92 -0.36 -0.06 0.55 -1.35
2 13 5 11 0.23 2.40 0.92 0.63 -0.01 0.23 -1.60
2 13 6 15 0.24 1.09 0.13 -0.20 1.63 0.55 -1.93
2 13 7 18 0.14 0.49 0.04 -0.35 -0.02 0.55 -1.37
2 13 8 15 0.16 0.55 -0.20 0.27 0.06 -0.61 -1.32
2 13 9 39 0.12 0.45 0.58 -0.59 0.06 -0.61 -2.20
2 13 10 11 0.14 2.58 -0.31 0.40 0.06 -0.61 -2.20
2 13 11 15 0.11 2.68 0.92 0.52 0.06 -0.61 -2.16
2 13 12 18 0.14 1.30 0.92 -0.36 -0.28 0.55 -2.31
2 13 13 9 0.17 1.24 0.55 -0.75 -0.37 -0.61 -2.35
2 13 14 20 0.13 0.87 -0.91 0.06 1.63 -0.56 -2.12
2 13 15 6 0.14 0.69 -0.78 -0.37 0.06 0.36 -2.13
2 14 1 3 0.04 1.52 0.92 3.06 3.19 0.55 0.08
2 14 2 6 0.29 2.14 0.92 3.25 2.15 2.88 -0.39
2 14 3 2 0.06 2.26 0.92 8.30 1.63 0.55 0.27
2 14 4 3 0.04 2.01 2.67 3.06 1.63 0.55 1.18
2 14 5 7 0.05 2.13 0.80 3.06 3.19 0.55 -0.62
2 14 6 10 0.05 1.53 0.92 3.06 3.19 -0.61 0.27
2 14 7 8 0.18 3.51 0.18 3.42 1.63 -0.61 0.77
2 14 8 19 0.12 1.99 2.67 3.06 3.11 -0.43 0.06
2 14 9 5 0.02 1.52 0.92 3.06 3.19 0.55 -1.30
2 14 10 6 0.24 1.92 0.92 4.58 -0.07 -0.42 0.49
2 14 11 4 0.02 1.24 0.92 3.06 3.19 0.55 -0.84
2 14 12 3 0.02 5.26 0.92 4.01 4.76 2.88 0.46
2 14 13 14 0.22 1.24 0.92 3.25 1.40 0.47 0.25
2 14 14 2 0.04 2.89 0.92 3.06 1.63 -0.61 -1.37
2 14 15 5 0.02 1.57 0.92 3.06 3.19 -0.61 -0.30
2 15 1 23 0.08 -0.20 0.92 -1.07 -0.80 -0.61 -2.28
2 15 2 100 0.15 -0.84 -0.94 -0.99 -0.77 -0.57 -2.21
2 15 3 58 0.15 -0.21 0.09 -0.86 -0.58 -0.59 -2.16
2 15 4 74 0.16 0.02 -0.83 -0.55 -0.14 -0.61 -2.11
2 15 5 41 0.19 0.05 -0.72 -0.62 -0.28 0.55 -2.08
2 15 6 0 NA NA NA NA NA NA NA
2 15 7 0 NA NA NA NA NA NA NA
2 15 8 0 NA NA NA NA NA NA NA
2 15 9 0 NA NA NA NA NA NA NA
2 15 10 0 NA NA NA NA NA NA NA
2 15 11 0 NA NA NA NA NA NA NA
2 15 12 0 NA NA NA NA NA NA NA
2 15 13 0 NA NA NA NA NA NA NA
2 15 14 0 NA NA NA NA NA NA NA
2 15 15 0 NA NA NA NA NA NA NA
3 1 1 0 NA NA NA NA NA NA NA
3 1 2 0 NA NA NA NA NA NA NA
3 1 3 0 NA NA NA NA NA NA NA
3 1 4 0 NA NA NA NA NA NA NA
3 1 5 0 NA NA NA NA NA NA NA
3 1 6 0 NA NA NA NA NA NA NA
3 1 7 0 NA NA NA NA NA NA NA
3 1 8 0 NA NA NA NA NA NA NA
3 1 9 0 NA NA NA NA NA NA NA
3 1 10 0 NA NA NA NA NA NA NA
3 1 11 0 NA NA NA NA NA NA NA
3 1 12 0 NA NA NA NA NA NA NA
3 1 13 0 NA NA NA NA NA NA NA
3 1 14 0 NA NA NA NA NA NA NA
3 1 15 0 NA NA NA NA NA NA NA
3 2 1 0 NA NA NA NA NA NA NA
3 2 2 0 NA NA NA NA NA NA NA
3 2 3 0 NA NA NA NA NA NA NA
3 2 4 0 NA NA NA NA NA NA NA
3 2 5 0 NA NA NA NA NA NA NA
3 2 6 0 NA NA NA NA NA NA NA
3 2 7 0 NA NA NA NA NA NA NA
3 2 8 0 NA NA NA NA NA NA NA
3 2 9 0 NA NA NA NA NA NA NA
3 2 10 0 NA NA NA NA NA NA NA
3 2 11 0 NA NA NA NA NA NA NA
3 2 12 0 NA NA NA NA NA NA NA
3 2 13 0 NA NA NA NA NA NA NA
3 2 14 0 NA NA NA NA NA NA NA
3 2 15 0 NA NA NA NA NA NA NA
3 3 1 0 NA NA NA NA NA NA NA
3 3 2 0 NA NA NA NA NA NA NA
3 3 3 0 NA NA NA NA NA NA NA
3 3 4 0 NA NA NA NA NA NA NA
3 3 5 0 NA NA NA NA NA NA NA
3 3 6 0 NA NA NA NA NA NA NA
3 3 7 0 NA NA NA NA NA NA NA
3 3 8 0 NA NA NA NA NA NA NA
3 3 9 0 NA NA NA NA NA NA NA
3 3 10 0 NA NA NA NA NA NA NA
3 3 11 0 NA NA NA NA NA NA NA
3 3 12 0 NA NA NA NA NA NA NA
3 3 13 0 NA NA NA NA NA NA NA
3 3 14 0 NA NA NA NA NA NA NA
3 3 15 0 NA NA NA NA NA NA NA
3 4 1 0 NA NA NA NA NA NA NA
3 4 2 0 NA NA NA NA NA NA NA
3 4 3 0 NA NA NA NA NA NA NA
3 4 4 0 NA NA NA NA NA NA NA
3 4 5 0 NA NA NA NA NA NA NA
3 4 6 0 NA NA NA NA NA NA NA
3 4 7 0 NA NA NA NA NA NA NA
3 4 8 0 NA NA NA NA NA NA NA
3 4 9 0 NA NA NA NA NA NA NA
3 4 10 0 NA NA NA NA NA NA NA
3 4 11 0 NA NA NA NA NA NA NA
3 4 12 0 NA NA NA NA NA NA NA
3 4 13 0 NA NA NA NA NA NA NA
3 4 14 0 NA NA NA NA NA NA NA
3 4 15 0 NA NA NA NA NA NA NA
3 5 1 0 NA NA NA NA NA NA NA
3 5 2 0 NA NA NA NA NA NA NA
3 5 3 0 NA NA NA NA NA NA NA
3 5 4 0 NA NA NA NA NA NA NA
3 5 5 0 NA NA NA NA NA NA NA
3 5 6 0 NA NA NA NA NA NA NA
3 5 7 0 NA NA NA NA NA NA NA
3 5 8 0 NA NA NA NA NA NA NA
3 5 9 0 NA NA NA NA NA NA NA
3 5 10 0 NA NA NA NA NA NA NA
3 5 11 0 NA NA NA NA NA NA NA
3 5 12 0 NA NA NA NA NA NA NA
3 5 13 0 NA NA NA NA NA NA NA
3 5 14 0 NA NA NA NA NA NA NA
3 5 15 0 NA NA NA NA NA NA NA
3 6 1 0 NA NA NA NA NA NA NA
3 6 2 0 NA NA NA NA NA NA NA
3 6 3 0 NA NA NA NA NA NA NA
3 6 4 0 NA NA NA NA NA NA NA
3 6 5 0 NA NA NA NA NA NA NA
3 6 6 0 NA NA NA NA NA NA NA
3 6 7 0 NA NA NA NA NA NA NA
3 6 8 0 NA NA NA NA NA NA NA
3 6 9 0 NA NA NA NA NA NA NA
3 6 10 0 NA NA NA NA NA NA NA
3 6 11 0 NA NA NA NA NA NA NA
3 6 12 0 NA NA NA NA NA NA NA
3 6 13 0 NA NA NA NA NA NA NA
3 6 14 0 NA NA NA NA NA NA NA
3 6 15 0 NA NA NA NA NA NA NA
3 7 1 0 NA NA NA NA NA NA NA
3 7 2 0 NA NA NA NA NA NA NA
3 7 3 0 NA NA NA NA NA NA NA
3 7 4 0 NA NA NA NA NA NA NA
3 7 5 0 NA NA NA NA NA NA NA
3 7 6 0 NA NA NA NA NA NA NA
3 7 7 0 NA NA NA NA NA NA NA
3 7 8 0 NA NA NA NA NA NA NA
3 7 9 0 NA NA NA NA NA NA NA
3 7 10 0 NA NA NA NA NA NA NA
3 7 11 0 NA NA NA NA NA NA NA
3 7 12 0 NA NA NA NA NA NA NA
3 7 13 0 NA NA NA NA NA NA NA
3 7 14 0 NA NA NA NA NA NA NA
3 7 15 0 NA NA NA NA NA NA NA
3 8 1 0 NA NA NA NA NA NA NA
3 8 2 0 NA NA NA NA NA NA NA
3 8 3 0 NA NA NA NA NA NA NA
3 8 4 0 NA NA NA NA NA NA NA
3 8 5 0 NA NA NA NA NA NA NA
3 8 6 0 NA NA NA NA NA NA NA
3 8 7 0 NA NA NA NA NA NA NA
3 8 8 0 NA NA NA NA NA NA NA
3 8 9 0 NA NA NA NA NA NA NA
3 8 10 0 NA NA NA NA NA NA NA
3 8 11 0 NA NA NA NA NA NA NA
3 8 12 0 NA NA NA NA NA NA NA
3 8 13 0 NA NA NA NA NA NA NA
3 8 14 0 NA NA NA NA NA NA NA
3 8 15 0 NA NA NA NA NA NA NA
3 9 1 0 NA NA NA NA NA NA NA
3 9 2 0 NA NA NA NA NA NA NA
3 9 3 0 NA NA NA NA NA NA NA
3 9 4 0 NA NA NA NA NA NA NA
3 9 5 0 NA NA NA NA NA NA NA
3 9 6 0 NA NA NA NA NA NA NA
3 9 7 0 NA NA NA NA NA NA NA
3 9 8 0 NA NA NA NA NA NA NA
3 9 9 0 NA NA NA NA NA NA NA
3 9 10 0 NA NA NA NA NA NA NA
3 9 11 0 NA NA NA NA NA NA NA
3 9 12 0 NA NA NA NA NA NA NA
3 9 13 0 NA NA NA NA NA NA NA
3 9 14 0 NA NA NA NA NA NA NA
3 9 15 0 NA NA NA NA NA NA NA
3 10 1 0 NA NA NA NA NA NA NA
3 10 2 0 NA NA NA NA NA NA NA
3 10 3 0 NA NA NA NA NA NA NA
3 10 4 0 NA NA NA NA NA NA NA
3 10 5 0 NA NA NA NA NA NA NA
3 10 6 0 NA NA NA NA NA NA NA
3 10 7 0 NA NA NA NA NA NA NA
3 10 8 0 NA NA NA NA NA NA NA
3 10 9 0 NA NA NA NA NA NA NA
3 10 10 0 NA NA NA NA NA NA NA
3 10 11 0 NA NA NA NA NA NA NA
3 10 12 0 NA NA NA NA NA NA NA
3 10 13 0 NA NA NA NA NA NA NA
3 10 14 0 NA NA NA NA NA NA NA
3 10 15 0 NA NA NA NA NA NA NA
3 11 1 0 NA NA NA NA NA NA NA
3 11 2 0 NA NA NA NA NA NA NA
3 11 3 0 NA NA NA NA NA NA NA
3 11 4 0 NA NA NA NA NA NA NA
3 11 5 0 NA NA NA NA NA NA NA
3 11 6 0 NA NA NA NA NA NA NA
3 11 7 0 NA NA NA NA NA NA NA
3 11 8 0 NA NA NA NA NA NA NA
3 11 9 0 NA NA NA NA NA NA NA
3 11 10 0 NA NA NA NA NA NA NA
3 11 11 0 NA NA NA NA NA NA NA
3 11 12 0 NA NA NA NA NA NA NA
3 11 13 0 NA NA NA NA NA NA NA
3 11 14 0 NA NA NA NA NA NA NA
3 11 15 0 NA NA NA NA NA NA NA
3 12 1 0 NA NA NA NA NA NA NA
3 12 2 0 NA NA NA NA NA NA NA
3 12 3 0 NA NA NA NA NA NA NA
3 12 4 0 NA NA NA NA NA NA NA
3 12 5 0 NA NA NA NA NA NA NA
3 12 6 0 NA NA NA NA NA NA NA
3 12 7 0 NA NA NA NA NA NA NA
3 12 8 0 NA NA NA NA NA NA NA
3 12 9 0 NA NA NA NA NA NA NA
3 12 10 0 NA NA NA NA NA NA NA
3 12 11 0 NA NA NA NA NA NA NA
3 12 12 0 NA NA NA NA NA NA NA
3 12 13 0 NA NA NA NA NA NA NA
3 12 14 0 NA NA NA NA NA NA NA
3 12 15 0 NA NA NA NA NA NA NA
3 13 1 0 NA NA NA NA NA NA NA
3 13 2 0 NA NA NA NA NA NA NA
3 13 3 0 NA NA NA NA NA NA NA
3 13 4 0 NA NA NA NA NA NA NA
3 13 5 0 NA NA NA NA NA NA NA
3 13 6 0 NA NA NA NA NA NA NA
3 13 7 0 NA NA NA NA NA NA NA
3 13 8 0 NA NA NA NA NA NA NA
3 13 9 0 NA NA NA NA NA NA NA
3 13 10 0 NA NA NA NA NA NA NA
3 13 11 0 NA NA NA NA NA NA NA
3 13 12 0 NA NA NA NA NA NA NA
3 13 13 0 NA NA NA NA NA NA NA
3 13 14 0 NA NA NA NA NA NA NA
3 13 15 0 NA NA NA NA NA NA NA
3 14 1 0 NA NA NA NA NA NA NA
3 14 2 0 NA NA NA NA NA NA NA
3 14 3 0 NA NA NA NA NA NA NA
3 14 4 0 NA NA NA NA NA NA NA
3 14 5 0 NA NA NA NA NA NA NA
3 14 6 0 NA NA NA NA NA NA NA
3 14 7 0 NA NA NA NA NA NA NA
3 14 8 0 NA NA NA NA NA NA NA
3 14 9 0 NA NA NA NA NA NA NA
3 14 10 0 NA NA NA NA NA NA NA
3 14 11 0 NA NA NA NA NA NA NA
3 14 12 0 NA NA NA NA NA NA NA
3 14 13 0 NA NA NA NA NA NA NA
3 14 14 0 NA NA NA NA NA NA NA
3 14 15 0 NA NA NA NA NA NA NA
3 15 1 0 NA NA NA NA NA NA NA
3 15 2 0 NA NA NA NA NA NA NA
3 15 3 0 NA NA NA NA NA NA NA
3 15 4 0 NA NA NA NA NA NA NA
3 15 5 0 NA NA NA NA NA NA NA
3 15 6 0 NA NA NA NA NA NA NA
3 15 7 0 NA NA NA NA NA NA NA
3 15 8 0 NA NA NA NA NA NA NA
3 15 9 0 NA NA NA NA NA NA NA
3 15 10 0 NA NA NA NA NA NA NA
3 15 11 0 NA NA NA NA NA NA NA
3 15 12 0 NA NA NA NA NA NA NA
3 15 13 0 NA NA NA NA NA NA NA
3 15 14 0 NA NA NA NA NA NA NA
3 15 15 0 NA NA NA NA NA NA NA
3 16 1 0 NA NA NA NA NA NA NA
3 16 2 0 NA NA NA NA NA NA NA
3 16 3 0 NA NA NA NA NA NA NA
3 16 4 0 NA NA NA NA NA NA NA
3 16 5 0 NA NA NA NA NA NA NA
3 16 6 0 NA NA NA NA NA NA NA
3 16 7 0 NA NA NA NA NA NA NA
3 16 8 0 NA NA NA NA NA NA NA
3 16 9 0 NA NA NA NA NA NA NA
3 16 10 0 NA NA NA NA NA NA NA
3 16 11 0 NA NA NA NA NA NA NA
3 16 12 0 NA NA NA NA NA NA NA
3 16 13 0 NA NA NA NA NA NA NA
3 16 14 0 NA NA NA NA NA NA NA
3 16 15 0 NA NA NA NA NA NA NA
3 17 1 3 0.05 0.96 0.09 1.73 1.63 2.88 -0.92
3 17 2 3 0.03 0.76 -0.78 1.73 1.63 2.88 -0.69
3 17 3 2 0.02 0.83 -0.78 1.73 1.63 2.88 -1.30
3 17 4 2 0.07 1.76 -0.35 0.87 0.06 2.88 -1.08
3 17 5 2 0.06 2.32 -0.78 -0.06 1.63 2.88 -1.37
3 17 6 0 NA NA NA NA NA NA NA
3 17 7 0 NA NA NA NA NA NA NA
3 17 8 0 NA NA NA NA NA NA NA
3 17 9 0 NA NA NA NA NA NA NA
3 17 10 0 NA NA NA NA NA NA NA
3 17 11 0 NA NA NA NA NA NA NA
3 17 12 0 NA NA NA NA NA NA NA
3 17 13 0 NA NA NA NA NA NA NA
3 17 14 0 NA NA NA NA NA NA NA
3 17 15 0 NA NA NA NA NA NA NA
3 18 1 7 0.09 1.31 0.09 -0.08 0.06 2.88 0.85
3 18 2 5 0.08 1.09 0.92 -0.73 -0.72 2.88 0.83
3 18 3 7 0.11 1.31 0.09 -0.25 -0.72 2.88 0.73
3 18 4 0 NA NA NA NA NA NA NA
3 18 5 0 NA NA NA NA NA NA NA

Let’s check the compression summary to check how many cells in each level are above the quantization error threshold.

segmentLevel noOfCells noOfCellsBelowQuantizationError percentOfCellsBelowQuantizationErrorThreshold
1 15 0 0
2 134 118 0.88
3 50 50 1

As it can be seen from the compression summary table above, the Quantization Error for most of the cells in level 3 fall below the defined quantization threshold. Hence, we were succesfully able to compress 89% of the data.

Figure 7: The Voronoi tessellation with the heat map overlaid for variable ’quant_error’ in the ’computers’ dataset

Figure 7: The Voronoi tessellation with the heat map overlaid for variable ’quant_error’ in the ’computers’ dataset

3.3 Overlay Heatmap

Now we will try to get more insights from the cells by overlaying heatmap for variable price at different levels.

Let’s do it for level one.

In the plot below, a heatmap for the variable price is overlayed on a level one tesselation plot. We calculate the mean price for each cell and represent it as a heatmap.

The heatmap for the price variable for different cells at level 1 can be seen in the plot below.

Figure 8: The Voronoi Tessellation with the heat map overlaid for variable ’price’ at level 1 from ’computers’ dataset

Figure 8: The Voronoi Tessellation with the heat map overlaid for variable ’price’ at level 1 from ’computers’ dataset

Now we will go one level deeper and overlay heatmap for price at level 2. This should give us better insight about the price distribution for different cells.

In the plot below, we have overlayed heatmap for the variable price at level 2.

Figure 9: The Voronoi tessellation with the heat map overlaid for the variable ’price’ at level 2 from the ’computer’ dataset

Figure 9: The Voronoi tessellation with the heat map overlaid for the variable ’price’ at level 2 from the ’computer’ dataset

Let us go one level deeper and overlay heatmap for price at level 3.

In the plot below, we have overlayed heatmap for variable price on level 3.

Figure 10: The Voronoi tessellation with the heat map overlaid for the variable ’price’ at level 3 from the ’computer’ dataset

Figure 10: The Voronoi tessellation with the heat map overlaid for the variable ’price’ at level 3 from the ’computer’ dataset

Let’s repeat the steps above for the speed variable

The heatmap for speed variable for different cells at level 1 can be seen in the plot below.

Figure 11: The Voronoi Tessellation with the heat map overlaid for variable ’speed’ at level 1 from ’computers’ dataset

Figure 11: The Voronoi Tessellation with the heat map overlaid for variable ’speed’ at level 1 from ’computers’ dataset

Now we will go one level deeper and overlay heatmap for speed at level 2

Figure 12: The Voronoi Tessellation with the heat map overlaid for the variable ’speed’ at level 2 from the ’computer’ dataset

Figure 12: The Voronoi Tessellation with the heat map overlaid for the variable ’speed’ at level 2 from the ’computer’ dataset

Let us go one level deeper and overlay heatmap for speed at level 3.

In the plot below, we have overlayed heatmap for variable speed on level 3.

Figure 13: The Voronoi Tessellation with the heat map overlaid for the variable ’speed’ at level 3 from the ’computer’ dataset

Figure 13: The Voronoi Tessellation with the heat map overlaid for the variable ’speed’ at level 3 from the ’computer’ dataset

3.4 Predict

Now once we have built the model, let us try to predict using our test dataset which cell and which level each point belongs to.

The important parameters for the function predictHVT are as below

3.4.1 Prediction Algorithm

The prediction algorithm recursively calculates the distance between each point in the test dataset and the cell centroids for each level. The following steps explain the prediction method for a single point in the test dataset :

  1. Calculate the distance between the point and the centroid of all the cells in the first level
  2. Find the cell whose centroid has minimum distance to the point
  3. Check if the cell drills down further to form more cells
  4. If it doesn’t, return the path. Or else repeat steps 1 to 4 till we reach a level at which the cell doesn’t drill down further

Let’s see which cell and level each point belongs to. For the sake of brevity, we will only show the first 10 rows

price speed hd ram screen ads Cell_path Segment.Level Segment.Parent Segment.Child
1540 33 214 4 15 191 2->9->2 2 9 2
3094 50 1000 24 15 191 2->6->7 2 6 7
1794 50 214 4 14 191 2->5->5 2 5 5
2408 100 270 4 14 191 2->3->2 2 3 2
2454 66 720 16 15 191 2->11->13 2 11 13
1969 66 1000 8 14 191 2->8->5 2 8 5
2904 50 1000 24 15 191 2->6->7 2 6 7
1545 66 340 8 14 191 2->8->4 2 8 4
1718 66 340 4 14 191 2->5->1 2 5 1
1604 33 214 4 14 191 2->9->3 2 9 3

We can see the predictions for some of the points in the table above. The variable cell_path shows us the level and the cell that each point is mapped to. The centroid of the cell that the point is mapped to is the codeword (predictor) for that cell.

The prediction algorithm will not work if some of the variables used to perform quantization are missing. Let’s try it out. In the test dataset, we should not remove any features.

price speed hd ram screen ads Cell_path Segment.Level Segment.Parent Segment.Child
1540 33 214 4 15 191 2->9->2 2 9 2
3094 50 1000 24 15 191 2->6->7 2 6 7
1794 50 214 4 14 191 2->5->5 2 5 5
2408 100 270 4 14 191 2->3->2 2 3 2
2454 66 720 16 15 191 2->11->13 2 11 13
1969 66 1000 8 14 191 2->8->5 2 8 5
2904 50 1000 24 15 191 2->6->7 2 6 7
1545 66 340 8 14 191 2->8->4 2 8 4
1718 66 340 4 14 191 2->5->1 2 5 1
1604 33 214 4 14 191 2->9->3 2 9 3

3.4.2 Example Usage 2

In this section, we will see how we can use the package to visualize mutlidimensional data by projecting them to two dimensions using Sammon’s projection.

3.4.2.1 Torus (Donut)

First of all, let us see how to generate data for torus. We are using a library geozoo for this purpose. Geo Zoo (stands for Geometric Zoo) is a compilation of geometric objects ranging from three to 10 dimensions. Geo Zoo contains regular or well-known objects, eg cube and sphere, and some abstract objects, e.g. Boy’s surface, Torus and Hyper-Torus.

Here we will generate a 3D torus with 1000 points.

Now let’s do some EDA on the data. First of all, we will see what the data looks like

x y z
-2.628238 0.5655770 -0.7253285
-1.417917 -0.8902793 0.9454533
-1.030820 1.1066495 -0.8730506
1.884711 0.1894905 0.9943888
-1.950608 -2.2506838 0.2070521
-1.482371 0.9228529 0.9672467

Now let’s have a look at summary and structure of the data.

Now let’s try to visualize the object in a 3D Space.

Figure 14: 3D Torus

Figure 14: 3D Torus

Now let’s try to use the package and project the above 3D object in a 2D Space. We will start with number of cells as 100.

Figure 15: The Voronoi tessellation for level 1 shown for the 100 cells in the dataset ’torus’

Figure 15: The Voronoi tessellation for level 1 shown for the 100 cells in the dataset ’torus’

Let’s checkout the compression summary for torus.

segmentLevel noOfCells noOfCellsBelowQuantizationError percentOfCellsBelowQuantizationErrorThreshold
1 100 77 0.77

As it can be seen in the table above, none of the 100 cells hit the quantization threshold error.

Let’s overlay the heatmap for quantization error for level 1.

Figure 16: The Voronoi Tessellation for level 1 with the heat map overlaid for variable ’quant_error’ in the ’torus’ dataset

Figure 16: The Voronoi Tessellation for level 1 with the heat map overlaid for variable ’quant_error’ in the ’torus’ dataset

Now let’s double the number of cells to 200 and try again.

Figure 17: The Voronoi tessellation for level 1 shown for the 200 cells in the dataset ’torus’

Figure 17: The Voronoi tessellation for level 1 shown for the 200 cells in the dataset ’torus’

Let’s checkout the compression summary for torus.

segmentLevel noOfCells noOfCellsBelowQuantizationError percentOfCellsBelowQuantizationErrorThreshold
1 200 194 0.97

It can be observed from the table above that only 24 cells out of 200 i.e. 12% of the cells hit the Quantization Error threshold.

Let’s understand this visually by overlaying the heatmap for Quantization Error at level2.

Figure 18: The Voronoi tessellation for level 2 with the heat map overlaid for variable ’quant_error’ in the ’torus’ dataset

Figure 18: The Voronoi tessellation for level 2 with the heat map overlaid for variable ’quant_error’ in the ’torus’ dataset

Let’s increase the number of cells to 500.

Figure 19: The Voronoi tessellation for level 1 shown for the 500 cells in the dataset ’torus’

Figure 19: The Voronoi tessellation for level 1 shown for the 500 cells in the dataset ’torus’

Let’s check the compression summary for torus.

segmentLevel noOfCells noOfCellsBelowQuantizationError percentOfCellsBelowQuantizationErrorThreshold
1 500 500 1

By increasing the number of cells to 500, we were successfully able to compress 73% of the data.

Let’s checkout the heatmap for quantization error.

Figure 20: The Voronoi tessellation with the heat map overlaid for variable ’quant_error’ in the ’torus’ dataset

Figure 20: The Voronoi tessellation with the heat map overlaid for variable ’quant_error’ in the ’torus’ dataset

Let’s use the hierarchical Vector Quantization technique and go one level deeper, keeping the number of cells as 20.

Figure 21: The Voronoi tessellation for level 2 shown for the 400 cells in the dataset ’torus’

Figure 21: The Voronoi tessellation for level 2 shown for the 400 cells in the dataset ’torus’

Let’s check the compression summary for torus.

segmentLevel noOfCells noOfCellsBelowQuantizationError percentOfCellsBelowQuantizationErrorThreshold
1 200 194 0.97
2 15 15 1

From the above table, we can observe that we were able to compress 58% of the data using hierarchical Vector Quantization.

Let’s also observe the Quantization Error heatmap.

Figure 22: The Voronoi tessellation with the heat map overlaid for variable ’quant_error’ in the ’torus’ dataset

Figure 22: The Voronoi tessellation with the heat map overlaid for variable ’quant_error’ in the ’torus’ dataset

A similar process can be followed for sphere. The code for the same can be found in the Appendix below.

4 Applications

  1. Pricing Segmentation - The package can be used to discover groups of similar customers based on the customer spend pattern and understand price sensitivity of customers

  2. Market Segmentation - The package can be helpful in market segmentation where we have to identify micro and macro segments. The method used in this package can do both kinds of segmentation in one go

  3. Anomaly Detection - This method can help us categorize system behaviour over time and help us find anomaly when there are changes in the system. For e.g. Finding fraudulent claims in healthcare insurance

  4. The package can help us understand the underlying structure of the data. Suppose we want to analyze a curved surface such as sphere or vase, we can approximate it by a lot of small low-order polygons in the form of tesselations using this package

  5. In biology, Voronoi diagrams are used to model a number of different biological structures, including cells and bone microarchitecture

  6. Using the base idea of Systems Dynamics, these diagrams can also be used to depict customer state changes over a period of time

5 References

  1. Vector Quantization : https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-450-principles-of-digital-communications-i-fall-2006/lecture-notes/book_3.pdf

  2. K-means : https://en.wikipedia.org/wiki/K-means_clustering

  3. Sammon’s Projection : http://en.wikipedia.org/wiki/Sammon_mapping

  4. Voronoi Tessellations : http://en.wikipedia.org/wiki/Centroidal_Voronoi_tessellation

6 Appendix

The code for constructing voronoi tesselations for 3D sphere can be found here.

6.1 Constructing 3D Sphere

Here also, we will generate 1000 points in 3D space to form a sphere.

Let’s get a quick-peek of the data

Now let’s have a look at a summary and the structure of the data.

Now let’s try to visualize the object in 3D Space.

Now let’s try to use the package and project the above 3D geographic object in 2D Space. Afain, we will start will number of cells as 100.

Let’s checkout the compression summary for sphere

It can be inferred from the table above that none of the cells hit the quantization error threshold.

Let’s overlay the heatmap for quantization error for level 1.

Let us try again by increasing the number of cells to 200.

Let’s checkout the compression summary for sphere

The table above shows that 9% cells were able to hit the quantization error threshold.

Let’s check the heatmap for quantization error

Now let’s increase the number of cells to 500.

Let’s checkout the compression summary for sphere

As per the table above, we were able to compress 78% of the data.

Let’s plot the heatmap for quantization error

We can do better here also

Let’s use our hierarchical vector quantization technique and go one level deeper. We will keep the number of cells as 24.

Let’s checkout the compression summary for torus

In this case also, 87% of the cells hit the quantization threshold error.

We will overlay the heatmap for quantization error.