glambox.analysis

aggregate_subject_level_data(data, n_items)

Compute subject-level response characteristics on: RT, P(choose best), gaze influence score

The gaze influence score is defined as the average difference between the corrected choice probability of all positive and negative relative gaze values (see manuscript)

Parameters:
  • data (pandas.DataFrame) –

    DataFrame containing the experimental data. Each row corresponds to one trial. Must include the following columns:

    • subject (int, consecutive, starting with 0)
    • trial (int, starting with 0)
    • choice (int, items should be 0, 1, …, N)
    • rt (float, in seconds)
    • additional variables coding groups or conditions (str or int)

    For each item i in the choice set:

    • item_value_i: The item value (float, best on a scale between 1 and 10)
    • gaze_i: The fraction of total trial time the item was looked at in the trial (float, between 0 and 1)
  • n_items (int) – number of choice alternatives in the data
Returns:

DataFrame of subject-level response characteristics.

Return type:

pandas.DataFrame

aggregate_group_level_data(data, n_items)

Compute group-level response characteristics on: RT, P(choose best), gaze influence score

The gaze influence score is defined as the average difference between the corrected choice probability of all positive and negative relative gaze values (see manuscript)

Parameters:
  • data (pandas.DataFrame) –

    DataFrame containing the experimental data. Each row corresponds to one trial. Must include the following columns:

    • subject (int, consecutive, starting with 0)
    • trial (int, starting with 0)
    • choice (int, items should be 0, 1, …, N)
    • rt (float, in seconds)
    • additional variables coding groups or conditions (str or int)

    For each item i in the choice set:

    • item_value_i: The item value (float, best on a scale between 1 and 10)
    • gaze_i: The fraction of total trial time the item was looked at in the trial (float, between 0 and 1)
  • n_items (int) – number of choice alternatives in the data
Returns:

DataFrame of group-level response characteristics

Return type:

pandas.DataFrame

compare_parameters(model, parameters=['v', 's', 'gamma', 'tau'], comparisons=None, **kwargs)

Perform comparisons between parameters and return statistics as DataFrame

Parameters:
  • model (glambox.GLAM) – Fitted glambox.GLAM instance
  • parameters (list of str, optional) – List of parameters to perform comparisons on. Defaults to all model parameters.
  • comparisons (list of tuples, optional) – List of comparisons between groups or conditions. Each comparison must be given as a tuple (e.g., [(‘A’, ‘B’), (‘A’, ‘C’)]) Defaults to None.
Returns:

Distribution statistics of parameter differences.

Return type:

pandas.DataFrame

compare_models(models, **kwargs)

Compares multiple fitted models.

Parameters:
  • models (list of glambox.GLAM) – List of fitted GLAM model instances.
  • **kwargs (optional) – Additional keyword arguments to be passed to pymc3.compare
Returns:

DataFrame containing information criteria for each model.

Return type:

pandas.DataFrame