Efficient curve fitting with penalized B-splines for oceanographic and ecological applications

Sci Rep. 2025 Jul 1;15(1):21958. doi: 10.1038/s41598-025-05779-3.

Abstract

This study introduces a penalized B-spline approach for estimating smooth curves, incorporating a total variation penalty to balance flexibility and interpretability. By leveraging group penalties and the Alternating Direction Method of Multipliers (ADMM) algorithm, the method ensures consistency across response variables and computational efficiency. We applied this approach to two real-world datasets: oceanographic drifter data in the Niño 4 region and Demoiselle Crane migration data. The fitted trajectories closely captured both large-scale trends and localized variations, demonstrating robustness against noise and irregularly sampled data. This framework is particularly advantageous for analyzing spatiotemporal data, as it effectively removes unnecessary knots and adapts to the complexity of underlying patterns. The total variation penalty controls curve smoothness by penalizing abrupt changes in the estimated function, while the group penalty ensures that all response variables share a consistent set of knots, enhancing interpretability. Although this study focused on two-dimensional spatial trajectories, the methodology is designed for general p-dimensional data and can be extended to three-dimensional datasets, such as avian flight paths or marine animal diving behaviors. Future research could refine the approach by dynamically selecting penalty parameters or expanding its applicability to broader multidimensional settings. This robust and adaptable technique provides a practical tool for analyzing complex spatiotemporal data across various scientific disciplines.