CMIBiCondimat2vecPermu {conMItion} | R Documentation |
Permuted Normalized Conditional Mutual Information Between Matrix and Vector Given Two Conditions
Description
Computes the conditional mutual information (CMI) between a random vector sampled from a matrix and a vector, conditioned on two vectors, normalized by the mutual information of the vector with itself. The sampling is done multiple times to generate a distribution.
Usage
CMIBiCondimat2vecPermu(
mat,
vec,
condi1,
condi2,
bin = 6,
sp_order = 2,
bulkIdx = 0,
permutationTimes = 1000,
seedNum = 99999999
)
Arguments
mat |
A numeric matrix. For example, each row represents a gene and each column represents a sample. |
vec |
A numeric vector, with length equal to the number of columns in 'mat'. |
condi1 |
A numeric condition vector, matching the number of columns in 'mat'. |
condi2 |
Another numeric condition vector, matching the number of columns in 'mat'. |
bin |
An integer specifying the number of bins. Default is 6. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is 2. |
bulkIdx |
Index to divide the task when processing many permutations. Default is 0. |
permutationTimes |
Number of permutations for sampling. Default is 1000. |
seedNum |
Seed for random number generation. Default is 99999999. |
Value
A numeric vector of normalized conditional mutual information (CMI) values for each permutation.
Examples
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100)
vec <- rnorm(100)
condi1 <- rnorm(100)
condi2 <- rnorm(100)
CMIBiCondimat2vecPermu(mat, vec, condi1, condi2)