anchor.diff:  
   [[black-boxing-time-series]]
   == Black-Boxing Time Series
  +It is often useful when analyzing complex systems to black-box components of the system.
  +This process amounts to grouping components of the system and treating them as a single
  +entity, without regard for its small-scale structure. As an example, consider you have two
  +Boolean random variables stem:[X] and stem:[Y], and you observe time series of each
  +simultaneously:
  +[stem]
  +++++
  +X:\ \{0,1,1,0,1,0,0,1\}\\
  +Y:\ \{1,0,0,1,1,0,1,0\}
  +++++
  +It may be worthwhile to consider these observations as observations of the joint
  +variable stem:[(X,Y)]:
  +[stem]
  +++++
  +(X,Y):\ \{(0,1),(1,0),(1,0),(0,1),(1,1),(0,0),(0,1),(1,0)\}.
  +++++
  +The joint observations can then be naturally encoded, for example, as base-4 states
  +[stem]
  +++++
  +(X,Y):\ \{1,2,2,1,3,0,1,2\}.
  +++++
  +We refer this process of mapping the observations of stem:[X] and stem:[Y] to the encoded
  +observations of stem:[(X,Y)] as black boxing. In this case, the black boxing procedure is
  +performed in "space" (you might think of stem:[X] and stem:[Y] having locations in space).
  +We may also black box in time. The canonical example of this is considering the
  +stem:[k]-history of a random variable:
  +[stem]
  +++++
  +X:\       \{0,1,1,0,1,0,0,1\}\\
  +X^{(2)}:\ \{((0,1),(1,1),(1,0),(0,1),(1,0),(0,0),(0,1)\},
  +++++
  +and the observations of stem:[X^{(2)}] can be encoded as base-4 states:
  +[stem]
  +++++
  +X^{(2)}:\ \{(1,3,2,1,2,0,1\}.
  +++++
  +
  +We provide a basic black-boxing function that allows the user to black-box in both space and
  +into the future and past of a collection of random variable <<inform_black_box>>. The
  +<<inform_black_box_parts>> allows the user to black-box time series based on a
  +<<partitioning-time-series,partitioning scheme>> (useful in the implementation of
  +integration measures such as <<evidence-of-integration>>).
   
   ****
   [[inform_black_box]]
  
positive.code:         int const *b, size_t const *parts, size_t nparts, int *box,
          inform_error *err);
  ----
  [horizontal]
  Headers::
      `inform/utilities.h`,
  
negative.code:         int const *b, size_t const *r, size_t const *s, int *box,
          inform_error *err);
  ----
  Black-box a collection of `l` time series (each with shape `(n,m)`) with bases `b` into a
  single time series with base `b[0]*...*b[l-1]`. History lengths for each time series may be
  provided through `r` and future lengths through `l`.
  
  *Examples:*
  
  _Example 1_: Black-box two time series with no history or futures:
  [source,c]
  ----
  inform_error err = INFORM_SUCCESS;
  int const series[16] = {
      0,1,1,0,1,0,0,1,
      1,0,0,1,1,0,1,0,
  };
  int b[2] = {2,2};
  
  int box[8];
  inform_black_box(series, 2, 1, 8, b, NULL, NULL, box, &err);
  assert(!err);
  // box ~ { 1 2 2 1 3 0 1 2 }
  ----
  This is the first example described in <<black-boxing-time-series>>.
  
  _Example 2_: Black-box a single time series in time with history length 2:
  [source,c]
  ----
  inform_error err = INFORM_SUCCESS;
  int const series[8] = {
      0,1,1,0,1,0,0,1,
  };
  int b = 2;
  
  size_t r = 2;
  int box[7];
  inform_black_box(series, 1, 1, 8, &b, &r, NULL, box, &err);
  assert(!err);
  // box ~ { 1 3 2 1 2 0 1 }
  ----
  This is the second example described in <<black-boxing-time-series>>.
  
  _Example 3_: Black-box two time series with histories and futures:
  In this example we consider two time series:
  [stem]
  ++++
  X:\ \{0,1,1,0,1,0,0,1\}\\
  Y:\ \{1,0,0,1,1,0,1,0\}
  ++++
  and produce observations of stem:[(X^{(2,0)},Y^{(1,1)})]
  [stem]
  ++++
  (X^{(2,0)},Y^{(1,1)}):\ \{(0,1,0,0),(1,1,0,1),(1,0,1,1),(0,1,1,0),(1,0,0,1),(0,0,1,0)\}
  ++++
  encoded as
  [stem]
  ++++
  (X^{(2,0)},Y^{(1,1)}):\ \{4,13,11,6,9,2\}.
  ++++
  
  [source,c]
  ----
  inform_error err = INFORM_SUCCESS;
  int const series[16] = {
      0,1,1,0,1,0,0,1,
      1,0,0,1,1,0,1,0,
  };
  int b[2] = {2,2};
  
  size_t r[2] = {2,1};
  size_t s[2] = {0,1};
  int box[6];
  inform_black_box(series, 2, 1, 8, b, r, s, box, &err);
  assert(!err);
  // box ~ { 4 13 11 6 9 2 }
  ----
  
  [horizontal]
  Headers::
      `inform/utilities.h`,
  