Inferensys

Glossary

Weighted Least Squares (WLS)

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.
Finance professional using AI FP&A copilot on laptop, board presentation visible on screen, home office work session.
STATE ESTIMATION CORE

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.

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.

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.

FOUNDATIONAL ESTIMATOR

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.

01

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.

02

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.

03

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.

04

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.

05

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.

06

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.

WEIGHTED LEAST SQUARES

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.

Prasad Kumkar

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.