row_entropies: Entropy of sparse-matrix rows

row_entropiesR Documentation

Entropy of sparse-matrix rows

Description

Given a sparse matrix in which each row is a discrete probability distribution over the index, takes the entropy -∑_j x_j \log_2 x_j row-wise (considering only non-zero entries).

Usage

row_entropies(m)

Arguments

m

sparse Matrix.

Value

ordinary vector of entropies.


agoldst/dfrtopics documentation built on July 15, 2022, 4:13 p.m.