Implementation of a variance-targeting sum-constrained Gaussian sampling algorithm in the MEANDIR (v1.4) river inversion model
Abstract. Quantitative analysis of dissolved river chemistry underlies study of the chemical weathering reactions that stabilize the global carbon cycle over geological timescales. Because different chemical sources have distinct implications for the impact of weathering on biogeochemical cycles, interpreting fluvial chemistry requires constraining the fraction of each solute derived from separate lithologic or process end-members. The task of allocating river solute loads among end-member sources is commonly accomplished through inversion calculations. However, the process of sampling end-member chemical values for use within river inversion models was recently made much more complex by a shift away from normalizing chemical values to sodium and toward normalizing chemical values to a sum of parameters. Given that variables normalized to a sum must themselves sum to one, the updated normalization imposes constraints on the selection of end-member chemical ratios that have previously been overlooked. Here we demonstrate that the end-member selection process employed in the initial version of the MEANDIR model, which is an open-source program for conducting river inversion calculations, does not optimally sample end-member chemistry and results in artificially high end-member chemical variances that generate excess variance in inversion results. To correct this shortcoming, we present a new variance-targeting algorithm for sum-constrained sampling of Gaussian chemical distributions. The new approach is first demonstrated for normal distributions with a constant variance, then for three normal distributions with arbitrary variances, and finally a general case is presented for an arbitrary number of normal distributions with arbitrary variances. The final case operates by numerically calculating matrix components to maximize the absolute value of the matrix determinant subject to variance-based optimization constraints; rather than employing a user-defined covariance matrix, the algorithm maximizes the joint entropy of the vector of end-member chemical ratios. The algorithm is implemented in MEANDIR and used to invert a global river chemistry dataset. The updated sampling strategy reduces the compositional range of the end-member priors relative to the initial approach and results in modest-to-large reductions in the 95th-5th percentile range of accepted results for the fraction of carbonate mineral weathering. In contrast, the median inversion result does not change substantially under the new sampling algorithm. Overall, the variance-targeting and sum-constrained sampling algorithm improves the MEANDIR model by bringing end-member chemical priors into closer alignment with user-supplied distributions.