mutinfo: Mutual information

View source: R/mutinfo.R

mutinfoR Documentation

Mutual information

Description

Mutual information

Usage

mutinfo(S1, S2)

Arguments

S1

character of length 1 or longer, contains the sequence

S2

character of length 1 or longer, contains the sequence

Details

one thing to notice is that we assume that if both sequences are uniform the mutual information is 1 (regardless of length, but in our titi data set sequence length is constant...). Also, the function will return NaN or NA if one of the sequences is uniform (exists of only one syllable/call type). Whether this is correct behaviour or a bug, I can't say at the moment...

Value

numeric

Source

Matlab function by A. Kershenbaum

Examples

S1 <- "AAABBCA"
S2 <- "AAACCAB"
mutinfo(S1, S2)

S1 <- "AAAAAAA"
S2 <- "AAAAAAA"
mutinfo(S1, S2)

S1 <- "AAAAAAB"
S2 <- "BBBBBAA"
mutinfo(S1, S2)

S1 <- "AAAAAAA"
S2 <- "BBBCCAA"
mutinfo(S1, S2)

gobbios/cfp documentation built on April 11, 2022, 2:22 a.m.