- The paper presents ML_MyTorus, a neural posterior estimation framework that infers four key MYTorus parameters from AGN X-ray spectra using observation-driven training grids.
- It utilizes autoregressive normalizing flows with MADE networks to capture complex degeneracies and provide robust uncertainty quantification.
- The approach outperforms traditional XSPEC fitting in convergence, accuracy, and reproducibility, making it scalable for future high-throughput missions.
Simulation-Based Inference for AGN X-ray Reflection: ML_MyTorus and Parameter Estimation via Observation-Driven Neural Posterior Estimation
Scientific Context and Objectives
The study addresses the challenge of extracting the fundamental physical parameters of AGN circumnuclear environments from X-ray reflection spectra, focusing on the widely used MYTorus model in its decoupled configuration. Traditional frequentist fitting (e.g., C-stat minimization in XSPEC) remains a mainstay for spectral analysis but is limited by manual workflow, issues with local minima, lack of automation, and poor reproducibility, especially as future high-throughput missions (e.g., Athena X-IFU) will provide massive spectral datasets of high complexity. Recent advances in simulation-based inference (SBI) and deep probabilistic modeling offer alternative parameter estimation pipelines, but their adaptation to physically rich, computationally expensive models with complex degeneracies remains under-explored.
This work introduces ML_MyTorus, a framework implementing Neural Posterior Estimation (NPE) via normalizing flows and autoregressive architectures, designed for regression and uncertainty quantification of the four principal decoupled MYTorus parameters: the line-of-sight column density NH,Z, global column density NH,S, power-law index Γ, and the relative scattered normalization AS. The approach utilizes observation-driven parameter grids for synthesis and training, maximizing physical relevance and empirical coverage.
Model and Algorithmic Foundation
The inference engine models the joint posterior p(θ∣x), where θ are the four MYTorus physical parameters and x is the observed NuSTAR spectrum. The underlying framework is an autoregressive normalizing flow constructed from a sequence of five Masked Autoencoder for Distribution Estimation (MADE) networks. Each MADE incorporates context from the spectrum and additional meta-data (redshift z, Galactic NH, exposure) to condition the posterior on relevant observational constraints.
Figure 1: Flow diagram of the SBI-NPE inference mechanism applied to X-ray spectra, highlighting progressive transformation of latent variables to the physical parameter posterior via Masked Autoregressive Flow.
Training proceeds by minimizing the negative log-likelihood (NLL) over synthetic spectrum/parameter pairs. The base distribution is a factorized multivariate normal in latent space, mapped via successive affine and non-linear transformations. During inference, posterior samples are generated by inverting the flow, yielding full joint and marginal posteriors with robust uncertainty quantification via σ68 intervals.
Construction of the Observational Training Set
A major innovation is the construction of the parameter grid for simulation-based training. In contrast to previous uniform or artificially wide priors, this work samples the parameter space based on archival values from 34 published NuSTAR AGN MYTorus decoupled fits, representing 25 AGN. Each anchor point generates 1000 Gaussian-augmented variations, resulting in a corpus of 34,000 observation-driven parameter realizations, each paired with a simulated 3–30 keV NuSTAR spectrum (response and noise modeled physically).
Figure 2: Empirical distributions for the main MYTorus physical parameters, exposure time, redshift, and Galactic column for the literature-sourced AGN sample, emphasizing domain coverage.
The approach ensures the training set embodies the statistical properties (parameter covariances, S/N, outlier regimes) of real observational data, thus enhancing generalization to actual spectra and reducing the risk of domain shift when applied to real science.

Figure 3: Multidimensional distribution of literature-based parameter anchors and with Gaussian augmentation for synthetic spectra—this covers the empirical AGN parameter landscape.
Feature selection is guided by mutual information (MI) analysis between binned spectral regions and physical parameters. The results show that for the observational grid, the region 3–8 keV (R1) carries the highest entropy for NH,Z (MI = 0.78), followed by AS, while higher energy bands are more informative for Γ. The MI also shows that auxiliary variables such as redshift, exposure, and Galactic NH, though subdominant, introduce non-negligible dependence and are included as conditioning variables.

