info_flow: Information Flow

Description Usage Arguments Value Examples

View source: R/infoflow.R

Description

Compute the information flow from lsrc time series src to another ldst time series dst. Optionally, the user can specify lback background time series back to conditioning probabilities.

Usage

1
info_flow(src, dst, back = NULL, lsrc, ldst, lback = 0)

Arguments

src

Vector or matrix specifying one or more source time series.

dst

Vector or matrix specifying one or more destination time series.

back

Vector or matrix specifying one or more background time series.

lsrc

Integer giving the number of sources.

ldst

Integer giving the number of destinations.

lback

Integer giving the number of backgrounds.

Value

Numeric giving the value of information flow.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Information flow across four time series:
ws <- c(0, 0, 1, 0, 1, 1, 0, 1)
xs <- c(0, 0, 1, 0, 1, 1, 0, 1)
ys <- c(0, 0, 1, 0, 1, 1, 0, 1)
zs <- c(0, 0, 0, 0, 0, 0, 0, 0)

info_flow(src = xs, dst = ys, lsrc = 1, ldst = 1)                            # flow ~ 1.0
info_flow(src = xs, dst = ys, back = ws, lsrc = 1, ldst = 1, lback = 1)      # flow ~ 0.0
info_flow(src = ws, dst = zs, back = ys, lsrc = 1, ldst = 1, lback = 1)      # flow ~ 0.0

# Now let's intervene on ys and zs
ws <- c(0, 0, 1, 0, 1, 1, 0, 1)
xs <- c(0, 0, 1, 0, 1, 1, 0, 1)
ys <- c(1, 0, 1, 0, 0, 1, 1, 0)
zs <- c(1, 0, 0, 0, 1, 0, 1, 1)
info_flow(src = xs, dst = ys, lsrc = 1, ldst = 1)                            # flow ~ 0.0
info_flow(src = xs, dst = ys, back = ws, lsrc = 1, ldst = 1, lback = 1)      # flow ~ 0.0
info_flow(src = ws, dst = zs, back = ys, lsrc = 1, ldst = 1, lback = 1)      # flow ~ 1.0

rinform documentation built on April 1, 2018, 12:12 p.m.