phontrast: Contrast and Separation Metrics for Phonological Categories

Computes and compares multiple measures of separation and overlap between phonological categories (for example vowels or consonants) in arbitrary multi-dimensional acoustic spaces such as formant values, mel-frequency cepstral coefficients (MFCCs), duration, or learned embeddings. The main entry point, phontrast(), reports several contrast metrics in one call -- Jensen-Shannon divergence and distance (Lin, 1991) <doi:10.1109/18.61115>, the Pillai-Bartlett trace, Bhattacharyya distance and affinity, Mahalanobis distance, and proportional overlap -- globally or by group on a common separation-oriented scale, with bootstrap confidence intervals. rank_contrasts() implements a measurement protocol for ranking speakers' contrasts by Jensen-Shannon distance and checking the ranking against Pillai, with sample-size licensing and a bandwidth-sensitivity check. Also provides utilities for preparing estimates for downstream modelling such as generalized additive models and mixed-effects models. Formerly released as 'phonJSD'.

Package details

AuthorGrant M. Berry [aut, cre]
MaintainerGrant M. Berry <berry.grant@gmail.com>
LicenseMIT + file LICENSE
Version2.5.0
URL https://github.com/berrygrant/phontrast 
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("phontrast")

Try the phontrast package in your browser

Any scripts or data that you put into this service are public.

phontrast documentation built on Oct. 7, 2026, 5:06 p.m.