Figure 4: Spectral band mutual information for the four MYTorus parameters; the informed grid yields higher MI and more physically plausible parameter-spectral relationships compared to a uniform grid.
Dual training runs (observation-based vs. uniform grid sampling) demonstrate that the physically informed grid converges faster, achieves lower NLL loss, and displays higher accuracy and stability. Both the training and validation curves show no signs of overfitting, attributable to realistic regularization via the parameter distribution.

Figure 5: Training and validation NLL as a function of epoch for observation-driven and uniform grids; the observational grid achieves superior convergence and generalization.
Prediction validation yields the following quantifications within the 1σ credible interval of the true parameters: NH,Z (94%), NH,S (95%), Γ (82%), AS (92%) for the sequentially augmented, observation-based grid. In contrast, for the uniform grid, the respective accuracies are significantly lower, and joint recovery probability for all four parameters drops from 74% (observation-based) to 41% (uniform).

Figure 6: Predicted vs. simulated “true” parameters for the validation set; the observation-based workflow yields predictions tightly clustered near ideal recovery.
Residual analysis shows that the error distributions are nearly centered and uncorrelated, with minor joint structure between NH,Z, Γ, and AS—reflecting mild degeneracies inherent to the physical model.
Figure 7: Joint residual distributions for all parameter pairs, showing model calibration and lack of systematic uncertainties in the main regime.
Application to Real NuSTAR Data
A case study on NGC 4388 demonstrates practical application. The workflow employs combined FPMA+FPMB spectrum, correct response, meta-data, and returns full marginal posteriors. Comparison to traditional XSPEC fitting shows that for the well-constrained parameters (Γ, AS) the ML and frequentist posteriors are fully consistent. However, NH,Z and NH,S feature bimodal or degenerate solutions, correctly reflected by the neural posterior and the frequentist landscape, providing important diagnostic power over standard point estimates.
Figure 8: Posterior histograms for NGC 4388’s main MYTorus parameters; ML_MyTorus and XSPEC solutions align in statistically robust fashion, yet posterior multimodality/degeneracy is made explicit.
Practical and Theoretical Implications
ML_MyTorus reveals distinct advantages for current and next-generation high-throughput missions:
- Robust, automated, and reproducible inference for complex, physically coupled X-ray models,
- Fast probabilistic parameter estimation with quantified uncertainty and degeneracy reporting,
- Excellent generalization for sources whose spectra reside within, or near, the empirical training domain,
- Potential for extension to other reflection models (e.g., relxill), telescopes, or time-resolved studies.
Importantly, the reliance on training labels from published fits means that any systematic bias or modeling inadequacy in those fits propagates deterministically to the ML inference—physical interpretability and coverage must therefore be continually re-evaluated as the grid expands. The availability of a public web interface and inference codebase enhances reproducibility and accessibility.
Future Directions
Scaling future iterations beyond the empirical coverage of the compiled AGN sample will necessitate adoption of joint domain adaptation (such as Simformer), inclusion of new spectral variability sources (e.g., broadening effects, response calibration), and multi-telescope/instrument generalization. As parameter degeneracy and non-Gaussianity become more prevalent with increased model sophistication, posterior reporting—not just point estimation—will be critical for astrophysical diagnostics, enabling model discrimination and hypothesis testing directly in the latent parameter space. The methodology is also extendable to other compact accretors (e.g., Galactic X-ray binaries), joint X-ray/optical modeling, and time-resolved reverberation analyses.
Conclusion
This paper establishes ML_MyTorus as a statistically rigorous and operationally viable framework for physical parameter inference from AGN X-ray reflection spectra, with performance that matches or exceeds traditional approaches in accuracy, automation, and reproducibility. The observation-driven neural posterior estimation paradigm significantly raises the standard for scalable, uncertainty-aware analysis in high-energy astrophysics, and offers a forward-compatible path as the influx of high-quality X-ray spectra continues to escalate with future observatories.