0.0.3 • Published 4 years ago

@thht/ml_threshold v0.0.3

Weekly downloads
83
License
GPL-3.0-or-later
Repository
gitlab
Last release
4 years ago

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:

  1. "Mean", i.e. where the function's infliction point is. In a threshold paradigm with 0% false alarm rate, this is the 50% point.
  2. False alarm rate.
  3. 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:

  1. Choose meaningful parameters.
  2. Stimulate the participant (or whatever you are stimulating!) at the level provided by the current_probe_value property.
  3. Provide the answer (true or false) to the instance of the instance of the class.
  4. Check whether stop is true.
  5. If not, repeat from 2.
  6. If stop is true, current_guess is your threshold.

Reference

MLThresholdHunter

Kind: global class
Properties

NameTypeDescription
best_functionPsychometricFunctionThe most likely psychometric function
current_probe_valuenumberThe value that should be probed next
current_guessnumberThe current guess of the value at the infliction point
n_trialsnumberThe completed number of trials
guessesArrayThe guesses so far
std_last_trialsnumberThe stddev of the last use_n_trials_for_stop trials
stop_stdnumberThe stddev at which to stop
convergedboolTrue if converged
stopboolTrue 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

ParamTypeDefaultDescription
start_valuenumberThe start value
values_rangemathjs.matrix | ArrayThe possible values
false_alarm_rangemathjs.matrix | ArrayThe possible false alarm rates
slopes_rangemathjs.matrix | ArrayThe possible slopes
min_trialsnumber12The minimum amount of trials before the algorithm can stop.
max_trialsnumber40The maximum number of trials.
use_n_trials_for_stopnumber6Use last n trials for stop criterion.

mlThresholdHunter.process_response(response, value)

Process a response

Kind: instance method of MLThresholdHunter

ParamTypeDescription
responseboolThe response, true or false
valuenumberThe value at which the response was obtained. If undefined, use current_probe_value.
0.0.3

4 years ago

0.0.2

6 years ago

0.0.1

6 years ago