A method and system for biological food source contribution analysis based on bayesian mixture model
By constructing a hierarchical Bayesian mixture model and introducing food source distinguishability diagnosis, the problem of food source contribution analysis under conditions of multiple food sources and overlapping isotopes was solved. This enabled efficient and reliable estimation of food source contribution ratios and model convergence diagnosis, improving the accuracy and automation of ecological analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN RES INST FOR WATER TRANSPORT ENG M O T
- Filing Date
- 2026-06-12
- Publication Date
- 2026-07-14
AI Technical Summary
Existing methods for analyzing food source contributions in ecology suffer from insufficient distinguishability of results, insufficient model stability, and insufficient consistency in the interpretation of results under conditions of multiple food sources and overlapping isotopes. They also lack the inclusion of quantitative diagnosis of food source distinguishability, fractionation uncertainty, and element concentration weights.
By constructing a hierarchical Bayesian mixture model, food source distinguishability diagnosis is introduced, the isotopic spatial distance and posterior overlap probability between potential food sources are calculated, food sources with low isotopic distinguishability are processed by merging or hierarchical constraints, and posterior sample sequences are generated by simplex constraint transformation and Markov chain Monte Carlo sampling. The posterior distribution characteristics and model convergence diagnosis results are output.
It improves the distinguishability, convergence stability and result reliability of isotopic vegetarian source contribution analysis under multiple food source conditions, enhances the degree of automation of the analysis, and provides quantitative diagnosis of Bayesian confidence intervals and dominant food source probabilities.
Smart Images

