Source-linked AI summary

Simulation-Efficient Double-Flow Neural Posterior Estimation for Agent-Based Models

Junyao Zhang, Jinglai Li, Junqi Tang

arXiv:2610.35442v1cs.MA

TL;DR

Bayesian inference in ABMs with intractable likelihoods can require costly simulator training data. DF-NPE combines learned summaries with conditional flows to supplement direct simulations with synthetic training pairs. In two Brock–Hommes settings, the 1:9 Mixed allocation used fewer direct simulations and had lower mean discrepancies than SNPE, though noisy-setting medians did not improve.

  • Problem

    For ABMs with intractable or expensive likelihoods, the number and cost of simulator calls constrain Bayesian calibration.

    Source: §1 · p. 1, §2 · p. 2
  • Method

    DF-NPE uses a recurrent encoder and two conditional flows to generate learned summaries from parameters and estimate parameter posteriors from summaries.

    Source: §1 · p. 2, §2 · p. 3
  • Results

    At Mixed 1:9, DF-NPE used 1,000 direct simulations versus 10,000 for SNPE and had lower mean WASS and MMD2 in both settings, although noisy-setting medians did not improve.

    Source: §4 · p. 17
  • Takeaways & Limitations

    The largest simulation saving and best posterior agreement occurred at different allocations, so budget selection involves a trade-off between direct simulations and posterior accuracy.

    Source: §4 · p. 17

    At Mixed 1:9, noisy-setting medians did not improve on the baseline.

    Source: §4 · p. 17

Abstract

from arXiv · show

Neural posterior estimation (NPE) enables Bayesian inference of the posterior parameter in agent-based models (ABMs) with intractable likelihoods, but simulating training data can be computationally expensive. We propose Double-Flow Neural Posterior Estimation (DF-NPE), which combines learned time-series summaries with two conditional normalizing flows for synthetic-data generation and posterior estimation. The framework supplements direct simulations with synthetic training pairs and supports both pooled and ordered training strategies. Experiments in two settings of the Brock-Hommes asset-pricing model show that DF-NPE can reduce direct simulations by 90 percent while achieving lower mean posterior discrepancies and runtime than standard NPE. Performance varies with the allocation of directly simulated and synthetic data and the training strategy. These results establish learned summary augmentation as a practical approach to reducing simulation costs for Bayesian posterior inference of parameters in ABMs.

1 Introduction

Bayesian inference in ABMs is constrained by the cost of producing simulator training data. This paper introduces DF-NPE and evaluates synthetic-data augmentation and posterior-training strategies for recovering parameter posteriors.

1 Introduction

  • In ABMs with intractable or expensive likelihoods, the number and cost of simulator calls constrain Bayesian calibration.The goal is to describe plausible parameter values and their uncertainty through a posterior.Source: §1 · p. 1
  • NPE learns a conditional density from simulated parameter–data pairs, but producing those training pairs remains a simulation cost.Sequential NPE directs later simulations toward parameter regions relevant to an observation.Source: §1 · p. 1
  • Generated pairs can enlarge training data, but their value for posterior recovery depends on surrogate accuracy and how they are combined with direct simulations.The paper studies this issue when the surrogate generates learned summaries whose representation changes across rounds.Source: §1 · p. 2
  • Mixed training pools direct and synthetic pairs, whereas Synthetic-to-Simulation and Simulation-to-Synthetic use them in successive stages.The paper compares these strategies and frozen-component controls to characterize when augmentation improves posterior recovery.Source: §1 · p. 2
  • DF-NPE combines learned time-series summaries, conditional latent generation, and posterior estimation in a sequential procedure.A recurrent encoder represents trajectories; one conditional flow generates summaries given parameters, and another estimates the posterior given a summary.Source: §1 · p. 2
  • The evaluation compares directly simulated and synthetic data allocations using full-posterior discrepancies, predictive checks, and recorded computational cost.The experiments use two Brock–Hommes model settings and approximate ground-truth posteriors from tractable transition likelihoods.Source: §1 · p. 2

2 Double-Flow Neural Posterior Estimation

DF-NPE estimates ABM parameter posteriors under a limited direct-simulation budget by generating training summaries in a learned representation. The representation is learned from trajectories and is intended to retain information about the parameters.

