npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@thht/ml_threshold

v0.0.3

Published

Maximum Likelihood Threshold Hunting according to Green 1993

Readme

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

| 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. |