0.0.3 • Published 5 years ago
@thht/ml_threshold v0.0.3
Maximum Likelihood Threshold Hunting according to Green 1993
This library implements the threshold hunting procedure described by Green 1993.
It basically stores a set of psychometric functions with different parameters:
- "Mean", i.e. where the function's infliction point is. In a threshold paradigm with 0% false alarm rate, this is the 50% point.
- False alarm rate.
- Slope of the psychometric function.
The library provides a convenient class "MLThresholdHunter" who does all the background work.
It is the job of the developer to:
- Choose meaningful parameters.
- Stimulate the participant (or whatever you are stimulating!) at the level provided by the
current_probe_valueproperty. - Provide the answer (
trueorfalse) to the instance of the instance of the class. - Check whether
stopistrue. - If not, repeat from 2.
- If
stopistrue,current_guessis your threshold.
Reference
MLThresholdHunter
Kind: global class
Properties
| Name | Type | Description |
|---|---|---|
| best_function | PsychometricFunction | The most likely psychometric function |
| current_probe_value | number | The value that should be probed next |
| current_guess | number | The current guess of the value at the infliction point |
| n_trials | number | The completed number of trials |
| guesses | Array | The guesses so far |
| std_last_trials | number | The stddev of the last use_n_trials_for_stop trials |
| stop_std | number | The stddev at which to stop |
| converged | bool | True if converged |
| stop | bool | True if either converged or maximum trials exceeded. |
new MLThresholdHunter(start_value, values_range, false_alarm_range, slopes_range, min_trials, max_trials, use_n_trials_for_stop)
Maximum Likelihood Threshold Hunting
| Param | Type | Default | Description |
|---|---|---|---|
| start_value | number | The start value | |
| values_range | mathjs.matrix | Array | The possible values | |
| false_alarm_range | mathjs.matrix | Array | The possible false alarm rates | |
| slopes_range | mathjs.matrix | Array | The possible slopes | |
| min_trials | number | 12 | The minimum amount of trials before the algorithm can stop. |
| max_trials | number | 40 | The maximum number of trials. |
| use_n_trials_for_stop | number | 6 | Use last n trials for stop criterion. |
mlThresholdHunter.process_response(response, value)
Process a response
Kind: instance method of MLThresholdHunter
| Param | Type | Description |
|---|---|---|
| response | bool | The response, true or false |
| value | number | The value at which the response was obtained. If undefined, use current_probe_value. |