class documentation
class UpDownDetector: (source)
UpDownDetector
A class for handling an x-up y-down experiment setup Detects and counts reversals and whether the stimulus parameter should be increased or decreased
| Method | __init__ |
No summary |
| Method | __len__ |
Undocumented |
| Method | get |
Returns the log for the given parameter. |
| Method | get |
No summary |
| Method | next |
Takes the answer, can be anything, but should be either equal to `correct` or `wrong`, provided in `__init__` (default is int(1) for correct and int(0) for wrong). |
| Method | reset |
Reset the internal counters, as if a new experiment is started |
| Instance Variable | consecutive |
Undocumented |
| Instance Variable | consecutive |
Undocumented |
| Instance Variable | correct |
Undocumented |
| Instance Variable | entry |
Undocumented |
| Instance Variable | experiment |
Undocumented |
| Instance Variable | last |
Undocumented |
| Instance Variable | number |
Undocumented |
| Instance Variable | response |
Undocumented |
| Instance Variable | wrong |
Undocumented |
| Method | _update |
Undocumented |
| Parameters | |
entry:int | refers to the "Entry" column in Table 1 of Levitt 1971 (default: 2) |
| correct | response that represents a correct answer |
| wrong | response that represents an incorrect answer |
Returns the log for the given parameter.
If log is empty, None is returned
| Parameters | |
| parameter | parameter to return from log |
| Raises | |
ValueError | if parameter is not in log keys |
| Parameters | |
| n | number of reversals to include |
| Returns | |
| the mean parameter value from the last n_reversals | |
Takes the answer, can be anything, but should be either equal to `correct` or `wrong`, provided in `__init__` (default is int(1) for correct and int(0) for wrong).
| Parameters | |
| answer | Any type, but must be compatible with `answer == self.correct` and `answer == self.correct` |
| parameter | Any type that can be summed and calculated the mean of. |
| Returns | |
| 0 : whether the stimulus parameter should be updated up or down (1 or -1), or kept as is (0) 1 : whether a reversal occurred (True or False) | |