The European Central Bank published a working paper by Rodolfo Dinis Rigato presenting a closed-form least-squares filtering algorithm for linear sequence-space models, aimed at recovering unobserved structural shocks from observed data in macroeconomic frameworks increasingly used in heterogeneous-agent research. The paper is published as research and does not represent the ECB’s views. The approach reframes likelihood maximisation under normally distributed shocks as a constrained least-squares problem built on model impulse response functions, yielding filtered shocks as a linear transformation of observables. The paper highlights computational efficiency and extensions to handle measurement error, heteroskedastic (time-varying) shock variances, missing observations and non-Gaussian shocks, in which case the output becomes a best linear predictor rather than a conditional expectation. An application to simulated data from a medium-scale heterogeneous-agent New Keynesian model with seven shocks and seven observables indicates the filter can closely recover the underlying shocks across baseline and robustness scenarios, and the author provides publicly available implementation code.