I have measurements of 4 devices at two different points of time. A measurement basically consists of an array of ones and zeros corresponding to a bit value at the corresponding location:

whos measurement1_dev1_time1

Name                         Size               Bytes  Class      Attributes

measurement1_dev1_time1      4096x8             32768  logical

I assume that for a specific device the changes between time 1 and 2 of the measurements are unique. However, since I am dealing with 32768 bits at different locations, it is quite hard to visualize if there is some kind of dependency.

As every bit at location xcan be regarded as one dimension of an observation I thought to use PCA to reduce the number of dimensions.

Thus, for every of the 5 devices:

  1. I randomly sample n measurements at point t1and t2 seperatly
  2. I prepare an array as input for pca() with m*n columns (m< 32768; its a subset of all the observed bits, as the original data might be too big for pca) and 4 rows (one row for each device).
  3. On this array A I calculate the pca: ``[coeff score latent] = pca(zscore(A))```
  4. Then I try to visualize it using biplot: biplot(coeff(:,1:2), 'score', score(:,1:2))

However, this gives me really strange results. Maybe PCA is not the right approach for this problem? I also modified the input data to do the PCA not on the logical bit array itself. Instead, I created a vector, which holds the indices where there is a '1' in the original measurement array. Also this produces strange results.

As I am completely new to PCA I want to ask you if you either see a flaw in the process or if PCA is just not the right approach for my goal and I better look for other dimension reduction approaches or clustering algorithms.


1 Answer 1


Standard PCA only sees your data as real values and hence doesn't really provide the best low rank approximation. There exist versions of PCA designed for boolean data types. Personally I think the best paper covering the whole broad topic of generalised PCA is Generalized Low Rank Models. In section 5.2 they specifically cover Boolean PCA.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.