Weighted Least Squares (WLS) is a statistical estimation method that determines the most probable state of a power system by minimizing the sum of weighted squared residuals between real-time measurements and calculated values. The weighting matrix is the inverse of the measurement error covariance matrix, ensuring that high-precision sensors (e.g., PMUs) exert more influence on the final estimate than low-accuracy pseudo-measurements.
Glossary
Weighted Least Squares (WLS)

What is Weighted Least Squares (WLS)?
The foundational statistical algorithm for power system state estimation, which reconciles noisy, redundant measurements with a physical network model to produce the most probable operating state.
The algorithm iteratively solves the non-linear AC power flow equations by linearizing them via the Jacobian matrix and computing the Gain matrix. This process assigns a quantitative confidence level to every meter reading, effectively filtering out Gaussian noise. WLS forms the computational backbone of modern Energy Management Systems, providing the consistent, reliable baseline required for contingency analysis and dynamic grid optimization.
Core Properties of WLS Estimation
The statistical and numerical properties that make Weighted Least Squares the workhorse of modern grid state estimation, from its mathematical formulation to its operational limitations.
The Objective Function
WLS minimizes the sum of weighted squared residuals: min J(x) = [z - h(x)]^T W [z - h(x)], where z is the measurement vector, h(x) is the nonlinear measurement function, and W is the weight matrix. The weight matrix is the inverse of the measurement error covariance matrix: W = R^{-1}. This formulation ensures that high-precision measurements (low variance) exert greater influence on the final estimate than noisy, low-confidence data points.
Gauss-Newton Iterative Solution
Because power flow equations are nonlinear, WLS solves the estimation problem iteratively. The normal equation at each iteration is: G Δx = H^T W [z - h(x)], where H is the Jacobian matrix of measurement functions, and G = H^T W H is the gain matrix. The state vector is updated via x^{k+1} = x^k + Δx until convergence. The gain matrix's sparsity structure mirrors the network topology, enabling efficient sparse triangular factorization.
Statistical Optimality Under Gaussian Noise
When measurement errors follow a zero-mean Gaussian distribution, the WLS estimator is the Maximum Likelihood Estimator (MLE). It produces the Best Linear Unbiased Estimate (BLUE), achieving the Cramér-Rao lower bound. This means no other unbiased estimator can achieve lower variance. The covariance of the estimated state is given by the inverse gain matrix: cov(x̂) = G^{-1}, providing direct uncertainty quantification for every bus voltage angle and magnitude.
Sensitivity to Bad Data
The quadratic penalty on residuals makes WLS highly sensitive to gross errors. A single corrupted measurement can skew the entire state estimate—a phenomenon called smearing. This is the estimator's primary operational weakness. Mitigation requires post-estimation bad data detection using the Chi-Square test on the objective function value or the Normalized Residual Test on individual measurement residuals to identify and remove outliers before re-estimation.
Observability Requirement
WLS requires the network to be algebraically observable. The gain matrix G must be nonsingular (full rank). If the measurement set is insufficient, G becomes singular and the normal equations cannot be solved. Observability analysis identifies observable islands and unobservable branches. In distribution systems with sparse real-time sensors, pseudo-measurements—synthetic data from historical load profiles or forecasts—are injected to restore numerical observability.
Weight Selection and Meter Characteristics
Weights are typically chosen as the reciprocal of measurement error variance: w_i = 1/σ_i². Standard assumptions include: 0.2% accuracy for PMU voltage measurements, 0.5-2% for RTU power flow measurements, and 20-50% for pseudo-measurements. The large variance assigned to pseudo-measurements reflects their low confidence, ensuring they only lightly constrain the solution. Proper weight tuning is critical—overly optimistic weights on bad data amplify estimation errors.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Explore the foundational statistical engine behind modern grid state estimation. These answers clarify how measurement uncertainty, iterative convergence, and numerical stability dictate the accuracy of your distribution system model.
Weighted Least Squares (WLS) is a statistical estimation method that minimizes the sum of weighted squared residuals between measured and estimated values, where weights are inversely proportional to measurement error variance. In power systems, WLS forms the computational core of the State Estimation function. The algorithm iteratively solves the equation Δx = (Hᵀ W H)⁻¹ Hᵀ W Δz, where H is the Jacobian matrix mapping measurements to states, W is the diagonal Covariance Matrix of measurement errors, and Δz is the mismatch between measured and calculated values. High-accuracy sensors like Phasor Measurement Units (PMUs) receive large weights, while low-accuracy Pseudo-Measurements receive small weights. The process repeats until the state correction Δx falls below a convergence threshold, yielding the maximum likelihood estimate of bus voltages and angles under the assumption of Gaussian noise.
Related Terms
Core concepts that interact with Weighted Least Squares in the distribution system state estimation workflow.
Distribution System State Estimation (DSSE)
The overarching algorithmic process that WLS solves. DSSE infers the complete voltage and current state of an unbalanced distribution network from a limited set of real-time sensor measurements and pseudo-measurements. Unlike transmission systems, DSSE must handle high R/X ratios, three-phase imbalance, and radial or weakly meshed topologies.
Gain Matrix (G)
The core computational object in the WLS normal equation: G = Hᵀ W H. It represents the information content of the measurement set, where:
- H: Jacobian matrix of measurement functions
- W: Inverse covariance matrix of measurement errors The condition number of G dictates numerical stability. Ill-conditioned gain matrices cause convergence failure and require regularization or observability restoration.
Bad Data Detection
Post-estimation statistical tests that identify gross measurement errors before they corrupt operational decisions. The Normalized Residual Test flags measurements whose residuals exceed a statistical threshold. The Chi-Square Test evaluates the overall fit. WLS assumes Gaussian noise, making it vulnerable to outliers—robust alternatives like the Huber M-Estimator or Least Absolute Value (LAV) are used when data quality is poor.
Observability Analysis
Determines whether a unique WLS solution exists given the available measurements and network topology. An unobservable system has a singular gain matrix. The analysis identifies:
- Observable islands: Solvable sub-networks
- Unobservable branches: Require pseudo-measurements
- Critical measurements: Single points of failure for observability Without full observability, WLS cannot converge to a unique state vector.
Covariance Matrix (R)
Defines the weighting philosophy of WLS. The diagonal elements are the error variances (σ²) of each measurement. High-variance measurements receive low weight; precision sensors receive high weight. The matrix is typically assumed diagonal, ignoring error correlations. Proper variance assignment is critical—overconfident weights on bad pseudo-measurements can bias the entire state estimate.
Forecast-Aided State Estimation
A dynamic extension of static WLS that incorporates time-series forecasts of load and generation as prior information. This bridges the gap between snapshot estimation and real-time tracking. The forecast provides a predicted state with associated uncertainty, which is fused with new measurements using a Kalman Filter framework, improving accuracy during rapid ramping events from solar and wind.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us