Functional Dynamics and Predictive Calibration¶
Python-facing port of
functional-dynamics-and-predictive-calibration.Rmdfrom the frozen R gp3bayes 0.5.0 reference. The statistical and governance framing below follows the canonical vignette; executable Python workflows use the mapped APIs listed later.
Purpose¶
Version 0.5 treats the posterior trajectory itself as an object from which predeclared functional estimands can be derived. This avoids using a single peak or selected window as the only description of temporal change. The functions in this article remain descriptive: they do not infer a physiological onset, changepoint, attention state, or cognitive event.
Backend-free simulation¶
Fit declaration¶
The Student-t and ARMA layers are deliberately not combined by the governed 0.5 interface. Robust observation tails and residual serial dependence should first be assessed as separately declared candidate explanations.
Posterior derivatives¶
The following fit is intentionally not executed while building the vignette.
A derivative summarizes rate of posterior trajectory change. It is not an automatic response-onset detector. Likewise, duration above a threshold is only meaningful when that threshold was scientifically prespecified.
Predictive calibration on held-out data¶
The reported RMSE, MAE, bias, interval coverage, interval width, and draw-based
CRPS describe the supplied prediction task. They become out-of-sample evidence
only when newdata was genuinely withheld from fitting.
Python API mapping¶
gp3bayespy.audit_advanced_pupil_identifiabilitygp3bayespy.audit_pupil_predictive_calibrationgp3bayespy.create_pupil_gp_specgp3bayespy.estimate_pupil_dynamic_contrastgp3bayespy.estimate_pupil_threshold_durationgp3bayespy.estimate_pupil_trajectory_derivativegp3bayespy.fit_advanced_pupil_model_cmdstanrgp3bayespy.plot_advanced_pupil_simulationgp3bayespy.plot_pupil_dynamic_contrastgp3bayespy.plot_pupil_predictive_calibrationgp3bayespy.plot_pupil_trajectory_derivativegp3bayespy.predict_advanced_pupil_trajectorygp3bayespy.pupil_model_cardgp3bayespy.simulate_advanced_pupil_timecoursegp3bayespy.specify_advanced_pupil_timecourse_model
Python usage¶
import gp3bayespy as gp
# All functions listed above are available from the package root.
# Use help(gp.<function>) or the API reference for the exact Python signature.
An executable workflow for this family is included in ../../examples/predictive_diagnostics.py.