An emerging shift in glacial erosion regimes in the glacier-fed Galang Lake basin on the Tibetan Plateau
Authors: Luo, Yingzhong
Type: Model
Published: 2026-07-30

<p>This repository contains Python scripts for analyzing glacial erosion processes through two complementary approaches: (1) estimating erosion parameters (Kg and l) by modeling the relationship between summer glacier velocity and erosion rates using nonlinear least squares and Bayesian inversion methods, and (2) analyzing the relationships between glacial erosion rates and various environmental and glaciological variables through feature importance evaluation, standardized regression coefficient analysis, and enhanced correlation matrix visualization with posterior distributions. The code generates comprehensive figures for manuscript preparation, including data fitting plots, parameter trade-off visualizations, posterior distribution analyses, and multi-panel correlation matrices for different lake types.</p>
<p>The scripts require the following Python packages: pandas numpy matplotlib seaborn scikit-learn statsmodels scipy sklearn openpyxl The first analytical approach focuses on estimating erosion parameters through nonlinear least squares fitting using a power law model (ER = K<sub>g</sub> × SGV<em><sup>l</sup></em>) with parameter bounds constraints, R² calculation, and bootstrap confidence interval estimation (95% CI). This is complemented by Bayesian inversion through random parameter sampling within predefined ranges, likelihood calculation using a Gaussian error model, parameter selection based on likelihood thresholds, and posterior distribution analysis. Linear regression in log-transformed space provides initial parameter estimates and baseline model comparison. Data handling includes reading and filtering Excel datasets, removing invalid (zero or negative) values, and computing descriptive statistics. Figure generation produces data fitting plots with scatter points color-coded by year and gradient confidence bands, parameter trade-off density plots showing likelihood distributions in ln(K<sub>g</sub>) vs. <em>l</em> space, and posterior distribution curves with 60% and 90% confidence intervals.</p>
<p>The second analytical approach employs Random Forest Regressor for feature importance analysis to identify the most important factors controlling glacial erosion rates, evaluating variables including mean annual air temperature (MAT), mean annual precipitation (MAP), glacier cover, lake area, glacier mass balance (GMB), and summer glacier velocity. Standardized regression coefficient analysis uses multiple linear regression with standardized variables to identify the direction and magnitude of each factor's influence. Interaction effect analysis examines interaction effects between glacier cover and other variables using ordinary least squares (OLS) regression. Moving window feature importance analysis examines how feature importance changes along glacier cover gradients using an adaptive sliding window approach. Enhanced correlation matrix visualization displays correlation coefficients with significance markers (*, **, ***) in the upper triangle, posterior distribution histograms with prior distribution along the diagonal, and scatter plots with regression trends in the lower triangle, with color coding based on correlation direction and significance.</p>
<p>Comprehensive statistical validation provides summary results including feature importance rankings, standardized coefficients, and trend analysis with glacier cover. Both analytical approaches assume data is formatted in Excel files. For parameter estimation, the script expects columns for erosion rate (ER), summer glacier velocity (SGV), and year. For environmental correlation analysis, the script expects columns including Year, MAT_C, MAP_C, Glacier cover, Lake area, GMB, SGV), ER, and Lake type. The scripts automatically handle different sample sizes, perform simplified analysis for lakes with fewer than 5 samples, and adapt moving window parameters based on available data. Outputs include correlation matrix figures (PNG), data fitting plots, parameter trade-off density plots, posterior distribution curves, and detailed statistical results (Excel and CSV). Some scripts rely on manual file path updates (e.g.,r"D:\Research\data\ Glacial erosion _Tibet Plateau.xlsx"), which should be adjusted to your local system. The repository is primarily designed for reproducible analysis of glacial erosion dynamics and environmental controls as used in our manuscript.</p>