2 Double-Flow Neural Posterior Estimation

  • The framework’s posterior target is the parameter distribution given the observed trajectory, estimated under a limited direct-simulation budget.NPE uses summary statistics to represent time-series observations, and sequential proposals focus later simulations on relevant parameter regions.Source: §2 · pp. 2–3
  • DF-NPE adds a conditional density that generates training summaries to the sequential posterior-estimation procedure.The encoder produces an eight-dimensional latent summary, and separate conditional flows model summaries given parameters and parameters given summaries.Source: §2 · p. 3
  • Each sequential round updates the encoder and surrogate, then re-encodes stored trajectories so direct and synthetic data share the current representation.Synthetic summaries are regenerated after representation changes.Source: §2 · p. 3

2.1 Flow 1: Learning summaries and generating synthetic data

  • A recurrent encoder learns trajectory summaries through parameter regression, with inference depending on how much parameter information those summaries retain.The summaries avoid modeling complete trajectories, but adding summary information does not automatically improve inference.Source: §2.1 · p. 3

A Shared data generation

DF-NPE keeps simulator-trained summaries and surrogate-generated summaries in a shared, updated representation, then trains the posterior flow using pooled or ordered data sources. Its sequential schedule also affects later proposals and the total computational budget.

A Shared data generation

  • Stored trajectories are re-encoded after encoder updates, and the latent surrogate is refitted on direct summaries before generating synthetic pairs.The encoder and surrogate are fitted exclusively to simulator output; synthetic pairs are used only for posterior-flow training.Source: A Shared data generation · pp. 4–5
  • Each synthetic pair draws a parameter from a retained proposal and a summary from the current conditional latent surrogate.Proposal identities are retained, and the synthetic bank is regenerated when the encoder or surrogate changes.Source: A Shared data generation · pp. 4–5

2.2 Flow 2: Posterior learning with directly-simulated and synthetic data

  • The atomic loss adjusts for non-prior parameter proposals by comparing the posterior log score with the prior density.Each data block retains its generating proposal; this correction addresses parameter sampling, while representation loss and surrogate error require separate diagnostics.Source: §2.2 · p. 5
  • Direct pairs anchor posterior training to simulator output, while synthetic pairs add draws from the learned conditional summary distribution.The allocation sets bank composition; the schedule controls the order in which the posterior estimator encounters the sources.Source: §2.2 · p. 5
  • Mixed training shuffles a pooled bank, whereas the ordered strategies train on one source and then continue with the other.Synthetic-to-Simulation uses synthetic updates first; Simulation-to-Synthetic reverses the order, with source-specific budgets.Source: §2.2 · pp. 5–6

2.3 Sequential inference and simulation budgets

  • Across rounds, the encoder is updated, stored trajectories are re-encoded, and synthetic data are regenerated before posterior training.The encoder and surrogate remain fixed during posterior training, and the fitted posterior supplies the proposal for the next round.Source: Figure 1 · p. 4, §2.3 · p. 6
  • Changing the training strategy affects later proposals and training data as well as the current posterior, so comparisons evaluate complete sequential procedures.For ten rounds, accepted synthetic generation totals 5.5Ns rather than Ns, distinguishing regenerated pairs from final bank size and direct simulator calls.Source: §2.3 · p. 6

3 Numerical Experiments

The experiments compare DF-NPE with SNPE across two Brock–Hommes settings, varying direct-versus-synthetic data allocations and posterior-training strategies. A 1:9 allocation gives the largest direct-simulation saving and lower mean discrepancies in both settings, but median performance, strategy rankings, and runtime depend on setting and configuration.

3.2 Brock–Hommes model

  • The benchmark uses two separate Brock–Hommes tasks with fixed simulated observations and likelihood-based MCMC reference posteriors, assessing posterior recovery with WASS and MMD2.The two tasks differ in β and prior support; the MMD2 scales differ across diagnostic kernels, and the runtime measure includes simulation, training, synthetic generation, posterior sampling, input/output, and plotting.Source: §3 · p. 8, §3.1 · p. 8, §3.2 · p. 9

