mutinfo: Mutual information

Description Usage Arguments Details Value Source Examples

View source: R/mutinfo.R

Description

Mutual information

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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 March 19, 2018, 1:26 p.m.