Description Usage Arguments Value Examples
View source: R/separableinfo.R
Compute the average or local separable information of dest
given a
set of sources srcs
and history length k
.
1 | separable_info(srcs, dest, k, local = FALSE)
|
srcs |
Vector or matrix specifying one or more sources. |
dest |
Vector or matrix specifying one destination. |
k |
Integer giving the history length. |
local |
Boolean specifying whether to compute the local or average separable information. |
Numeric giving the average separable information or a vector giving the local separable information.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | # One initial condition and one source:
dest <- c(0, 1, 1, 1, 1, 0, 0, 0, 0)
srcs <- c(0, 0, 1, 1, 1, 1, 0, 0, 0)
separable_info(srcs, dest, k = 2) # si ~ 0.591673
# ..and local variant:
si <- separable_info(srcs, dest, k = 2, local = TRUE)
# si ~ { 1.222 0.637 0.637 -0.778 0.807 0.807 0.807 }
t(si)
# One initial condition and multiple sources:
dest <- c(0, 1, 1, 1, 1, 0, 0, 0, 0)
srcs <- matrix(0, nrow = 9, ncol = 2)
srcs[, 1] <- c(0, 0, 1, 1, 1, 1, 0, 0, 0)
srcs[, 2] <- c(1, 1, 1, 1, 0, 0, 0, 0, 0)
separable_info(srcs, dest, k = 2) # si ~ 0.985228
# ..and local variant:
si <- separable_info(srcs, dest, k = 2, local = TRUE)
# si ~ { 1.222 1.222 1.222 0.807 0.807 0.807 0.807 }
t(si)
# Multiple initial conditions and multiple sources:
dest <- matrix(0, nrow = 9, ncol = 2)
dest[, 1] <- c(0, 1, 1, 1, 1, 0, 0, 0, 0)
dest[, 2] <- c(1, 1, 0, 1, 1, 0, 1, 1, 0)
srcs <- matrix(0, nrow = 9, ncol = 4)
srcs[, 1] <- c(0, 0, 1, 1, 1, 1, 0, 0, 0)
srcs[, 2] <- c(1, 1, 1, 1, 1, 0, 1, 1, 0)
srcs[, 3] <- c(1, 1, 1, 1, 0, 0, 0, 0, 0)
srcs[, 4] <- c(0, 0, 0, 0, 1, 1, 1, 1, 0)
separable_info(srcs, dest, k = 2) # si ~ 0.625349
# ..and local variant:
si <- separable_info(srcs, dest, k = 2, local = TRUE)
# si ~ { 1.000 -0.000 -0.000 1.000 0.585 1.000 1.000
# 1.000 -0.415 1.000 -0.000 1.585 1.000 -0.000 }
t(si)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.