3.2.2 Results

  • In the smooth setting, every Mixed allocation had lower median WASS and MMD2 than SNPE, but gains beyond 5:5 plateaued and allocation rankings varied by metric and statistic.The 7:3 and 9:1 allocations had high-discrepancy outliers, and overlapping boxes showed substantial variation across fits.Source: §3.2.2 · pp. 10–11, Figure 3 · p. 12
  • At matched direct-simulation budgets, Mixed reduced WASS in all 25 paired comparisons and MMD2 in 23, supporting the complete DF-NPE procedure under that comparison.The comparison includes DF-NPE's different representation-learning procedure.Source: §3.2.2 · p. 11
  • In the noisy setting, 9:1 had the lowest median for both metrics, while 1:9 reduced direct simulations by 90% and improved mean—but not median—discrepancies versus SNPE.The repeated-fit distributions overlapped more than in the smooth setting.Source: §3.2.2 · pp. 11, 13, Figure 5 · p. 13
  • At 1:9, DF-NPE used 90% fewer direct simulations and had lower mean discrepancies in both settings, while the lowest-median allocation differed by setting.The lowest median discrepancies occurred at 5:5 in the smooth setting and 9:1 in the noisy setting; allocation choice depends on budget and required accuracy.Source: Figure 3 · p. 12, §3.2.2 · p. 13, Figure 5 · p. 13

3.3.1 Comparison of posterior-training strategies

  • The preferred posterior-training strategy depended on setting and allocation; in smooth runs Mixed led at 1:9 and 3:7, whereas noisy 3:7 favored Synthetic-to-Simulation on both medians.Training strategies also differed in stopping/update rules and changed subsequent proposal banks, so results compare complete sequential procedures rather than isolate source order.Source: §3.3.1 · p. 14

3.3.2 Computational cost

  • Mixed 1:9 had the lowest median runtime in both settings, and its mean runtime was lower than SNPE's at every tested allocation.At 1:9, Mixed averaged 10.15 minutes for smooth BH and 15.97 minutes for noisy BH, versus 65.45 and 67.60 minutes for SNPE; ordered training generally took longer and varied more.Source: §3.3.2 · p. 14, Figure 8 · p. 16

3.3.3 Surrogate and augmentation diagnostics

  • With encoder, surrogate, simulation bank, and posterior initialization fixed, augmentation lowered diagnostic MMD2 in nine of ten smooth pairs but worsened eight noisy pairs.Surrogate checks found positive mean excess discrepancies in every tested source configuration, so complete-procedure gains cannot be attributed to synthetic pairs alone.Source: §3.3.3 · p. 16

4 Discussion and Conclusion

DF-NPE supplements directly simulated training data with generated latent summaries, reducing simulation demand while recovering posterior structure in the tested Brock–Hommes settings. Its accuracy and runtime depend on data allocation and training strategy, and the evidence is limited to one simulated observation per setting.

4 Discussion and Conclusion

  • Mixed 1:9 used 1,000 direct simulations versus 10,000 for SNPE, with lower mean WASS and MMD2 in both settings but no noisy-setting median improvement.Other allocations achieved lower discrepancies, so the largest simulation saving and best posterior agreement occurred at different allocations.Source: §4 · p. 17
  • Synthetic-to-Simulation at noisy 3:7 had the lowest median discrepancies among tested strategies, while Mixed performed favourably in the smooth setting.The preferred strategy varied by setting and allocation; comparisons reflect complete sequential procedures, including different stopping rules and feedback into later proposals.Source: §4 · p. 17
  • With the representation and surrogate fixed, adding generated pairs improved some configurations and worsened others, consistent with differences between simulator and surrogate conditional distributions.Proposal correction adjusts parameter sampling but does not remove those distributional differences.Source: §4 · p. 17
  • Mixed 1:9 had the lowest recorded runtime in both settings, while ordered training could take substantially longer at the same direct-simulation budget.Runtime includes re-encoding, surrogate fitting, repeated synthetic generation, and posterior training.Source: §4 · p. 17
  • Evidence comes from repeated fits to one simulated observation per setting and finite MCMC reference samples; independent observations would broaden uncertainty assessment.Further ABM families would test transfer, while market-data applications would require checks for simulator misspecification.Source: §4 · p. 17
  • Within the tested Brock–Hommes settings, generated latent summaries supplemented limited direct training data while retaining useful posterior information and enabling allocation and strategy comparisons.The framework's practical value is assessed through posterior recovery and computational cost.Source: §4 · p. 17

