THOI: An efficient and accessible library for computing higher-order interactions enhanced by batch-processing
Fig 2
Sub-covariance matrices sampled with padding to allow different covariance matrix sizes in a single batch.
1) First, a mask is applied to the full covariance matrices using a masked encoding of the n-plets (each with a different number of masked variables) to obtain each sub-covariance matrix. At this point, the obtained covariance matrices are invalid as the masked rows and columns have zeros on the diagonal, yielding a constant distribution. 2) Then, an identity matrix is masked with the inverted n-plet encodings. 3) Both masked matrices are added to obtain the final covariance matrix where the rows and columns of the n-plet have the values from the full covariance matrix, and the remaining rows and columns have ones on the diagonal and zeros elsewhere, representing an independent standard normal component.