bioRxivNeurosciencePreprint
HGFX: a validated Python/JAX reproduction of the Hierarchical Gaussian Filter toolbox
Abstract
The Hierarchical Gaussian Filter (HGF) is a hierarchical Bayesian model of learning under uncertainty and volatility, with a widely used MATLAB implementation. We present HGFX 1.0.0, a Python/JAX toolbox whose primary objective is validated behavioral and numerical compatibility with a frozen HGF Toolbox 8.2.0 reference, while removing MATLAB as a user-runtime dependency. Reimplementation is treated as a validation problem rather than source translation: configuration semantics, parameter transforms, forward trajectories, observation likelihoods, objectives, fitting and statistical surfaces, simulation workflows, official demo behavior, model selection, and backend agreement are compared against the pinned oracle under predeclared tolerances. Two official MATLAB demo workflows reproduce the reference at frozen trajectory tolerances, including a regime in which classic HGF encounters negative posterior precision while eHGF completes successfully. In paired model-selection validation, all 36 BIC winners agree between MATLAB and HGFX. Physical NVIDIA GPU applicability was confirmed on two Tesla T4 devices, with a maximum CPU-versus-GPU final-objective difference of 1.42e-14 against a frozen 1e-7 criterion. Historical parameter recovery results that did not meet predeclared criteria, together with exact MATLAB/HGFX limitation matches, are preserved and are not reclassified as scientific success. A prospectively gated comparison with pyhgf 0.3.2 shows binary64-scale agreement on mapped perceptual trajectories in one authorized three-level binary-HGF cell, while participant-response negative log-likelihood is retained as not directly comparable. HGFX therefore provides a MATLAB-independent Python implementation with an explicit evidence model that separates direct parity, matched reference limitations, backend applicability, and future performance claims.
- research focus: benchmarking
- research focus: software / tool
- approach: statistical model
- approach: Bayesian inference
- Citations
- 0
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Physiological Gaussian Process Priors for the Hemodynamics in fMRI Analysis
Josef Wilzén, Anders Eklund, Mattias Villani·Journal of Neuroscience MethodsPeer-reviewed·May 29, 2020
- Electrophysiological signatures of hierarchical learning
Meng Liu, Wenshan Dong, … Qi Chen·Cerebral CortexPeer-reviewed·Jun 29, 2021
- jaxon: a differentiable, GPU-native simulator for peripheral-nerve fiber models
David Lung, Max Haberbusch·bioRxiv·Jul 31, 2026
- A tutorial on Gaussian process regression: Modelling, exploring, and exploiting functions
Eric Schulz, Maarten Speekenbrink, Andreas Krause·bioRxiv·Oct 10, 2017
- Bayesian Workflow for Generative Modeling in Computational Psychiatry
Alexander J. Hess, Sandra Iglesias, … Klaas Enno Stephan·Computational PsychiatryPeer-reviewed·Jan 1, 2025
- Modelling Metacognition: A Joint Prediction-Confidence Model for Predictive Inference Task Data
Esteban Félez, Peter Thestrup Waade, … Alexander J. Hess·bioRxiv·Aug 21, 2026