A computer implemented method of preparing a multidimensional histogram for a data array, the data array characterized by a data array size and including data, the method having an execution time proportional to the data array size and using an amount of storage space substantially smaller than the data array size, the method comprising:
- receiving data from the data array;
- transforming the data into linear combinations of data items, or of approximations of the linear combinations of data items;
- collecting a moderate number of substantially-largest coefficient linear combinations of the data;
- and
- forming the multidimensional histogram as a histogram to the collected linear combinations.