model.decision.binary module

Author:Dominic Hunt

A collection of decision making functions where there are only two possible actions

model.decision.binary.single(task_responses=(0, 1))[source]

Decisions using a switching probability

Parameters:task_responses (tuple of length two, optional) – Provides the two action responses expected by the task
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
  • probabilities (OrderedDict of valid responses) – A dictionary of considered actions as keys and their associated probabilities as values

Examples

>>> np.random.seed(100)
>>> dec = single()
>>> dec(0.23)
(0, OrderedDict([(0, 0.77), (1, 0.23)]))
>>> dec(0.23, 0)
(0, OrderedDict([(0, 0.77), (1, 0.23)]))