Skip to main content

SweetSpot is a small Python package for adaptive psychophysical procedures and psychometric-function estimation. It is intended to keep the core experimental logic lightweight and explicit, with numpy as the only required numerical dependency and matplotlib optionally used for visualization and diagnostics.

The package provides:

  • PsychophysicalData, for storing and collating stimulus/response data.

  • PsychometricFunction, a four-parameter psychometric-function model with configurable sigmoid shapes, priors, parameter grids, likelihoods, posterior summaries, and simulated responses.

  • PsychometricLinkFunction subclasses such as Logistic and Gumbel. Weibull behavior is represented as a Gumbel function in log-stimulus space, via LogTransform, which avoids the numerical awkwardness of native Weibull parameterizations near zero.

  • Parameterizable prior distributions such as Gaussian, with mutable named properties (mu, sigma) and change notifications that support live visualization of the effect of the prior.

  • WUD, an implementation of Kaernbach's weighted up-down staircase: a simple, useful, old-fashioned adaptive procedure.

  • QUEST, a classic Watson-and-Pelli-style Bayesian threshold tracker, built on the same posterior-update machinery as the more general Bayesian procedures.

  • PsiMarginal, a discrete-grid implementation of Prins's psi-marginal method. It maintains a posterior over psychometric-function parameters, marginalizes over nuisance parameters, and chooses stimuli to reduce uncertainty in the parameter or parameters of interest. With parameterOfInterest='alpha,beta' and fixed asymptote parameters, it can also be configured to behave like the classic Psi method of Kontsevich and Tyler.

  • Simulate(), a convenience function for testing adaptive procedures against simulated observers and visualizing their behavior.

  • Experiment, an abstract end-to-end runner that connects adaptive stimulus selection to experiment-specific presentation and response hooks, with live visualization, feedback, reproducible randomization, and data persistence.

  • Scale, a class for defining piecewise/overlapping relationships between single nominal difficulty <-> achievability axis (controllable by an adaptive procedure) and the actual physical variables that can be manipulated to make a task easier or harder.

SweetSpot is applicable not only in psychophysics, but also in adaptive motor performance tasks, where the goal may be to find a useful challenge level for a training/rehab session or to track improvement across sessions. That secondary motivation shows up slightly in the API design---the existence of the Scale class, for example, or the fact that the PsiMarginal implementation treats slope as a nuisance parameter by default.

SweetSpot is public-domain software released under CC0.

Metadata

Release files for SweetSpot 1.15.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for SweetSpot 1.15.1
File Interpreter ABI Platform
sweetspot-1.15.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / sweetspot-1.15.1-py2.py3-none-any.whl

Download URL sweetspot-1.15.1-py2.py3-none-any.whl
Size 93.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
03fa83aabeb9cd7aa2f3c5c1a741d967b70ae5061045945ec9728be9ced77a10
BLAKE2b-256 checksum
How to use checksums
a180ffd8eaede3016aa62ecc4b12dc18a801bcab75b473d8e8085cc24b26c585
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.15.1 This release

1 release file

1.14.0

1 release file

1.13.3

1 release file

1.13.2

1 release file

1.13.1

1 release file

1.13.0

1 release file

1.12.1

1 release file

1.12.0

1 release file

1.11.1

1 release file

1.11.0

1 release file

1.10.0

1 release file

1.9.0

1 release file

1.8.1

1 release file

1.8.0

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.0

1 release file

1.4.0

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page