arXiv:2610.40728cs.LGOct 2026

Manuscript Offprint

arXiv:2610.40728

Bayesian Distribution System State Estimation with Flow Matching

Nan Lin, Peter Palensky, Pedro Vergara Barrios

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Nan Lin, Graduate Student Member, IEEE, Peter Palensky, Senior Member, IEEE, Pedro P. Vergara, Senior Member, IEEE

Abstract—Medium-voltage feeders have few real-time measurements, so distribution system state estimation (DSSE) rests on pseudo-measurements of the secondary substations, a prior in Bayesian terms. Weighted least squares keeps the power flow exact but reduces this prior to a mean and variance, while supervised deep learning estimators also learn the power flow and are tied to one measurement set. We propose PoSE (posterior sampling for state estimation), which keeps the Bayesian structure of DSSE and learns only what the distribution system operator does not know, namely the distribution of substation injections, modelled by a neural network trained with flow matching on historical data. The power flow equations, grid topology and measurements enter only at sampling, through a noise-aware Kalman-type correction. The neural network therefore never approximates the power flow, but every posterior sample is a physically consistent operating point, and one trained prior serves any measurement set, noise level and topology. On the IEEE 33-bus feeder, PoSE lowers the probabilistic injection error (CRPS) by 6.7–7.5% against a full-covariance Gaussian prior in all 12 tested settings. It provides reliable uncertainty: the 90% intervals contain the true injection almost exactly as often as exact posterior samples would, whereas those of supervised estimators contain it in only 37–78% of cases. On the 240-bus unbalanced three-phase Iowa feeder, it gives the lowest injection, voltage and branch-current errors of all estimators. A fast variant matches this accuracy at 0.2–0.6 s per snapshot and, without retraining, beats Gaussian priors and retrained supervised estimators on seven reconfigured topologies.

Index Terms—Distribution system state estimation, flow matching, diffusion, generative models, pseudo-measurements, neural networks.

I. INTRODUCTION

Distribution system operators (DSOs) must know the voltages and branch loading of their medium-voltage feeders to keep them within limits, and rooftop PV pushes these feeders towards those limits in both directions: voltage rise and reverse flow at midday, voltage drop and peak loading in the evening. Yet a typical feeder is measured in real time only at the primary substation and at a few remote points. Distribution system state estimation (DSSE) is therefore underdetermined, and pseudo-measurements of the secondary substations, estimates of their

injections from historical data, carry most of the information about the state [1], [2], [3].

Two requirements follow. The first is a realistic joint description of the substation injections, which are correlated across substations through shared weather and consumption patterns and non-Gaussian under rooftop PV. The second is physical and measurement consistency. The estimator must incorporate sparse, noisy measurements through the nonlinear power flow equations and provide calibrated uncertainty.

Existing approaches meet only one requirement at a time. Weighted least squares with Gaussian pseudo-measurements meets the second. It accepts any measurement set, weights each measurement by its noise variance and solves the AC power flow. It describes the injections, however, by independent means and variances, and both simplifications distort the uncertainty it reports. Rooftop PV output rises and falls together across substations under shared irradiance, so an independent prior understates how far the substations can deviate together, which is what drives midday voltage rise and reverse flow. When the pseudo-measurements are skewed or heavy-tailed, the WLS overstates the uncertainty, by a margin that varies across buses and operating points [4]. The WLS covariance therefore does not give a reliable limit violation probability. Gaussian mixture pseudo-measurements add a non-Gaussian shape [5], [6], but the estimator still returns one point and one covariance, so a skewed or bimodal injection is reported as a symmetric interval around a single estimate.

