probThresh

model.decision.discrete.probThresh(task_responses=(0, 1), eta=0.8)[source]

Decisions for an arbitrary number of choices

Choice made by choosing when certain (when probability above a certain value), otherwise randomly

Parameters:
  • task_responses (tuple) – Provides the action responses expected by the tasks for each probability estimate.
  • eta (float, optional) – The value above which a non-random decision is made. Default value is 0.8
Returns:

  • decision_function (function) – Calculates the decisions based on the probabilities and returns the decision and the probability of that decision
  • decision (int or None) – The action to be taken by the model
  • probDict (OrderedDict of valid responses) – A dictionary of considered actions as keys and their associated probabilities as values

Examples

>>> np.random.seed(100)
>>> d = probThresh(task_responses=[0, 1, 2, 3], eta=0.8)
>>> d([0.2, 0.8, 0.3, 0.5])
(1, OrderedDict([(0, 0.2), (1, 0.8), (2, 0.3), (3, 0.5)]))
>>> d([0.2, 0.8, 0.3, 0.5], trial_responses=[0, 2])
(0, OrderedDict([(0, 0.2), (1, 0.8), (2, 0.3), (3, 0.5)]))
>>> d([0.2, 0.8, 0.3, 0.5], trial_responses=[])
(None, OrderedDict([(0, 0.2), (1, 0.8), (2, 0.3), (3, 0.5)]))
>>> d = probThresh(["A","B","C"])
>>> d([0.2, 0.3, 0.8], trial_responses=["A", "B"])
('A', OrderedDict([('A', 0.2), ('B', 0.3), ('C', 0.8)]))