psifr.stats.count_lags#

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

Count actual and possible serial position lags.

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

rank_lags

Rank of serial position lags.

Examples

>>> from psifr import stats
>>> pool_items = [[1, 2, 3, 4]]
>>> recall_items = [[4, 2, 3, 1]]
>>> actual, possible = stats.count_lags(4, pool_items, recall_items)
>>> actual
lag
-3    0
-2    2
-1    0
 0    0
 1    1
 2    0
 3    0
dtype: int64
>>> possible
lag
-3    1
-2    2
-1    2
 0    0
 1    1
 2    0
 3    0
dtype: int64