Performance Analysis of 1D Linear Kalman Filter in Modern Scientific Computing Environments
Keywords:
computational benchmarking, kalman filtering, linear state estimation, programming language performanceAbstract
We present a comprehensive performance analysis of 1D linear Kalman filter implementations across three modern scientific computing environments: Python, Julia, and R. Using a position tracking problem with hypothetical noisy sonar measurements, we evaluated both numerical accuracy and computational efficiency. All implementations produced numerically identical results within machine precision (maximum differences of m for position estimates), demonstrating the filter's ability to reduce measurement noise by 73.1% while accurately estimating unmeasured velocity states. Performance benchmarking revealed significant efficiency differences, with Python achieving a median execution time of 1.87 seconds, compared to 4.38 seconds for R and 34.82 seconds for Julia. Statistical analysis confirmed these differences were highly significant (Kruskal-Wallis ) with extremely large effect sizes (Cohen's d > 13 for all comparisons). Memory profiling revealed significant differences in resource utilization, with Python maintaining the most efficient footprint (97.67 MB), followed by Julia (132.45 MB) and R (168.21 MB), all with minimal variation. The unexpected underperformance of Julia relative to Python contradicts theoretical expectations and highlights the importance of empirical benchmarking for scientific computing applications. Our results provide practical guidance for implementing Kalman filters in time-critical or resource-constrained applications.
References
[2] L. A. McGee and S. F. Schmidt, “Discovery of the Kalman Filter as a Practical Tool for Aerospace and Industry,” NASA Tech. Memo., vol. 86847, 1985.
[3] S. Thrun, W. Burgard, and D. Fox, “Probabilistic Robotics,” MIT Press, 2005.
[4] X. Li, Z. Sun, D. Cao, Z. He, and Q. Zhu, “Real-Time Trajectory Planning for Autonomous Urban Driving: Framework, Algorithms, and Verifications,” IEEE/ASME Trans. Mechatronics, vol. 19, no. 3, pp. 1169–1179, 2014.
[5] W. Wu, Y. Gao, E. Bienenstock, J. P. Donoghue, and M. J. Black, “Bayesian Population Decoding of Motor Cortical Activity Using a Kalman Filter,” Neural Comput., vol. 18, no. 1, pp. 80–118, 2006.
[6] F. Orderud and H. Rabben, “Real-Time 3D Segmentation of the Left Ventricle Using Deformable Subdivision Surfaces,” Proc. IEEE CVPR, pp. 1–8, 2008.
[7] C. Komninakis, C. Fragouli, A. H. Sayed, and R. D. Wesel, “Multi-Input Multi-Output Fading Channel Tracking and Equalization Using Kalman Estimation,” IEEE Trans. Signal Process., vol. 50, no. 5, pp. 1065–1076, 2002.
[8] A. C. Harvey, Forecasting, Structural Time Series Models and the Kalman Filter. Cambridge Univ. Press, 1989.
[9] G. Evensen, “The Ensemble Kalman Filter: Theoretical Formulation and Practical Implementation,” Ocean Dyn., vol. 53, no. 4, pp. 343–367, 2003.
[10] A. F. Bennett, “Inverse Methods in Physical Oceanography,” Cambridge Monogr. Mech. Appl. Math., 1992.
[11] A. Carrassi, M. Bocquet, L. Bertino, and G. Evensen, “Data Assimilation in the Geosciences: An Overview of Methods, Issues, and Perspectives,” Wiley Interdiscip. Rev.: Climate Change, vol. 9, no. 5, p. e535, 2018.
[12] G. Evensen, “Sequential Data Assimilation with a Nonlinear Quasi-Geostrophic Model Using Monte Carlo Methods to Forecast Error Statistics,” J. Geophys. Res., vol. 99, no. C5, pp. 10143–10162, 1994.
[13] E. Kalnay, Atmospheric Modeling, Data Assimilation and Predictability. Cambridge Univ. Press, 2003.
[14] G. Welch and G. Bishop, “SCAAT: Incremental Tracking with Incomplete Information,” Proc. ACM SIGGRAPH, pp. 333–344, 1997.
[15] M. S. Grewal and A. P. Andrews, Kalman Filtering: Theory and Practice Using MATLAB. Wiley, 2001.
[16] D. Simon, Optimal State Estimation: Kalman, H, and Nonlinear Approaches. Wiley, 2006.
[17] C. R. Harris, K. J. Millman, S. J. van der Walt, R. Gommers, P. Virtanen, D. Cournapeau, E. Wieser, J. Taylor, S. Berg, N. J. Smith, R. Kern, M. Picus, S. Hoyer, M. H. van Kerkwijk, M. Brett, A. Haldane, J. F. del Río, M. Wiebe, P. Peterson, P. Gérard-Marchant, K. Sheppard, T. Reddy, W. Weckesser, H. Abbasi, C. Gohlke, and T. E. Oliphant, “Array Programming with NumPy,” Nature, vol. 585, no. 7825, pp. 357–362, 2020.
[18] R Core Team, “R: A Language and Environment for Statistical Computing,” R Found. Stat. Comput., 2021.
[19] J. Bezanson, A. Edelman, S. Karpinski, and V. B. Shah, “Julia: A Fresh Approach to Numerical Computing,” SIAM Rev., vol. 59, no. 1, pp. 65–98, 2017.
[20] J. M. Perkel, “Programming: Pick Up Python,” Nature, vol. 518, no. 7537, pp. 125–126, 2019.
[21] S. Raschka, J. Patterson, and C. Nolet, “Machine Learning in Python: Main Developments and Technology Trends in Data Science, Machine Learning, and Artificial Intelligence,” Inf. Syst., vol. 2, no. 3, p. 31, 2020.
[22] D. L. Donoho, “Reproducible Research in Computational Harmonic Analysis,” Comput. Sci. Eng., vol. 11, no. 1, pp. 8–18, 2009.
[23] P. Kim, Kalman Filter for Beginners: with MATLAB Examples. CreateSpace Independent Publishing Platform, 2011.
[24] S. Herho, S. N. Kaban, D. E. Irawan, and R. Kapid, “Efficient 1D Heat Equation Solver: Leveraging Numba in Python,” Eksakta : Berkala Ilmiah Bidang MIPA, vol. 25, no. 2, pp. 126–137, 2024.
[25] S. Herho, I. Anwar, K. Herho, C. Dharma, and D. Irawan, “COMPARING SCIENTIFIC COMPUTING ENVIRONMENTS FOR SIMULATING 2D NON-BUOYANT FLUID PARCEL TRAJECTORY UNDER INERTIAL OSCILLATION: A PRELIMINARY EDUCATIONAL STUDY,” Indonesian Physical Review, vol. 7, no. 3, pp. 451–468, 2024.
[26] S. Herho and S. Kaban, “Quantitative Performance Analysis of Spring-Mass-Damper Control Systems: A Comparative Implementation in Python and R,” Preprints, 2024.
[27] S. Herho, S. Kaban, and I. Anwar, “Benchmarking Modern Scientific Computing Platforms for 2D Potential Flow Solver,” Engineering Archive, 2025.
[28] S. Herho, F. Fajary, K. Herho, I. Anwar, R. Suwarman, and D. Irawan, “Reappraising Double Pendulum Dynamics across Multiple Computational Platforms,” CLEI Electronic Journal, vol. 28, no. 1, 2025.