REVIEW 6 minor 2 cited by
fgivenx: A Python package for functional posterior plotting
T0 review · 0 major / 6 minor · reviewed 2026-08-14 · deepseek-v4-flash
Pith's one-line read fgivenx is a Python package that turns MCMC parameter samples into contour plots of the predictive probability $P(y|x)$, plus the conditional Kullback-Leibler divergence between prior and posterior predictions.
desk verdict A solid little software paper: the package is real and usable, the paper is honest about what it does, and the only real weakness is the lack of in-paper validation, which is standard for JOSS. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The load-bearing mechanism is a sequence of one-dimensional kernel density estimates (smooth histograms built by placing a bump on each sampled value) taken across a grid of $x$, rather than a single high-dimensional density estimate. For each value of $x$ on the grid, the package pushes all posterior parameter samples through the function $f(x)$, collects the output values $y$, and estimates the density of those outputs to build $P(y|x)$. This turns functional posterior plotting into repeated one-dimensional density estimation, which is stable and cheap; the conditional Kullback-Leibler divergence is then computed from the estimated prior and posterior densities at each $x$.
What would settle it
Run the package's linear-model example with a known Gaussian prior on the slope and intercept, and compare its $P(y|x)$ contours and conditional Kullback-Leibler divergence against the analytically derived posterior predictive distribution; any systematic mismatch in the quantiles or divergence values would show the central claim is wrong.
Extended reading notes
Core claim
On its own terms, the paper establishes that functional posterior plotting can be packaged as a small, reusable library. The core operation is: take a set of posterior samples of parameters, evaluate the model function $f(x)$ on a grid of $x$ for each sample, and at every grid point perform one-dimensional kernel density estimation over the resulting $y$ values to obtain $P(y|x)$. The package then renders these densities as iso-probability contours (67%, 95%, and 99%) and plots the conditional Kullback-Leibler divergence $\mathrm{D}_{\mathrm{KL}}[P(y|x) \,\|\, P_{\rm prior}(y|x)]$ as a function of $x$. The linear model $y=mx+c$ with prior and posterior samples serves as the demonstration, and the applications listed include cosmological power-spectrum constraints and diagnostics for nested-sampling and compressive-sensing analyses.
Load-bearing premise
The paper assumes without showing tests or worked validation that the archived code actually computes the posterior density and Kullback-Leibler divergence correctly for arbitrary input samples.
Editorial extensions
If this is right
- Scientists with existing MCMC samples of any model can produce publication-ready functional posterior plots without writing their own density-estimation code.
- The conditional Kullback-Leibler divergence plot provides a one-dimensional diagnostic for where the data most strongly update model predictions, useful for model comparison and for spotting regions of $x$ where the prior dominates.
- Because the method only assumes predictive outputs that are functions of an input $x$, it transfers to any field doing Bayesian prediction, not just astronomy.
- The listed applications in cosmology, dark-energy studies, nested-sampling diagnostics, and compressive sensing indicate that the package already works in several demanding inference settings.
Reading between the lines
- [Editorial inference] The same machinery could compare two posterior predictive distributions from different datasets or models by replacing the prior with a second posterior ensemble, yielding a data-versus-data divergence plot the paper does not discuss.
- [Editorial inference] Because the method reduces to independent one-dimensional kernel density estimates, its practical reliability hinges on the grid resolution in $x$ and the kernel bandwidth in $y$; a natural testable extension is to expose or automate bandwidth selection and to validate contours on analytic posteriors.
- [Editorial inference] The package could serve as a standard visual check in Bayesian workflow, complementing trace plots and parameter contours by exposing where the model's predictions are updated; this would matter for any field using black-box likelihoods.
Signed reviews
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript describes fgivenx, a Python package for plotting functional posterior distributions P(y|x) and conditional Kullback-Leibler divergences from samples of model parameters. It presents a simple linear-model example (Figure 2), a Planck-based demonstration (Figure 1), and a list of published applications in cosmology and Bayesian analysis. The software is archived with a Zenodo DOI and the source is available on GitHub.
Significance. If the package works as claimed, it provides a useful and reusable tool for Bayesian functional posterior visualization, with demonstrated uptake in Planck analyses, dark-energy equation-of-state studies, and nested-sampling diagnostics. The paper's strengths are its modest scope, the archived code (v2.1.17, DOI 10.5281/zenodo.1404584) that can be machine-checked, and a reproducible linear-model example. The lack of in-paper numerical validation is a caveat, but the package's public archive and published usage make this a standard software-paper limitation rather than a defect that undermines the central claim.
minor comments (6)
- [Summary] The manuscript does not specify the algorithm used to compute P(y|x) and the conditional Kullback-Leibler divergence (e.g., kernel density estimation procedure, bandwidth selection, grid construction); a brief description or a pointer to the relevant module in the archived code would help readers assess the numerical accuracy independently of running the code.
- [Figure 2] In the caption, 'essential a contour version' should be 'essentially a contour version'.
- [Abstract / Summary] The GitHub URL appears only in the abstract; include it in the main text so the paper is self-contained and readers do not need to consult the abstract to find the repository.
- [Summary] The sentence 'currently used in astronomy, but will be of use to scientists performing any Bayesian analysis...' is informal and could be rephrased as 'already used in astronomy, and should be of use to scientists...' for clarity.
- [Acknowledgements] The paper does not state the software's license; since the software is the main artifact, please state the package's license (e.g., MIT, GPL) alongside the CC-BY license that applies to the paper.
- [References] Some references are to arXiv e-prints without a DOI or final publication status (e.g., Higson et al. 2018a, 2018b); consider updating to the published versions or adding DOIs where available.
Circularity Check
No circularity found; the paper is a standalone software description with no fitted-input prediction chain.
full rationale
This is a software tool paper, not a derivation of a physical or statistical result from fitted inputs. The paper describes fgivenx as a Python package for functional posterior plotting, illustrates its use with a linear model y = m*x + c, and cites prior applications (Planck studies, dark energy equation of state, nested-sampling diagnostics, Bayesian compressive sensing) as usage examples rather than as evidence that validates the package's algorithms. There is no equation in the paper that is defined in terms of the paper's own output, no parameter fitted to a subset of data and then renamed as a prediction, and no self-citation chain that makes the central claim true by construction. The central claim is simply that the package exists, is archived on Zenodo with a DOI, and can produce the depicted functional posterior plots. The lack of in-paper numerical tests is a legitimate weakness, but it is a matter of validation and provenance, not circularity: the correctness of the implementation rests on the archived code and external usage, not on any argument that assumes what it purports to show. The score is therefore 0.
Assumptions & free parameters
assumptions (2)
- domain assumption Input samples are valid draws from the requested posterior or prior distribution.
- domain assumption Kernel density estimation on the function output grid accurately represents the continuous conditional posterior P(y|x).
Cite this review
Pith. "Pith review of fgivenx: A Python package for functional posterior plotting." pith.science (2026). https://pith.science/paper/BDYT63SF
@misc{pith2026190801711,
author = {Pith},
title = {Pith review of: fgivenx: A Python package for functional posterior plotting},
year = {2026},
howpublished = {\url{https://pith.science/paper/BDYT63SF}},
note = {Machine review of arXiv:1908.01711}
}
read the original abstract
fgivenx is a Python package for functional posterior plotting, currently used in astronomy, but will be of use to scientists performing any Bayesian analysis which has predictive posteriors that are functions. The source code for fgivenx is available on GitHub at https://github.com/williamjameshandley/fgivenx
Figures
Forward citations
Cited by 2 Pith papers
-
MIGHTEE-HI / LADUMA: Investigating the link between baryons and dynamics with 130 resolved HI-selected galaxies
A 130-galaxy HI-selected sample yields a tight radial acceleration relation with an acceleration scale near 1.5e-10 m/s^2 and a MOND shape parameter around 4, and shows that the bTFR redshift-evolution signal is large...
-
A NICER view of the millisecond pulsar PSR J2124$-$3358: evidence for a helium atmosphere
X-PSI modeling of NICER/Chandra data for PSR J2124−3358 substantially prefers a helium atmosphere, giving M = 1.8 ± 0.5 M⊙ and Req = 11.7^{+2.6}_{-3.0} km with two slightly non-antipodal hot spots.
Reference graph
Works this paper leans on
-
[4]
Bayesian model selection without evidences: application to the dark energy equation-of-state
“Bayesian model selection without evidences: application to the dark energy equation-of-state.”MNRAS 455 (January): 2461–73. https://doi.org/10.1093/mnras/stv2217. Hee, S., J. A. Vázquez, W. J. Handley, M. P. Hobson, and A. N. Lasenby
-
[6]
Sampling Errors in Nested Sampling Parameter Estimation
“Sampling Errors in Nested Sampling Parameter Estimation.”ArXiv E-Prints, March. http://arxiv.org/abs/1703.09701. ———. 2018b. “Diagnostic Tests for Nested Sampling Calculations.”ArXiv E-Prints, April. http://arxiv.org/abs/1804.06406. Handley, (2018). fgivenx: A Python package for functional posterior plotting. Journal of Open Source Software , 3(28),
arXiv 2018
-
[11]
Planck 2015 results. XX. Constraints on inflation
“Planck 2015 results. XX. Constraints on inflation.”A&A 594 (September): A20. https://doi.org/10.1051/0004-6361/201525898. ———. 2018a. “Planck 2018 results. I. Overview and the cosmological legacy of Planck.” ArXiv E-Prints, July. http://arxiv.org/abs/1807.06205. ———. 2018b. “Planck 2018 results. X. Constraints on inflation.”ArXiv E-Prints, July. http://arx...
arXiv 2018
-
[12]
https: //doi.org/10.21105/joss.00849 4
- [24]
-
[1951]
“On Information and Sufficiency.”Ann. Math. Statist. 22 (1): 79–86. https://doi.org/10.1214/aoms/1177729694. Lewis, Anthony
-
[2015]
“Getdist Github Repository.” https://github.com/cmbant/getdist. MacKay, David J. C. 2002.Information Theory, Inference & Learning Algorithms . New York, NY, USA: Cambridge University Press. Planck Collaboration
work page 2002
-
[2016]
Pygtc: Beautiful Parameter Covariance Plots (Aka. Giant Triangle Confusograms)
“Pygtc: Beautiful Parameter Covariance Plots (Aka. Giant Triangle Confusograms).”The Journal of Open Source Software 1 (6). https://doi.org/10.21105/joss.00046. Foreman-Mackey, Daniel
Show all 10 references
-
[2017]
Con- straining the dark energy equation of state using Bayes theorem and the Kullback-Leibler divergence
“Con- straining the dark energy equation of state using Bayes theorem and the Kullback-Leibler divergence.”MNRAS 466 (April): 369–77. https://doi.org/10.1093/mnras/stw3102. Higson, E., W. Handley, M. Hobson, and A. Lasenby. 2018a. “Bayesian Sparse Recon- struction: A Brute-For...
-
[2018]
Fgivenx: V2.1.17,
“Fgivenx: V2.1.17,” August. https://doi.org/10.5281/zenodo.1404584. Hee, S., W. J. Handley, M. P. Hobson, and A. N. Lasenby
Reviewed August 14, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.