A.1 Architecture and optimisation

The appendix documents architecture and optimization settings, source-sampling schedules, and the distribution targeted by augmented training.

A.1 Architecture and optimisation

  • Table A.1 gives shared architecture and Mixed optimization settings, while ordered posterior stages use specified update counts and batch size, drop incomplete minibatches, and disable post-sequential fine-tuning.Ordered surrogate settings allow up to 100 epochs; timing runs use one simulator worker on macOS 15.6.1 ARM64 with Python 3.12.7.Source: Table A.1 · p. 21, §A.1 · p. 21

A.2 Source sampling and comparison controls

  • Mixed keeps its source-sampling weight fixed, whereas ordered training switches sources after 500 updates; this schedule specifies source sampling, not a decomposition of the SNPE-C loss.Pooled minibatches can contain contrastive atoms from both sources.Source: §A.2 · p. 21

A.3 Meaning of the augmented distribution

  • At a constant directly simulated fraction, the augmented conditional distribution mixes encoded simulator summaries with surrogate-generated summaries.Proposal correction does not correct surrogate error; under adequate proposal support and ideal density estimation, the target is proportional to the prior times this mixture, without establishing convergence or eliminating other errors.Source: §A.3 · p. 21

B Further experimental details

The appendix specifies repeated-fit seeds and a historical sample-count exception for smooth-regime seed-123 configurations.

B Further experimental details

  • Ten seeds use the same observation per configuration; six historical smooth-regime seed-123 configurations use 10,000 draws for MAE but a 1,000-draw subsample for distributional scoring.Other numerical sample sets use 1,000 draws, so MAE estimates in that historical subset have unequal Monte Carlo precision.Source: §B.1 · p. 22

B.1.1 Posterior-mean parameter error

Posterior-mean parameter error measures how closely the estimated posterior mean matches the known generating parameter, but it does not assess posterior uncertainty.

B.1.1 Posterior-mean parameter error

  • Lower MAE means the estimated posterior mean is closer to the generating coefficients, but does not establish accurate posterior uncertainty.The finite observed trajectory means the reference posterior mean itself need not equal the generating parameter, so MAE is secondary to distributional discrepancies.Source: §B.1.1 · p. 22

B.1.2 Posterior predictive scores

This appendix defines the predictive checks and score conventions, then collects supplementary posterior and computational comparisons for the Brock–Hommes workflows. The supplied passages describe the scope and methods of those comparisons, but do not provide table values.

B.1.2 Posterior predictive scores

  • Predictive checks compare observed trajectories with posterior-replicated data, using pointwise-median RMSE, observed-point coverage, and an error across six trajectory summaries.The six summaries are mean, standard deviation, minimum, maximum, last-minus-first value, and correlation with a linear time index.Source: §B.1.2 · p. 22
  • Coverage is the fraction of observed time points inside pointwise bands; without interval widths, higher coverage alone does not establish better predictive performance.These losses measure predictive agreement under their definitions, and the trajectory-summary error is not parameter-mean error.Source: §B.1.2 · pp. 22–23

B.1.3 Posterior display conventions

  • Posterior displays use 50-bin marginals and 50 × 50 bivariate bins over task-specific prior ranges, with blank lower triangles.Sample counts, scaling, and seed selection follow Section 3.2.1.Source: §B.1.3 · p. 23

B.2 Score harmonisation and provenance

  • Ordered-run diagnostics are rescored with joint Euclidean Wasserstein cost, unbiased MMD2, and error relative to the generating parameter; these definitions differ from the original ordered-suite diagnostics.The joint Wasserstein score is the minimum-cost assignment divided by sample count for equally weighted sample sets of the same size.Source: §B.2 · p. 23

C Supplementary posterior and computational results

  • The appendix gathers posterior geometry, complete numerical comparisons, and runtime breakdowns for workflows evaluated in Section 3.The supplied passages do not give the numerical table entries.Source: C Supplementary posterior and… · p. 23

