Learn R Programming

conMItion (version 0.2.1)

MImat2vec: Normalized Mutual Information Between Matrix and Vector

Description

Computes the normalized mutual information (MI) between each row of a matrix and a numeric vector normalized by the mutual information of the vector with itself using the specified number of bins and spline order.

Usage

MImat2vec(mat, vec, bin = 6, sp_order = 2)

Value

A numeric vector representing the normalized mutual information (MI) between each row of `mat` and `vec`.

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`.

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.

Examples

Run this code
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100)
vec <- rnorm(100)
MImat2vec(mat, vec)

Run the code above in your browser using DataLab