Skip to main content

HGF analysis pipeline

Python / TAPAS · to publish

The Hierarchical Gaussian Filter treats a participant as someone tracking a world that changes, and its parameters say how readily they revise a belief and how unstable they expect the world to be by default. Fitting it to behaviour is the easy part. Knowing whether the fit means anything is the rest of the work, and that is most of what this code does.

Parameter recovery asks whether the design can identify the parameters at all: simulate agents with known values, fit them with the same pipeline, and see whether the estimates come back. Model recovery asks the harder version. If several models are in play, generate data from each and check that the selection procedure picks the right one. Where either check fails, the parameter is not a finding, it is an artefact of the design, and the honest response is to change the task before running anyone through it.

The recovery simulations here ran before any confirmatory data were collected. That order matters: run them afterwards and the failure arrives too late to act on, when the only options left are to report a number you no longer trust or to bury it.

They also changed what the study will report. Where the raw parameters could not be told apart, the outcomes were rewritten in the combinations that can be, and claims the design cannot carry were narrowed rather than rescued later. Recovery was not a formality run over a finished pipeline; it decided what there is to say.

The pipeline is built on TAPAS, the toolbox from the Translational Neuromodeling Unit in Zurich. It takes trial-level data of the kind the beads task writes, and it is the same modelling approach behind the anxiety study. It is not public yet.