psifr.stats.count_lags_compound#

psifr.stats.count_lags_compound(list_length, pool_items, recall_items, pool_label=None, recall_label=None, pool_test=None, recall_test=None, test=None, count_unique=False)#

Count lags conditional on the lag of the previous transition.

Parameters:
  • list_length (int) – Number of items in each list.

  • pool_items (list) – List of the serial positions available for recall in each list. Must match the serial position codes used in recall_items.

  • recall_items (list) – List indicating the serial position of each recall in output order (NaN for intrusions).

  • pool_label (list, optional) – List of the positions to use for calculating lag. Default is to use pool_items.

  • recall_label (list, optional) – List of position labels in recall order. Default is to use recall_items.

  • pool_test (list, optional) – List of some test value for each item in the pool.

  • recall_test (list, optional) – List of some test value for each recall attempt by output position.

  • test (callable) – Callable that evaluates each transition between items n and n+1. Must take test values for items n and n+1 and return True if a given transition should be included.

  • count_unique (bool, optional) – If true, only unique values will be counted toward the possible transitions. If multiple items are avilable for recall for a given transition and a given bin, that bin will only be incremented once. If false, all possible transitions will add to the count.

Returns:

  • actual (pandas.Series) – Count of actual lags that occurred in the recall sequence.

  • possible (pandas.Series) – Count of possible lags.

See also

count_lags

Count of individual transitions.

Examples

>>> from psifr import stats
>>> pool_items = [[1, 2, 3]]
>>> recall_items = [[3, 1, 2]]
>>> actual, possible = stats.count_lags_compound(3, pool_items, recall_items)
>>> (actual == possible).all()
True
>>> actual
previous  current
-2        -2         0
          -1         0
           0         0
           1         1
           2         0
-1        -2         0
          -1         0
           0         0
           1         0
           2         0
 0        -2         0
          -1         0
           0         0
           1         0
           2         0
 1        -2         0
          -1         0
           0         0
           1         0
           2         0
 2        -2         0
          -1         0
           0         0
           1         0
           2         0
dtype: int64