Figure CN122392819A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of ecology and stable isotope analysis technology, and in particular to a method and system for analyzing the contribution of biological food sources based on a Bayesian mixture model. Background Technology
[0002] In ecological and food web research, determining the relative contribution of different potential food sources to a target species is fundamental to understanding material and energy flow pathways, feeding strategies, and trophic niches. One widely used method for analyzing food source contribution is a mixture model based on stable isotope measurements. Stable isotope techniques, based on the differences in stable isotope dimensions such as carbon and nitrogen among different food sources, use mathematical modeling to infer the contribution ratio of each food source.
[0003] However, in real ecosystems, the number of potential food sources is usually large, and the stable isotopic characteristics of carbon, nitrogen, and sulfur from different food sources may overlap significantly. When the spatial overlap of food source isotopes is high, even using a Bayesian mixture model may result in problems such as a wide posterior distribution, highly correlated contribution ratios of different food sources, and difficulty in identifying dominant food sources. Furthermore, isotopic fractionation coefficients between the target species and food sources, natural variations within food sources, differences in elemental concentrations, and instrument measurement errors can all affect the model's inference results. Existing analytical procedures typically focus on outputting the posterior distribution of each food source's contribution ratio, lacking automated techniques for quantitatively diagnosing food source distinguishability before modeling, jointly incorporating fractionation uncertainty and elemental concentration weights during modeling, and simultaneously providing model convergence diagnosis and dominant food source probabilities at the results output stage. Therefore, under conditions of multiple food sources and overlapping isotopes, existing methods still suffer from insufficient result distinguishability, insufficient model stability, and insufficient consistency in result interpretation. Summary of the Invention
[0004] To address the aforementioned problems in existing technologies, the first aspect of this invention proposes a method for analyzing the contribution of biological food sources based on a Bayesian mixture model, comprising: S1: Obtain stable isotope values of the target species sample, stable isotope values of multiple potential food source samples, isotope fractionation coefficients of the target species sample relative to each potential food source sample, and elemental concentration parameters of each potential food source sample. S2: Based on the stable isotope measurements of each potential food source sample, construct the isotope mean vector and isotope covariance matrix for each potential food source sample, and construct the fractionation correction parameters corresponding to the potential food source sample based on the isotope fractionation coefficient. S3: Based on the isotope mean vector, isotope covariance matrix and fractionation correction parameters of each potential food source sample, calculate the degree of isotope distinguishability between any two potential food source samples; merge or stratify potential food source samples with isotope distinguishability below a preset limit to obtain a set of candidate food sources after distinguishability screening. S4: Using the isotope mean vector, isotope covariance matrix, fractionation correction parameter, elemental concentration parameter, and stable isotope measurements of the target species sample as inputs for each candidate food source in the candidate food source set, a hierarchical Bayesian mixture model is constructed; through simplex constraint transformation and Markov chain Monte Carlo sampling, a posterior sample sequence of the contribution ratio of each candidate food source to the target species is generated; based on the posterior sample sequence, the posterior distribution characteristics of the contribution ratio of each candidate food source and the model convergence diagnosis results are determined.
[0005] Compared with the prior art, the beneficial effects of the present invention are as follows: First, this invention introduces food source distinguishability diagnosis before constructing a Bayesian mixture model. By calculating the isotopic spatial distance or posterior overlap probability between potential food sources, it can identify food sources with highly overlapping isotopic features before model inference, and reduce the indistinguishability under multiple food source conditions through merging, grouping, labeling, or hierarchical constraints.
[0006] Second, this invention incorporates the mean vector of food source isotopes, covariance matrix, isotope fractionation uncertainty, elemental concentration parameters, and measurement errors into a hierarchical Bayesian mixture model, enabling the model to not only utilize the isotope values at the center of the food source, but also reflect the influence of natural variations within the food source, fractionation differences, and measurement errors on the contribution ratio estimation.
[0007] Third, this invention improves the sampling stability of the contribution ratio vector in the high-dimensional simplex space by using simplex constraint transformation and adaptive Markov chain Monte Carlo sampling, thereby reducing invalid sampling and convergence difficulties caused by the non-negative contribution ratios and the sum of 1.
[0008] Fourth, while outputting the posterior probability distribution of the food source contribution ratio, this invention further outputs the Bayesian confidence interval, the probability of the dominant food source, the diagnostic results of food source distinguishability, and the diagnostic results of model convergence, thereby improving the reliability, interpretability, and automation of the biological food source contribution analysis results. Attached Figure Description
[0009] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0010] Figure 1 The diagram shown is a flowchart illustrating a method for analyzing the contribution of biological food sources based on a Bayesian mixture model, according to an embodiment of the present invention. Figure 2 The diagram shown is a schematic diagram of a biological food source contribution analysis system based on a Bayesian mixture model provided in an embodiment of the present invention. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0012] The specific embodiments of the present invention will be described below.
[0013] Example 1 like Figure 1 As shown, the first aspect of this invention proposes a method for analyzing the contribution of biological food sources based on a Bayesian mixture model, comprising: S1: Obtain stable isotope values of the target species sample, stable isotope values of multiple potential food source samples, isotope fractionation coefficients of the target species sample relative to each potential food source sample, and elemental concentration parameters of each potential food source sample. S2: Based on the stable isotope measurements of each potential food source sample, construct the isotope mean vector and isotope covariance matrix for each potential food source sample, and construct the fractionation correction parameters corresponding to the potential food source sample based on the isotope fractionation coefficient. S3: Based on the isotope mean vector, isotope covariance matrix and fractionation correction parameters of each potential food source sample, calculate the degree of isotope distinguishability between any two potential food source samples; merge or stratify potential food source samples with isotope distinguishability below a preset limit to obtain a set of candidate food sources after distinguishability screening. S4: Using the isotope mean vector, isotope covariance matrix, fractionation correction parameter, elemental concentration parameter, and stable isotope measurements of the target species sample as inputs for each candidate food source in the candidate food source set, a hierarchical Bayesian mixture model is constructed; through simplex constraint transformation and Markov chain Monte Carlo sampling, a posterior sample sequence of the contribution ratio of each candidate food source to the target species is generated; based on the posterior sample sequence, the posterior distribution characteristics of the contribution ratio of each candidate food source and the model convergence diagnosis results are determined.
[0014] The study obtains stable isotope measurements of the target species sample, stable isotope measurements of multiple potential food source samples, isotopic fractionation coefficients of the target species sample relative to each potential food source sample, and elemental concentration parameters of each potential food source sample. Stable isotope measurements can be carbon and nitrogen stable isotope measurements, and elemental concentration parameters can be carbon and nitrogen percentages. Based on the stable isotope measurements of each potential food source sample, an isotopic mean vector and an isotopic covariance matrix are constructed for each sample. The isotopic covariance matrix captures the natural variations within a potential food source sample and between batches. Simultaneously, fractionation correction parameters are constructed for each potential food source sample based on the isotopic fractionation coefficients. These parameters include a fractionation mean correction vector and a fractionation uncertainty covariance matrix, used to simultaneously characterize the systematic shift and random fluctuations in isotopic fractionation.
[0015] Based on the isotopic mean vector, isotopic covariance matrix, and fractionation correction parameters of each potential food source sample, the isotopic distinguishability between any two potential food source samples is calculated. The distinguishability can be represented by quantitative indicators such as Mahalanobis distance or posterior overlap probability. Potential food source samples with isotopic distinguishability below a preset threshold are merged or subjected to stratified constraints. Merging generates combined food sources, and the isotopic mean vector and isotopic covariance matrix of the combined food sources are recalculated. Stratified constraints establish a joint prior distribution for potential food source samples belonging to the same food source group, thus obtaining a candidate food source set after distinguishability screening. This operation identifies and processes food sources with highly overlapping isotopic characteristics before modeling, effectively reducing model dimensionality and enhancing parameter distinguishability.
[0016] A hierarchical Bayesian mixture model is constructed using the isotopic mean vector, isotopic covariance matrix, fractionation correction parameters, elemental concentration parameters, and stable isotopic measurements of the target species sample as inputs for each candidate food source in the candidate food source set. In the observation layer of the model, the stable isotopic measurements of the target species sample are assumed to follow a multivariate normal distribution. The mean of the distribution is represented by the sum of the corrected source values of each candidate food source, weighted by the elemental concentration parameters. The covariance matrix of the distribution is composed of the isotopic covariance matrix of each candidate food source, the fractionation uncertainty covariance matrix corresponding to each candidate food source, and the measurement error covariance matrix. A Dirichlet prior distribution is set for the contribution ratio vector, and weakly informative prior distributions are set for the parameters in the fractionation uncertainty covariance matrix and the measurement error covariance matrix, forming a complete hierarchical Bayesian mixture model. By using simplex constraint transformation, the contribution ratio vector, which is restricted by nonnegativity and summation to 1, is converted into an unconstrained real-valued vector. Then, adaptive Markov chain Monte Carlo sampling is used to perform posterior sampling on the model to generate a posterior sample sequence of the contribution ratio of each candidate food source to the target species. The adaptive mechanism dynamically adjusts the sampling step size to improve the exploration efficiency of high-dimensional simplex space.
[0017] Based on the posterior sample sequences, the posterior mean, Bayesian confidence interval, and posterior probability of each candidate food source being the dominant food source are calculated for its contribution proportion. Multiple independent Markov chains are run, and the consistency of variance between and within chains is assessed by calculating the latent scaling factor. The posterior distribution characteristics and model convergence diagnostic results are then output. This process prioritizes food source distinguishability diagnosis in the modeling stage, incorporating food source variation, fractionation uncertainty, elemental concentration weights, and measurement errors into a hierarchical model. Constraint transformations and adaptive sampling ensure computational stability, thereby comprehensively improving the reliability of contribution proportion estimation.
[0018] This invention improves the distinguishability, convergence stability, and reliability of stable isotopic vegetarian source contribution analysis under multiple food source conditions by using food source distinguishability pre-diagnosis, hierarchical Bayesian modeling, and simplex-constrained sampling.
[0019] In some implementations, S1 includes: S11: The tissue sample of the target species is degreased, dried and homogenized to obtain the target species sample to be tested; S12: Various potential food source samples, including Ulva samples, phytoplankton samples, seagrass samples, benthic algae samples, and sediment samples, were pretreated to obtain various pretreated food source samples. Specifically, Ulva samples were treated with dilute hydrochloric acid solution soaking, deionized water rinsing, and freeze-drying; phytoplankton samples were treated with acidification fumigation and freeze-drying; seagrass and benthic algae samples were treated with dilute hydrochloric acid solution soaking, deionized water rinsing, and freeze-drying; and sediment samples were treated with acidification and freeze-drying. S13: Input the target species sample and various pretreated food source samples into the isotope ratio mass spectrometer for measurement to obtain the carbon stable isotope and nitrogen stable isotope values of the target species sample, as well as the carbon stable isotope and nitrogen stable isotope values of each potential food source sample. S14: Obtain the carbon isotope fractionation coefficient and nitrogen isotope fractionation coefficient of the target species relative to each potential food source sample, as well as the elemental concentration parameters of each potential food source sample.
[0020] The target species tissue samples were first degreased, dried, and homogenized to obtain the target species test samples. For various potential food source samples, corresponding pretreatment operations were performed according to their respective matrix characteristics. For example, Ulva samples were first soaked in dilute hydrochloric acid solution to remove surface-adhered carbonates, then rinsed with deionized water to remove residual acid, and finally freeze-dried; phytoplankton samples were acidified and fumigated to remove inorganic carbon, followed by freeze-drying; seagrass and benthic algae samples were each soaked in dilute hydrochloric acid solution, rinsed with deionized water, and freeze-dried; sediment samples were acidified and freeze-dried. These pretreatment measures effectively eliminated the interference of inorganic carbon and water on isotope ratio measurements. The target species test samples and various pretreated food source samples were sent to an isotope ratio mass spectrometer for analysis to obtain the carbon stable isotope and nitrogen stable isotope values of the target species samples, as well as the carbon stable isotope and nitrogen stable isotope values of each potential food source sample. Simultaneously, the carbon and nitrogen isotope fractionation coefficients of the target species relative to each potential food source sample, as well as the elemental concentration parameters of each potential food source sample, were obtained. These elemental concentration parameters can be calculated from the carbon and nitrogen percentages measured by an elemental analyzer. By customizing pretreatment methods for different food source types, matrix effects and inorganic carbon interference were eliminated, ensuring that the obtained isotope data accurately reflect the stable isotopic characteristics of each potential food source.
[0021] Different pretreatment processes were implemented for different food source matrices to ensure the accuracy and representativeness of carbon stable isotope and nitrogen stable isotope measurements, providing highly reliable measured data for model input.
[0022] In some implementations, S2 includes: S21: Based on the carbon stable isotope measurement value and nitrogen stable isotope measurement value of each potential food source sample, calculate the two-dimensional isotope sample mean as the isotope mean vector of the potential food source sample; and calculate the two-dimensional isotope sample covariance matrix as the isotope covariance matrix of the potential food source sample. S22: Based on the carbon isotope fractionation coefficient and nitrogen isotope fractionation coefficient of the target species sample relative to the potential food source sample, construct the fractionation mean correction vector and set the fractionation uncertainty covariance matrix. The fractionation mean correction vector and the fractionation uncertainty covariance matrix together constitute the fractionation correction parameters corresponding to the potential food source sample.
[0023] For each potential food source sample, a two-dimensional isotopic sample mean was calculated based on the carbon and nitrogen stable isotope measurements of the potential food source sample, serving as the isotopic mean vector of the potential food source sample. Simultaneously, a two-dimensional isotopic sample covariance matrix was calculated as the isotopic covariance matrix of the potential food source sample. The covariance matrix comprehensively reflects the degree of natural variation among different individuals within the potential food source sample and between measurement batches. Based on the carbon and nitrogen isotope fractionation coefficients of the target species sample relative to the potential food source sample, a fractionation mean correction vector was constructed, and a fractionation uncertainty covariance matrix was defined. The fractionation uncertainty covariance matrix reflects the fluctuation range of the fractionation coefficients under different individuals, tissue types, or feeding conditions. The fractionation mean correction vector and the fractionation uncertainty covariance matrix together constitute the fractionation correction parameters corresponding to the potential food source sample.
[0024] When the aforementioned food source characteristic parameters and fractionation correction parameters are provided to the hierarchical Bayesian mixture model, the mean term of the model observation equation can be expressed as the sum of the contribution proportions of each candidate food source after fractionation correction, weighted by element concentration. The covariance term can be decomposed into the sum of the food source variation covariance, the fractionation uncertainty covariance, and the measurement error covariance. This allows the inference process of the contribution proportion to integrate the variability information from each stage from sampling, preprocessing, measurement to fractionation correction. The resulting posterior estimate is more stable, and the range of the confidence interval can better reflect the actual uncertainty.
[0025] By constructing a fractionation correction parameter that includes a fractionation mean correction vector and a fractionation uncertainty covariance matrix, and using it in conjunction with the food source isotope mean vector and isotope covariance matrix, the hierarchical Bayesian mixture model can comprehensively characterize the food source center location, internal natural variation, fractionation system offset, and fractionation random fluctuations, thereby improving the model's ability to accommodate multiple uncertainties.
[0026] In some implementations, potential food source samples are merged in S3, specifically including: For any two potential food source samples, calculate the Mahalanobis distance between the isotopic mean vectors of the two potential food source samples. The covariance matrix determined by the sum of the isotopic covariance matrix of the two potential food source samples and the corresponding fractionation uncertainty covariance matrix is used as the basis for the distance metric, and the Mahalanobis distance is used as the degree of isotopic distinguishability. Potential food source samples with isotopic distinguishability below a preset limit are merged into a combined food source, and the isotopic mean vector and isotopic covariance matrix of the combined food source are calculated. The combined food sources generated after merging and the unmerged potential food source samples constitute a candidate food source set after distinguishability screening.
[0027] For any two potential food source samples, the Mahalanobis distance between their isotopic mean vectors is calculated. The Mahalanobis distance is based on the isotopic covariance matrix of the two potential food source samples and the covariance matrix obtained by adding their respective fractionation uncertainty covariance matrices. The Mahalanobis distance not only reflects the degree of central separation between the two potential food source samples in isotopic space but also incorporates the influence of food source variability and fractionation uncertainty, quantitatively expressing the degree of isotopic distinguishability between the two potential food source samples. When the Mahalanobis distance is below a preset threshold, it indicates a high degree of overlap in the isotopic characteristics of the two potential food source samples. In this case, the two potential food source samples are merged into a combined food source. The isotopic mean vector of the combined food source is recalculated from the isotopic measurements of all merged samples, and the isotopic covariance matrix of the combined food source is also reconstructed from the isotopic measurements of all merged samples. After merging, the combined food source and the unmerged potential food source samples together constitute a candidate food source set after distinguishability screening. By merging the data, food sources that were originally indistinguishable by isotope are treated as a unified source in the candidate set. This avoids the situation where the mixed model attempts to distinguish indistinguishable food sources in a highly collinear parameter space, thereby eliminating the multimodality of the posterior distribution, narrowing the confidence interval, making the model inference more stable, and making the determination of the dominant food source more clear and reliable.
[0028] The isotope distinguishability is quantified into Mahalanobis distance, and highly overlapping potential food source samples are merged according to a preset limit. This reduces isotope redundancy among candidate food sources and enhances the distinguishability of contribution ratios and the ability to identify dominant food sources in the hybrid model.
[0029] In some implementations, S4 constructs a hierarchical Bayesian mixture model and generates posterior sample sequences through simplex constraint transformation and Markov chain Monte Carlo sampling, specifically including: S41: Construct an observation model to ensure that the stable isotope measurements of the target species samples follow a multivariate normal distribution. For the mean of the distribution, first add the isotope mean vector of each candidate food source to the corresponding fractionation mean correction vector to obtain the corrected source value of the candidate food source. Then, weight the contribution ratios according to the elemental concentration parameters of the candidate food sources, and sum the corrected source values of all candidate food sources according to the weighted contribution ratios to obtain the mean. The covariance matrix of the distribution consists of the isotope covariance matrix of each candidate food source, the fractionation uncertainty covariance matrix corresponding to each candidate food source, and the measurement error covariance matrix. S42: Set a Dirichlet prior distribution for the contribution ratio vector and set prior distributions for the parameters in the fractionation uncertainty covariance matrix and the measurement error covariance matrix to form a hierarchical Bayesian mixture model. S43: The contribution ratio vector constrained by nonnegativity and sum to 1 is transformed into an unconstrained real-valued vector using simplex constraint transformation. Adaptive Markov chain Monte Carlo sampling is used to sample the hierarchical Bayesian mixture model to generate a posterior sample sequence of the contribution ratio of each candidate food source. S44: Based on the posterior sample sequence, calculate the posterior mean of the contribution ratio of each candidate food source, the Bayesian confidence interval, and the probability that the candidate food source is the dominant food source, as the posterior distribution characteristics and model convergence diagnosis results.
[0030] When constructing the hierarchical Bayesian mixture model, the observation model is first constructed to ensure that the stable isotope measurements of the target species samples follow a multivariate normal distribution. The mean of the distribution is determined as follows: the isotope mean vector of each candidate food source is added to the corresponding fractionation mean correction vector to obtain the corrected source value of the candidate food source. The corrected source value represents the expected isotope signal of the target species after fractionation correction following assimilation of the food source. Subsequently, the contribution ratio is weighted by the elemental concentration parameter of the candidate food source, and the corrected source values of all candidate food sources are summed according to the weighted contribution ratio to obtain the mean of the distribution. For example, when the carbon and nitrogen concentrations differ due to different food sources, the elemental concentration parameter automatically adjusts the mass balance weight of the contribution ratio in the two isotope dimensions to avoid ignoring the contribution ratio estimation bias caused by differences in elemental concentration. The covariance matrix of the distribution is composed of the isotopic covariance matrix of each candidate food source, the fractionation uncertainty covariance matrix corresponding to each candidate food source, and the measurement error covariance matrix. The isotopic covariance matrix reflects the natural variation between individuals and batches of food sources, the fractionation uncertainty covariance matrix reflects the random fluctuation of the fractionation coefficient under different individual, tissue, or dietary conditions, and the measurement error covariance matrix reflects the measurement error of the isotope ratio mass spectrometer. Because the covariance structure simultaneously incorporates food source variation, fractionation uncertainty, and measurement error, the model can reasonably decompose the total dispersion in the measured data to the corresponding uncertainty sources, thereby avoiding misattributing all residuals to the contribution ratio estimate and making the posterior confidence interval more realistically reflect the actual cognitive level.
[0031] A Dirichlet prior distribution is set for the contribution ratio vector, and prior distributions are set for the parameters in the fractionation uncertainty covariance matrix and the measurement error covariance matrix. For example, the variance parameter can be set with weak information distributions such as semi-Cauchy prior or inverse Wieshard prior, thus forming a complete hierarchical Bayesian mixture model. In the parameterization stage of model sampling, the contribution ratio vector constrained by nonnegativity and a sum of 1 is transformed into an unconstrained real-valued vector using simplex constraint transformation. Specifically, this can be achieved through central logarithmic ratio transformation or equidistant logarithmic ratio transformation, mapping the K-dimensional simplex space to a K-1-dimensional unconstrained real space, eliminating the obstacle of the simplex boundary to the sampling path. Adaptive Markov chain Monte Carlo sampling is used to perform posterior sampling on the hierarchical Bayesian mixture model. The adaptive mechanism dynamically adjusts the covariance matrix or scaling factor of the proposal distribution based on the iteratively generated posterior sample sequence, so that the proposal distribution gradually approximates the true shape of the target posterior distribution, improving the exploration efficiency and sample acceptance rate of the high-dimensional parameter space, and finally generating the posterior sample sequence of the contribution ratio of each candidate food source.
[0032] Based on the posterior sample sequence, the posterior mean of the contribution proportion of each candidate food source is calculated as the center estimate. A Bayesian confidence interval is calculated as the uncertainty range. The probability that a candidate food source is the dominant food source is calculated; the probability of a dominant food source is defined as the frequency at which the contribution proportion of one candidate food source is greater than that of other candidate food sources in all posterior samples. Simultaneously, posterior distribution characteristics and model convergence diagnostic results are generated. The model convergence diagnostic results can be obtained by running multiple independent Markov chains in parallel and calculating the latent scale reduction factor.
[0033] By combining multivariate normal observation, Dirichlet prior, simplex constraint transformation and adaptive Markov chain Monte Carlo sampling, and incorporating food source correction values, element concentration weights, food source variability, fractionation uncertainty and measurement error, the accuracy of contribution ratio posterior estimation and sampling efficiency are improved.
[0034] In some implementations, S3 performs stratified constraint processing on potential food source samples, specifically including: Potential food source samples with isotopic distinguishability below a preset threshold are grouped into the same food source group. In the hierarchical Bayesian mixture model, a joint prior distribution is set for the contribution ratio of each potential food source sample within the same food source group; Food source groups are retained in the candidate food source set, forming a candidate food source set that includes single food sources and food source groups.
[0035] When the isotopic distinguishability between any two potential food source samples is below a predetermined threshold, the potential food source samples with isotopic distinguishability below the predetermined threshold are classified into the same food source group. For example, in a nearshore marine food web study, if the carbon stable isotope measurements and nitrogen stable isotope measurements of seagrass and epiphytic algae samples remain highly similar after incorporating food source variability and fractionation uncertainty, and the Mahalanobis distance is below a predetermined threshold, then the seagrass and epiphytic algae samples are classified into the same food source group, for example, named the benthic primary producers group.
[0036] In hierarchical Bayesian mixture models, a joint prior distribution is established for the contribution proportions of each potential food source sample within the same food source group. One implementation of the joint prior distribution is a nested Dirichlet prior structure, where a Dirichlet prior is first assigned to the food source group as a whole to determine the relative contribution of the food source group to other candidate food sources, and then an independent Dirichlet prior is assigned to each potential food source sample within the food source group to determine the relative contribution share of each food source within the group. Another implementation is to set the sum of contribution proportions within the group to follow a beta prior or a truncated normal prior, applying a prior contraction effect to the allocation of food source contributions within the group, so that the estimation of contribution proportions within the group is smoothly allocated under the guidance of weak isotopic differences or other auxiliary information, avoiding the posterior distribution of the contribution proportions of group members from completely following the prior due to indistinguishability.
[0037] By retaining food source groups within the candidate food source set, a candidate food source set is formed that includes both single food sources and food source groups. Subsequent posterior inferences generate both the overall contribution proportion of the food source group and the contribution proportion of each potential food source sample within the group. This allows the analysis results to take into account both the relative importance of macroscopic food source categories and the relative importance of specific food sources within the group, providing hierarchical granular support for the identification of material and energy flow pathways in the ecosystem.
[0038] Hierarchical constraints are applied to potential food source samples with highly overlapping isotopic characteristics. A joint prior distribution is set for the same food source group in the hierarchical Bayesian mixture model. This not only preserves the detailed contribution information of food sources within the group, but also controls the interference of indistinguishability within the group on the overall estimation, thereby enhancing the identifiability and robustness of food source contribution analysis under the condition of overlapping food sources.
[0039] In some implementations, the model convergence diagnostic results in S4 are generated as follows: Run multiple independent Markov chains to obtain the posterior sample sequences under each Markov chain; Based on the posterior sample sequences of each Markov chain, the inter-chain variance and intra-chain variance are calculated to obtain the potential scale reduction factor. When the potential scaling factor is less than the preset diagnostic limit, the model converges to a diagnostic result.
[0040] During model convergence diagnosis, multiple independent Markov chains are run, each starting from dispersed initial values. These initial values can be generated through an overdiscrete distribution, ensuring that the initial contribution proportion vectors of each chain are far apart in the simplex space. Adaptive Markov Chain Monte Carlo sampling is then performed on each Markov chain to obtain the posterior sample sequence for each Markov chain.
[0041] Based on the posterior sample sequences of each Markov chain, the between-chain variance and the within-chain variance are calculated. The between-chain variance measures the degree of deviation between the sample means of different Markov chains, while the within-chain variance measures the dispersion of the posterior samples within each Markov chain. The latent scaling factor is calculated using the between-chain and within-chain variances, which can be constructed as the square root of the ratio of the total posterior variance to the within-chain variance. When the sampling distributions of all Markov chains tend to be consistent after sufficient iterations, the between-chain variance and the within-chain variance become close, and the latent scaling factor approaches the reference value.
[0042] When the potential scaling factor is less than the preset diagnostic threshold, it is determined that all Markov chains have converged to the same target posterior distribution, generating a model convergence diagnostic result. If the potential scaling factor is still greater than the preset diagnostic threshold, it indicates that there are still unresolved systemic differences between different chains, requiring further iterations or adjustments to the adaptive sampling parameters until the potential scaling factor falls below the preset diagnostic threshold. Once the model convergence diagnostic result indicates convergence, the subsequent calculations of the posterior mean, Bayesian confidence interval, and dominant food source probability based on the posterior sample sequence become reliable, and the resulting biological food source contribution analysis conclusions can serve as a quantitative basis for ecological interpretation.
[0043] This invention quantitatively determines the convergence state of a hierarchical Bayesian mixture model by running multiple Markov chains in parallel and calculating the potential scale reduction factor, ensuring that the posterior inference of contribution ratios is based on fully mixed Markov chains and avoiding erroneous inferences caused by non-converged sampling.
[0044] Example 2 like Figure 2 As shown, in a second aspect, the present invention proposes a biological food source contribution analysis system based on a Bayesian mixture model. The system employs a biological food source contribution analysis method based on a Bayesian mixture model proposed in any of the above embodiments. The system includes: The data acquisition module is used to perform step S1: acquire the stable isotope values of the target species sample, the stable isotope values of multiple potential food source samples, the isotope fractionation coefficient of the target species sample relative to each potential food source sample, and the elemental concentration parameters of each potential food source sample. The food source characteristic parameter construction module is used to perform step S2: based on the stable isotope measurements of each potential food source sample, construct the isotope mean vector and isotope covariance matrix of each potential food source sample, and construct the fractionation correction parameters corresponding to the potential food source sample based on the isotope fractionation coefficient. The food source distinguishability diagnosis and candidate food source screening module is used to perform step S3: based on the isotope mean vector, isotope covariance matrix and fractionation correction parameters of each potential food source sample, calculate the degree of isotope distinguishability between any two potential food source samples; merge or perform hierarchical constraint processing on potential food source samples with isotope distinguishability below a preset limit to obtain a set of candidate food sources after distinguishability screening. The hierarchical Bayesian mixture model construction and output module is used to execute step S4: using the isotope mean vector, isotope covariance matrix, fractionation correction parameter, elemental concentration parameter, and stable isotope measurement value of the target species sample as input for each candidate food source in the candidate food source set; generating a posterior sample sequence of the contribution ratio of each candidate food source to the target species through simplex constraint transformation and Markov chain Monte Carlo sampling; and determining the posterior distribution characteristics of the contribution ratio of each candidate food source and the model convergence diagnosis results based on the posterior sample sequence.
[0045] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.
Claims
1. A method for analyzing the contribution of biological food sources based on a Bayesian mixture model, characterized in that, include: S1: Obtain stable isotope values of the target species sample, stable isotope values of multiple potential food source samples, isotope fractionation coefficients of the target species sample relative to each potential food source sample, and elemental concentration parameters of each potential food source sample. S2: Based on the stable isotope measurements of each potential food source sample, construct the isotope mean vector and isotope covariance matrix for each potential food source sample, and construct the fractionation correction parameters corresponding to the potential food source sample based on the isotope fractionation coefficient. S3: Based on the isotope mean vector, isotope covariance matrix and fractionation correction parameters of each potential food source sample, calculate the degree of isotope distinguishability between any two potential food source samples; merge or stratify potential food source samples with isotope distinguishability below a preset limit to obtain a set of candidate food sources after distinguishability screening. S4: Using the isotope mean vector, isotope covariance matrix, fractionation correction parameter, elemental concentration parameter, and stable isotope measurements of the target species sample as inputs for each candidate food source in the candidate food source set, a hierarchical Bayesian mixture model is constructed; through simplex constraint transformation and Markov chain Monte Carlo sampling, a posterior sample sequence of the contribution ratio of each candidate food source to the target species is generated; based on the posterior sample sequence, the posterior distribution characteristics of the contribution ratio of each candidate food source and the model convergence diagnosis results are determined.
2. The method for analyzing the contribution of biological food sources based on a Bayesian mixture model according to claim 1, characterized in that, S1 includes: S11: The tissue sample of the target species is degreased, dried and homogenized to obtain the target species sample to be tested; S12: Various potential food source samples, including Ulva samples, phytoplankton samples, seagrass samples, benthic algae samples, and sediment samples, were pretreated to obtain various pretreated food source samples. Specifically, Ulva samples were treated with dilute hydrochloric acid solution soaking, deionized water rinsing, and freeze-drying; phytoplankton samples were treated with acidification fumigation and freeze-drying; seagrass and benthic algae samples were treated with dilute hydrochloric acid solution soaking, deionized water rinsing, and freeze-drying; and sediment samples were treated with acidification and freeze-drying. S13: Input the target species sample and various pretreated food source samples into the isotope ratio mass spectrometer for measurement to obtain the carbon stable isotope and nitrogen stable isotope values of the target species sample, as well as the carbon stable isotope and nitrogen stable isotope values of each potential food source sample. S14: Obtain the carbon isotope fractionation coefficient and nitrogen isotope fractionation coefficient of the target species relative to each potential food source sample, as well as the elemental concentration parameters of each potential food source sample.
3. The method for analyzing the contribution of biological food sources based on a Bayesian mixture model according to claim 1, characterized in that, S2 include: S21: Based on the carbon stable isotope measurement value and nitrogen stable isotope measurement value of each potential food source sample, calculate the two-dimensional isotope sample mean as the isotope mean vector of the potential food source sample; and calculate the two-dimensional isotope sample covariance matrix as the isotope covariance matrix of the potential food source sample. S22: Based on the carbon isotope fractionation coefficient and nitrogen isotope fractionation coefficient of the target species sample relative to the potential food source sample, construct the fractionation mean correction vector and set the fractionation uncertainty covariance matrix. The fractionation mean correction vector and the fractionation uncertainty covariance matrix together constitute the fractionation correction parameters corresponding to the potential food source sample.
4. The method for analyzing the contribution of biological food sources based on a Bayesian mixture model according to claim 1, characterized in that, S3 involves merging potential food source samples, specifically including: For any two potential food source samples, calculate the Mahalanobis distance between the isotopic mean vectors of the two potential food source samples. The covariance matrix determined by the sum of the isotopic covariance matrix of the two potential food source samples and the corresponding fractionation uncertainty covariance matrix is used as the basis for the distance metric, and the Mahalanobis distance is used as the degree of isotopic distinguishability. Potential food source samples with isotopic distinguishability below a preset limit are merged into a combined food source, and the isotopic mean vector and isotopic covariance matrix of the combined food source are calculated. The combined food sources generated after merging and the unmerged potential food source samples constitute a candidate food source set after distinguishability screening.
5. The method for analyzing the contribution of biological food sources based on a Bayesian mixture model according to claim 1, characterized in that, In S4, a hierarchical Bayesian mixture model is constructed, and posterior sample sequences are generated through simplex constraint transformation and Markov chain Monte Carlo sampling. Specifically, this includes: S41: Construct an observation model to ensure that the stable isotope measurements of the target species samples follow a multivariate normal distribution. For the mean of the distribution, first add the isotope mean vector of each candidate food source to the corresponding fractionation mean correction vector to obtain the corrected source value of the candidate food source. Then, weight the contribution ratios according to the elemental concentration parameters of the candidate food sources, and sum the corrected source values of all candidate food sources according to the weighted contribution ratios to obtain the mean. The covariance matrix of the distribution consists of the isotope covariance matrix of each candidate food source, the fractionation uncertainty covariance matrix corresponding to each candidate food source, and the measurement error covariance matrix. S42: Set a Dirichlet prior distribution for the contribution ratio vector and set prior distributions for the parameters in the fractionation uncertainty covariance matrix and the measurement error covariance matrix to form a hierarchical Bayesian mixture model. S43: The contribution ratio vector constrained by nonnegativity and sum to 1 is transformed into an unconstrained real-valued vector using simplex constraint transformation. Adaptive Markov chain Monte Carlo sampling is used to sample the hierarchical Bayesian mixture model to generate a posterior sample sequence of the contribution ratio of each candidate food source. S44: Based on the posterior sample sequence, calculate the posterior mean of the contribution ratio of each candidate food source, the Bayesian confidence interval, and the probability that the candidate food source is the dominant food source, as the posterior distribution characteristics and model convergence diagnosis results.
6. The method for analyzing the contribution of biological food sources based on a Bayesian mixture model according to claim 1, characterized in that, S3 performs stratified constraint processing on potential food source samples, specifically including: Potential food source samples with isotopic distinguishability below a preset threshold are grouped into the same food source group. In the hierarchical Bayesian mixture model, a joint prior distribution is set for the contribution ratio of each potential food source sample within the same food source group; Food source groups are retained in the candidate food source set, forming a candidate food source set that includes single food sources and food source groups.
7. The method for analyzing the contribution of biological food sources based on a Bayesian mixture model according to claim 1, characterized in that, The model convergence diagnostic results in S4 are generated as follows: Run multiple independent Markov chains to obtain the posterior sample sequences under each Markov chain; Based on the posterior sample sequences of each Markov chain, the inter-chain variance and intra-chain variance are calculated to obtain the potential scale reduction factor. When the potential scaling factor is less than the preset diagnostic limit, the model converges to a diagnostic result.
8. A biological food source contribution analysis system based on a Bayesian mixture model, characterized in that, The system employs a biological food source contribution analysis method based on a Bayesian mixture model as described in any one of claims 1 to 7, and the system comprises: The data acquisition module is used to perform step S1: acquire the stable isotope values of the target species sample, the stable isotope values of multiple potential food source samples, the isotope fractionation coefficient of the target species sample relative to each potential food source sample, and the elemental concentration parameters of each potential food source sample. The food source characteristic parameter construction module is used to perform step S2: based on the stable isotope measurements of each potential food source sample, construct the isotope mean vector and isotope covariance matrix of each potential food source sample, and construct the fractionation correction parameters corresponding to the potential food source sample based on the isotope fractionation coefficient. The food source distinguishability diagnosis and candidate food source screening module is used to perform step S3: based on the isotope mean vector, isotope covariance matrix and fractionation correction parameters of each potential food source sample, calculate the degree of isotope distinguishability between any two potential food source samples; merge or perform hierarchical constraint processing on potential food source samples with isotope distinguishability below a preset limit to obtain a set of candidate food sources after distinguishability screening. The hierarchical Bayesian mixture model construction and output module is used to execute step S4: using the isotope mean vector, isotope covariance matrix, fractionation correction parameter, elemental concentration parameter, and stable isotope measurement value of the target species sample as input for each candidate food source in the candidate food source set; generating a posterior sample sequence of the contribution ratio of each candidate food source to the target species through simplex constraint transformation and Markov chain Monte Carlo sampling; and determining the posterior distribution characteristics of the contribution ratio of each candidate food source and the model convergence diagnosis results based on the posterior sample sequence.