Learned estimators take the statistics of the injections and voltages from data rather than from an assumed Gaussian shape, but give up parts of the second requirement. Learned pseudo-measurements improve the point estimate [7], [8]. Bayesian deep estimators approximate the minimum mean square error estimator [9], [10] or the voltage distribution [11], and a conditional diffusion model trained on measurement-state pairs gives voltage point estimates [12]. Each is trained for one measurement configuration, so a failed meter, a new sensor, a change in sensor accuracy or a switching action requires retraining. The estimators that output voltages see the measurement noise only through simulated training pairs and must approximate the power flow equations themselves, so their voltages and branch currents need not form a physically consistent operating point. They return a point, or a mean and variance of the voltage magnitudes, which does not give the probability that a branch exceeds its thermal limit. A generative adversarial prior over unobservable injections, fitted to the measurements at inference through LinDistFlow, avoids retraining [13]. Without a noise model, however,

Nan Lin is funded by NWO Align4Energy Project NWA.1389.20.251. This work used the Dutch national e-infrastructure with the support of the SURF Cooperative using grant no. EINF-17304.

Nan Lin, Peter Palensky, and Pedro P. Vergara are with the Intelligent Electrical Power Grids Group, Delft University of Technology, 2628 CD Delft, The Netherlands (e-mail: N.Lin@tudelft.nl, P.Palensky@tudelft.nl, P.P.VergaraBarrios@tudelft.nl).

The code is available on Github: https://github.com/sentient-codebot/PoSE and https://github.com/distributionnetworksTUDelft/PoSE it treats every measurement as exact, so the measurement noise passes into the estimate, and its single point estimate satisfies only the linearized power flow. A normalizing flow has been used to learn the state distribution [14]. Table I summarizes these approaches by the quantity each models, either as a regression y→⋅y \to \cdot from the measurements y or as a distribution p(⋅)p(\cdot), over the injections s or the voltage phasors V, possibly given calendar context c. It also marks whether a new measurement set or noise level needs retraining, and whether the measurement noise covariance enters the estimator explicitly, only through simulated training pairs, or not at all.

The design principle we follow separates what the DSO knows from what must be learned. The power flow equations, the feeder topology, and the sensor locations and noise are known, and they define the likelihood of the measurements. The joint distribution of the injections is unknown and is learned from historical data as the prior. Bayes' rule combines the two into the posterior, which is available in closed form only for a Gaussian prior and linear measurements. Diffusion and flow priors have made this posterior tractable for non-Gaussian priors and nonlinear measurements [15], [16], [17], [18], and SmartMeterFM applies measurement-guided flow matching to smart meter data [19]. We train the prior once, and the measurements enter only at sampling, so the same prior serves any measurement set, noise level and topology. DSSE adds a combination these methods have not addressed: noisy measurements of a few aggregate quantities through the AC power flow, and estimates that must be physically consistent and calibrated.

Our solution, PoSE (posterior sampling for state estimation), is a conditional flow matching prior [20] over the substation injections, sampled with a noise-aware endpoint correction linearized through the power flow model. The contributions are:

  • To our knowledge, PoSE is the first DSSE method that samples the posterior with a learned generative prior and an inference-time endpoint correction toward the measurements. The prior over the secondary-substation injections is trained once on historical data and contains no sensor or noise information. The measurement set, its noise and the feeder model enter only through the correction. The same trained prior therefore serves any meter configuration, noise level and switching configuration of the feeder without retraining, and they return the posterior distribution of the state rather than a single estimate.

  • PoSE returns estimates that satisfy the AC power flow by construction. The prior is learned in the injection space, so the network never has to approximate the power flow equations, as estimators that output voltages must. Every posterior sample is instead mapped through the AC power flow, so every sampled voltage and branch current is a physically consistent operating point. Operational quantities, such as the probability that a voltage or thermal limit is violated, are read directly from the samples.

  • We design a noise-aware endpoint correction mechanism, with proven exactness in linear-Gaussian. It uses the full covariance of the learned prior instead of an isotropic or diagonal approximation. Its fast variant, PoSE-fast, forms

this covariance only along the measured directions, so its cost grows with the number of measurements, which is small in distribution grids, rather than with the state dimension.

References (31)