max_entropy: Find the so-called maximum entropy solution

Description Usage Arguments Value Examples

Description

The maximum entropy solution is obtained by spreading the edge weights as evenly as possible throught the weighted adjacency matrix. This version forces the diagonal elements to be zero along with any rows (columns) that have a zero row (column) sum in the input.

Missing values are allowed but will result in a warning. The usefulness of such results is up to the user.

Usage

1
2
3
4
5
6
7
max_entropy(rs, ...)

## S3 method for class 'data.frame'
max_entropy(rs, ...)

## S3 method for class 'numeric'
max_entropy(rs, cs, minError = 1e-18, ...)

Arguments

rs

Either a data.frame object containing row sums (first) and column sums (second) and optionally a vector of node names in any column. Or a vector of row sums only if the column sums, cs, are also supplied. For a data.frame the row and column sums are extracted and passed to max_entropy.numeric

...

extra arguments passed to max_entropy.numeric

cs

NumericVector the column sums of the matrix.

minError

Numeric. The algorithm will keep iterating until the mean squared error against the constraints drops below this value.

Value

A matrix that satisfies the row and column sum constraints or FALSE if the algorithm failed to converge. Dimension names will be pulled through if available from the data or from the names of rs.

Examples

1
2

dougmet/unsumnet documentation built on May 15, 2019, 10:44 a.m.