C.1 Posterior geometry

  • Figure C.1 contrasts ordered strategies at a 3:7 direct-to-synthetic ratio; red marks show the likelihood-based reference posterior, and panel darkness encodes sample counts.Diagonal panels show marginal histograms and upper triangles show bivariate count histograms.Source: §C.1 · p. 23, Figure C.1 · p. 24

C.2 Comparisons at equal direct simulation budgets

  • Table C.1 compares Mixed with SNPE at equal direct-simulation budgets across five paired seeds, with positive SNPE-minus-Mixed discrepancies favouring Mixed.The procedures retain their respective representation-learning and training protocols; the supplied passages do not include the table values.Source: Table C.1 · p. 25, §C.2 · p. 25

C.3 Mixed allocations and SNPE

  • Table C.2 reports Mixed and SNPE across both settings, while Figure C.2 breaks Mixed and SNPE runtime into workflow phases and direct-to-synthetic allocations.Figure C.2 reports median phase times over ten seeds; segment medians need not sum to median end-to-end runtime.Source: Table C.2 · p. 25, Figure C.2 · p. 26

C.5 Complete ordered-workflow results

In the noisy setting, Synthetic-to-Simulation performed most consistently at 3:7, but the preferred ordered strategy varied across settings and allocations.

C.5 Complete ordered-workflow results

  • At noisy 3:7, Synthetic-to-Simulation improved WASS in all ten paired comparisons and MMD2 in eight; mean differences were −0.0369 ± 0.0279 for WASS and −0.0126 ± 0.0126 for MMD2.Differences are Synthetic-to-Simulation minus Simulation-to-Synthetic, reported as mean ± sample standard deviation.Source: §C.5 · p. 26
  • At noisy 1:9 and 5:5, WASS improved in six and seven pairs, respectively; in the smooth setting, it improved in only four or five pairs per allocation.At smooth 1:9, both mean discrepancies favoured the reverse order.Source: §C.5 · p. 26
  • The ordered comparisons do not identify a uniformly preferred strategy: at noisy 5:5, mean differences favoured Synthetic-to-Simulation for WASS but Simulation-to-Synthetic for MMD2.Table C.3 reports complete ordered-workflow results across ten seeds; the supplied passage does not include its cell values.Source: Table C.3 · p. 26, §C.5 · p. 27

D Further diagnostic details and results

The appendix describes diagnostics of conditional-surrogate fidelity and prior-only augmentation controls, while emphasizing limits on interpretation and scope.

D Further diagnostic details and results

  • The diagnostics use 120 final encoder–surrogate pairs from ordered runs, exclude historical Mixed sources, and treat source seeds as the replication unit.Sites and trajectories are nested measurements; diagnostics use final fitted components, shared data banks, and one observation per setting.Source: D Further diagnostic details and results · p. 27

D.1 Conditional surrogate fidelity

  • Surrogate fidelity is evaluated at prior and finite-reference-posterior parameter sites using three batches of 100 trajectories, a frozen eight-dimensional encoder, and a frozen conditional surrogate.The diagnostic compares direct–synthetic MMD2 with direct–direct MMD2; Table D.1 summarizes excess MMD2 over ten source fits.Source: §D.1 · p. 27, Table D.1 · p. 27
  • Excess discrepancy is descriptive rather than a calibrated hypothesis test and can be negative; prior-versus-reference contrasts have no causal interpretation.Site distributions and local standardization differ, and density scores do not measure information preservation across representations.Source: §D.1 · pp. 27–28

D.2 Fresh prior-only augmentation controls

  • Prior-only controls compare augmented and direct-only training with shared directly simulated data, initialization, and update budgets, but augmented batches have lower direct exposure.Both augmented arms use pooled training; Table D.2 reports differences under diagnostic score definitions distinct from the main workflow scores.Source: Table D.2 · p. 28, §D.2 · p. 28
  • The full diagnostic collection used 15,512 extra direct calls per task, and its 31,024 calls plus diagnostic training and sampling costs are excluded from workflow speed-ups.The additional calls include 6,000 site trajectories, 9,000 prior-bank trajectories, and 512 validation trajectories.Source: §D.2 · p. 28
Loading 2610.35442v1…