Description Usage Arguments Details Value Author(s) References Examples
Calculate the average mutual information of transitions.
1 | mi(pxy)
|
pxy |
a matrix indicating the joint distribution across all interactions of X and Y (must sum to 1) in the form:
|
Calculate matrix product of pxy
and log base 2 of the
ratio of pxy
over the standard product of px
and py
,
then sum.
∑ -p(x_i,y_j) * log2 p(x_i,y_j) = -p(1,1) * log2 p(1,1) + -p(1,2) * log2 p(1,2) + … + -p(i,j) * log2 p(i,j)
Returns a value indicating the Shannon diversity of all transitions.
Bjorn J. Brooks, Lars Y. Pomara, Danny C. Lee
PAPER TITLE.
1 2 3 4 5 6 7 8 9 10 11 12 | data(transitions) # Load example data
b <- brkpts(transitions$phenofr, # Find 10 probabilistically
10) # equivalent breakpoints
m <- xt(transitions, # Make transition matrix
fr.col=2, to.col=3,
cnt.col=4, brk=b)
pxy <- jpmf(m) # Joint distribution
mi <- mi(pxy) # Avg mutual information of X and Y
# Now calculate MI using a second method (answers should be identical)
mi2 <- sum(pxy * log2( cpf(pxy, margin='p(col|row)') / colSums(pxy)),
na.rm=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.