|
SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
|
Orchestrates execution of source apportionment analysis operations. More...
#include <conductor.h>

Public Member Functions | |
| Conductor (MainWindow *mainwindow) | |
| Constructs a Conductor associated with a MainWindow. | |
| bool | Execute (const std::string &command, std::map< std::string, std::string > arguments) |
| Executes a specified analysis command with given parameters. | |
| SourceSinkData * | Data () |
| Returns pointer to the current SourceSinkData. | |
| void | SetData (SourceSinkData *_data) |
| Sets the SourceSinkData for analysis. | |
| Results * | GetResults () |
| Creates and returns a heap-allocated copy of current results. | |
| void | SetWorkingFolder (const QString &wf) |
| Sets the working directory for output files. | |
| QString | WorkingFolder () const |
| Returns the current working directory path. | |
| bool | CheckNegativeElements (SourceSinkData *data=nullptr) |
| Validates that all element concentrations are non-negative. | |
| bool | CheckNegativeElements (std::map< std::string, std::vector< std::string > > negative_elements) |
| Validates element concentrations across multiple samples. | |
Private Member Functions | |
| bool | ExecuteGA (const std::map< std::string, std::string > &arguments) |
| Executes Genetic Algorithm optimization. | |
| bool | ExecuteGA_FixedProfile (const std::map< std::string, std::string > &arguments) |
| Executes Genetic Algorithm with fixed elemental profiles. | |
| bool | ExecuteGA_NoTargets (const std::map< std::string, std::string > &arguments) |
| Executes Genetic Algorithm disregarding target constraints. | |
| bool | ExecuteLevenbergMarquardt (const std::map< std::string, std::string > &arguments) |
| Executes Levenberg-Marquardt nonlinear optimization. | |
| bool | ExecuteLevenbergMarquardtBatch (const std::map< std::string, std::string > &arguments) |
| Executes Levenberg-Marquardt optimization across all target samples. | |
| bool | ExecuteOMSizeCorrect (const std::map< std::string, std::string > &arguments) |
| Executes organic matter and particle size correction. | |
| bool | ExecuteMLR (const std::map< std::string, std::string > &arguments) |
| Executes multiple linear regression versus organic matter and particle size. | |
| bool | ExecuteCovarianceMatrix (const std::map< std::string, std::string > &arguments) |
| Calculates covariance matrix for a source or target group. | |
| bool | ExecuteCorrelationMatrix (const std::map< std::string, std::string > &arguments) |
| Calculates correlation matrix for a source or target group. | |
| bool | ExecuteDFA (const std::map< std::string, std::string > &arguments) |
| Executes Discriminant Function Analysis between two groups. | |
| bool | ExecuteDFAOnevsRest (const std::map< std::string, std::string > &arguments) |
| Executes Discriminant Function Analysis for one group versus all others. | |
| bool | ExecuteDFAM (const std::map< std::string, std::string > &arguments) |
| Executes multi-way Discriminant Function Analysis across all groups. | |
| bool | ExecuteSDFA (const std::map< std::string, std::string > &arguments) |
| Executes Stepwise Discriminant Function Analysis between two groups. | |
| bool | ExecuteSDFAM (const std::map< std::string, std::string > &arguments) |
| Executes multi-way Stepwise Discriminant Function Analysis across all groups. | |
| bool | ExecuteSDFAOnevsRest (const std::map< std::string, std::string > &arguments) |
| Executes Stepwise Discriminant Function Analysis for one group versus all others. | |
| bool | ExecuteKolmogorovSmirnov (const std::map< std::string, std::string > &arguments) |
| Executes Kolmogorov-Smirnov goodness-of-fit test for a source/target group. | |
| bool | ExecuteKolmogorovSmirnovIndividual (const std::map< std::string, std::string > &arguments) |
| Executes Kolmogorov-Smirnov test for a single constituent in a group. | |
| bool | ExecuteCMBBayesian (const std::map< std::string, std::string > &arguments) |
| Executes Bayesian Chemical Mass Balance using MCMC sampling. | |
| bool | ExecuteCMBBayesianBatch (const std::map< std::string, std::string > &arguments) |
| Executes Bayesian Chemical Mass Balance across all target samples. | |
| bool | ExecuteTestCMBBayesian (const std::map< std::string, std::string > &arguments) |
| Executes MCMC test with a simple analytical model. | |
| bool | ExecuteDistributionFitting (const std::map< std::string, std::string > &arguments) |
| Executes distribution fitting analysis for a constituent. | |
| bool | ExecuteBracketingAnalysis (const std::map< std::string, std::string > &arguments) |
| Executes bracketing analysis for a single target sample. | |
| bool | ExecuteBracketingAnalysisBatch (const std::map< std::string, std::string > &arguments) |
| Executes bracketing analysis across all target samples. | |
| bool | ExecuteBoxCox (const std::map< std::string, std::string > &arguments) |
| Calculates optimal Box-Cox transformation parameters. | |
| bool | ExecuteOutlierAnalysis (const std::map< std::string, std::string > &arguments) |
| Executes outlier detection analysis for a source/target group. | |
| bool | ExecuteEDP (const std::map< std::string, std::string > &arguments) |
| Calculates two-way element discriminant power between two groups. | |
| bool | ExecuteEDPM (const std::map< std::string, std::string > &arguments) |
| Calculates multi-way element discriminant power across all groups. | |
| bool | ExecuteANOVA (const std::map< std::string, std::string > &arguments) |
| Executes Analysis of Variance (ANOVA) for element discrimination. | |
| bool | ExecuteErrorAnalysis (const std::map< std::string, std::string > &arguments) |
| Executes bootstrap error analysis for uncertainty quantification. | |
| bool | ExecuteSourceVerify (const std::map< std::string, std::string > &arguments) |
| Executes source verification analysis. | |
| bool | ExecuteAutoSelect (const std::map< std::string, std::string > &arguments) |
| Executes automatic element selection based on discriminant power. | |
Private Attributes | |
| SourceSinkData * | data |
| Non-owning pointer to analysis data. | |
| std::unique_ptr< CGA< SourceSinkData > > | GA |
| Genetic Algorithm optimizer (owned) | |
| std::unique_ptr< CMCMC< SourceSinkData > > | MCMC |
| MCMC sampler (owned) | |
| Results | results |
| Current analysis results (cleared each Execute) | |
| QString | workingfolder |
| Output directory path. | |
| MainWindow * | mainwindow |
| Non-owning pointer to parent window. | |
Orchestrates execution of source apportionment analysis operations.
The Conductor class serves as a command dispatcher and coordinator for various source apportionment algorithms including Genetic Algorithms (GA), Markov Chain Monte Carlo (MCMC), Levenberg-Marquardt optimization, and statistical analyses. It manages the lifecycle of optimization algorithms, maintains analysis results, and provides an interface between the GUI (MainWindow) and the computational backend (SourceSinkData).
Key responsibilities:
Definition at line 38 of file conductor.h.
|
explicit |
Constructs a Conductor associated with a MainWindow.
| mainwindow | Pointer to the parent MainWindow (non-owning, must outlive Conductor) |
Definition at line 12 of file conductor.cpp.
| bool Conductor::CheckNegativeElements | ( | SourceSinkData * | data = nullptr | ) |
Validates that all element concentrations are non-negative.
Checks the specified SourceSinkData for negative element concentrations, which are physically invalid for most source apportionment analyses (except isotope delta values). Displays a warning dialog if negative values are found.
| data | Pointer to SourceSinkData to check (uses this->data if nullptr) |
Definition at line 175 of file conductor.cpp.
References Data(), mainwindow, and SourceSinkData::NegativeValueCheck().
Referenced by Execute(), ExecuteANOVA(), ExecuteAutoSelect(), ExecuteBracketingAnalysis(), ExecuteBracketingAnalysisBatch(), ExecuteDFAM(), ExecuteDistributionFitting(), ExecuteEDP(), ExecuteEDPM(), ExecuteErrorAnalysis(), ExecuteGA(), ExecuteGA_FixedProfile(), ExecuteLevenbergMarquardt(), ExecuteLevenbergMarquardtBatch(), ExecuteOutlierAnalysis(), ExecuteSDFA(), ExecuteSDFAM(), ExecuteSDFAOnevsRest(), and ExecuteSourceVerify().
| bool Conductor::CheckNegativeElements | ( | std::map< std::string, std::vector< std::string > > | negative_elements | ) |
Validates element concentrations across multiple samples.
Checks for negative concentrations in a collection of samples, where each map entry represents a sample and its list of problematic elements.
| negative_elements | Map from sample names to lists of elements with negative values |
Definition at line 195 of file conductor.cpp.
References mainwindow.
|
inline |
Returns pointer to the current SourceSinkData.
Definition at line 75 of file conductor.h.
References data.
Referenced by CheckNegativeElements(), Execute(), ExecuteANOVA(), ExecuteAutoSelect(), ExecuteBoxCox(), ExecuteBracketingAnalysis(), ExecuteBracketingAnalysisBatch(), ExecuteCMBBayesian(), ExecuteCMBBayesianBatch(), ExecuteCorrelationMatrix(), ExecuteCovarianceMatrix(), ExecuteDFA(), ExecuteDFAM(), ExecuteDFAOnevsRest(), ExecuteDistributionFitting(), ExecuteEDP(), ExecuteEDPM(), ExecuteErrorAnalysis(), ExecuteGA(), ExecuteGA_FixedProfile(), ExecuteGA_NoTargets(), ExecuteKolmogorovSmirnov(), ExecuteKolmogorovSmirnovIndividual(), ExecuteLevenbergMarquardt(), ExecuteLevenbergMarquardtBatch(), ExecuteMLR(), ExecuteOMSizeCorrect(), ExecuteOutlierAnalysis(), ExecuteSDFA(), ExecuteSDFAM(), ExecuteSDFAOnevsRest(), and ExecuteSourceVerify().
| bool Conductor::Execute | ( | const std::string & | command, |
| std::map< std::string, std::string > | arguments | ||
| ) |
Executes a specified analysis command with given parameters.
Supported commands include:
| command | Command name identifying the analysis type |
| arguments | Map of parameter names to values configuring the analysis |
Definition at line 18 of file conductor.cpp.
References SourceSinkData::AddtoToolsUsed(), CheckNegativeElements(), Data(), ExecuteANOVA(), ExecuteAutoSelect(), ExecuteBoxCox(), ExecuteBracketingAnalysis(), ExecuteBracketingAnalysisBatch(), ExecuteCMBBayesian(), ExecuteCMBBayesianBatch(), ExecuteCorrelationMatrix(), ExecuteCovarianceMatrix(), ExecuteDFA(), ExecuteDFAM(), ExecuteDFAOnevsRest(), ExecuteDistributionFitting(), ExecuteEDP(), ExecuteEDPM(), ExecuteErrorAnalysis(), ExecuteGA(), ExecuteGA_FixedProfile(), ExecuteGA_NoTargets(), ExecuteKolmogorovSmirnov(), ExecuteKolmogorovSmirnovIndividual(), ExecuteLevenbergMarquardt(), ExecuteLevenbergMarquardtBatch(), ExecuteMLR(), ExecuteOMSizeCorrect(), ExecuteOutlierAnalysis(), ExecuteSDFA(), ExecuteSDFAM(), ExecuteSDFAOnevsRest(), ExecuteSourceVerify(), ExecuteTestCMBBayesian(), and results.
|
private |
Executes Analysis of Variance (ANOVA) for element discrimination.
Performs one-way ANOVA to test whether elemental concentrations differ significantly across source groups. Returns p-values for each element indicating the statistical significance of between-group differences. Elements with low p-values (below threshold) show significant variation across sources and are good candidates for source apportionment. Optionally modifies included elements based on results. Supports log transformation and Box-Cox transformation.
| arguments | Map of configuration parameters including:
|
Definition at line 1969 of file conductor.cpp.
References SourceSinkData::ANOVA(), Results::Append(), SourceSinkData::BoxCoxTransformed(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), CMBVector::ExtractWithinRange(), high, SourceSinkData::IncludeExcludeElementsBasedOn(), CMBVector::Labels(), low, mainwindow, normal, SourceSinkData::OMandSizeConstituents(), results, Interface::SetLimit(), ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::setXAxisTitle(), ResultItem::SetYAxisMode(), ResultItem::setYAxisTitle(), and vector.
Referenced by Execute().
|
private |
Executes automatic element selection based on discriminant power.
Automatically selects the optimal subset of elements for source apportionment by analyzing multi-way discriminant p-values for all source group pairs. Elements are ranked by their ability to discriminate between sources, and the top N elements from each pairwise comparison are aggregated to form the final selection. Optionally modifies the included elements in the dataset. Supports isotope inclusion, Box-Cox transformation, and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 2151 of file conductor.cpp.
References Results::Append(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), SourceSinkData::DifferentiationPower_P_value(), elemental_profile_set, SourceSinkData::ExtractChemicalElements(), Elemental_Profile::GetElementNames(), high, SourceSinkData::IncludeExcludeElementsBasedOn(), mainwindow, normal, predicted_concentration, results, Elemental_Profile_Set::SelectTopElementsAggregate(), ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), ResultItem::setYAxisTitle(), and ResultItem::SetYLimit().
Referenced by Execute().
|
private |
Calculates optimal Box-Cox transformation parameters.
Computes the optimal Box-Cox lambda parameters for variance-stabilizing power transformations of elemental concentrations within a source or target group. Box-Cox transformation can normalize skewed distributions and stabilize variance, improving the performance of subsequent statistical analyses.
| arguments | Map of configuration parameters including:
|
Definition at line 1704 of file conductor.cpp.
References Results::Append(), Data(), normal, results, ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), and vector.
Referenced by Execute().
|
private |
Executes bracketing analysis for a single target sample.
Performs bracketing test to determine if target sample concentrations fall within the range defined by source group concentrations. For each element, the test checks whether the target value is bracketed (bounded) by the minimum and maximum source values. Results are boolean indicators showing which elements pass the bracketing criterion. Supports optional OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 1627 of file conductor.cpp.
References Results::Append(), SourceSinkData::BracketTest(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), Data(), results, CMBVector::SetBooleanValue(), ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), and vector.
Referenced by Execute().
|
private |
Executes bracketing analysis across all target samples.
Performs batch bracketing test to determine if target sample concentrations fall within the range defined by source group concentrations for all samples. Returns a matrix showing boolean bracketing results for each element in each target sample. This batch analysis enables quick assessment of which samples and elements satisfy the bracketing criterion. Supports optional OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 1662 of file conductor.cpp.
References Results::Append(), CheckNegativeElements(), Data(), data, mainwindow, matrix, SourceSinkData::OMandSizeConstituents(), results, CMBMatrix::SetBooleanValue(), ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), and ResultItem::SetType().
Referenced by Execute().
|
private |
Executes Bayesian Chemical Mass Balance using MCMC sampling.
Performs Bayesian inference for source apportionment using Markov Chain Monte Carlo (MCMC) sampling. This probabilistic approach estimates posterior distributions of source contributions accounting for uncertainties in both source profiles and receptor measurements. Generates comprehensive results including contribution distributions, parameter traces, and convergence diagnostics. Supports optional organic matter/size corrections and softmax transformations.
| arguments | Map of configuration parameters including:
|
Definition at line 2225 of file conductor.cpp.
References Data(), Results::Error(), mainwindow, MCMC, SourceSinkData::MCMC(), results, and workingfolder.
Referenced by Execute().
|
private |
Executes Bayesian Chemical Mass Balance across all target samples.
Performs batch MCMC-based Bayesian source apportionment for all target samples, producing a comprehensive contribution matrix showing probabilistic source contributions with uncertainty ranges across multiple samples. This is the batch version of CMB Bayesian, enabling efficient spatial or temporal analysis of source contributions. Supports optional organic matter/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 1373 of file conductor.cpp.
References Results::Append(), Data(), mainwindow, matrix, MCMC, normal, results, ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), and workingfolder.
Referenced by Execute().
|
private |
Calculates correlation matrix for a source or target group.
Computes the correlation matrix showing normalized relationships between elemental concentrations within a specified source or target group. Supports optional organic matter/size corrections and Box-Cox transformations. Values outside the specified threshold are highlighted.
| arguments | Map of configuration parameters including:
|
Definition at line 652 of file conductor.cpp.
References Results::Append(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), high, low, mainwindow, matrix, results, Interface::SetLimit(), ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::setTableTitle(), and ResultItem::SetType().
Referenced by Execute().
|
private |
Calculates covariance matrix for a source or target group.
Computes the covariance matrix showing relationships between elemental concentrations within a specified source or target group. Useful for understanding correlations and dependencies between elements in the data.
| arguments | Map of configuration parameters including:
|
Definition at line 631 of file conductor.cpp.
References Results::Append(), Data(), matrix, results, ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), and ResultItem::SetType().
Referenced by Execute().
|
private |
Executes Discriminant Function Analysis between two groups.
Performs two-group discriminant function analysis to find the linear combination of elements that best separates two source or target groups. Computes eigenvalues, eigenvectors, projected profiles, and statistical significance (chi-squared and F-test p-values). Supports optional Box-Cox transformation and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 701 of file conductor.cpp.
References Results::Append(), SourceSinkData::BoxCoxTransformed(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), SourceSinkData::DiscriminantFunctionAnalysis(), DFA_result::eigen_vectors, DFA_result::F_test_P_value, mainwindow, normal, DFA_result::p_values, DFA_result::projected, results, ResultItem::SetName(), Results::SetName(), ProgressWindow::SetProgress(), SourceSinkData::SetProgressWindow(), ResultItem::SetResult(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), vector, and vectorset_groups.
Referenced by Execute().
|
private |
Executes multi-way Discriminant Function Analysis across all groups.
Performs multi-way discriminant function analysis to find linear combinations of elements that optimally separate all source groups simultaneously. Computes multiple discriminant functions (eigenvalues/eigenvectors) and projects all groups onto these discriminant axes. Supports optional Box-Cox transformation and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 901 of file conductor.cpp.
References Results::Append(), SourceSinkData::BoxCoxTransformed(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), dfa_vectorsetset, SourceSinkData::DiscriminantFunctionAnalysis(), DFA_result::eigen_vectors, DFA_result::F_test_P_value, mainwindow, DFA_result::multi_projected, normal, DFA_result::p_values, results, ResultItem::SetName(), Results::SetName(), ProgressWindow::SetProgress(), SourceSinkData::SetProgressWindow(), ResultItem::SetResult(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), vector, and vectorset.
Referenced by Execute().
|
private |
Executes Discriminant Function Analysis for one group versus all others.
Performs discriminant function analysis to separate one specified source group from all other groups combined. Useful for identifying which elements best distinguish a particular source from the background of all other sources. Supports optional Box-Cox transformation and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 805 of file conductor.cpp.
References Results::Append(), SourceSinkData::BoxCoxTransformed(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), SourceSinkData::DiscriminantFunctionAnalysis(), DFA_result::eigen_vectors, DFA_result::F_test_P_value, mainwindow, normal, DFA_result::p_values, DFA_result::projected, results, ResultItem::SetName(), Results::SetName(), ProgressWindow::SetProgress(), SourceSinkData::SetProgressWindow(), ResultItem::SetResult(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), vector, and vectorset_groups.
Referenced by Execute().
|
private |
Executes distribution fitting analysis for a constituent.
Fits normal and lognormal distributions to observed elemental concentrations for a specific constituent within a source or target group. Generates both probability density functions (PDF) and cumulative distribution functions (CDF) comparing observed data with fitted theoretical distributions. Useful for assessing distributional assumptions before source apportionment. Supports optional Box-Cox transformation and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 1506 of file conductor.cpp.
References Results::Append(), SourceSinkData::BoxCoxTransformed(), CheckNegativeElements(), ConcentrationSet::CreateCDFComparison(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), ConcentrationSet::CreateFittedDistribution(), Data(), SourceSinkData::GetElementDistribution(), lognormal, mainwindow, normal, SourceSinkData::OMandSizeConstituents(), results, ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ResultItem::SetType(), ResultItem::setXAxisTitle(), ResultItem::SetYAxisMode(), ResultItem::setYAxisTitle(), and timeseries_set_first_symbol.
Referenced by Execute().
|
private |
Calculates two-way element discriminant power between two groups.
Evaluates the ability of each element to discriminate between two specific source or target groups using multiple metrics: difference-to-standard-deviation ratio, discrimination fraction (percentage of samples correctly separated), and statistical significance (t-test p-values). Elements with low p-values and high discrimination power are good candidates for source apportionment. Supports Box-Cox transformation and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 1763 of file conductor.cpp.
References Results::Append(), SourceSinkData::BoxCoxTransformed(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), SourceSinkData::DifferentiationPower(), SourceSinkData::DifferentiationPower_Percentage(), high, low, mainwindow, normal, SourceSinkData::OMandSizeConstituents(), predicted_concentration, results, Interface::SetLimit(), ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::setXAxisTitle(), ResultItem::SetYAxisMode(), ResultItem::setYAxisTitle(), ResultItem::SetYLimit(), and SourceSinkData::t_TestPValue().
Referenced by Execute().
|
private |
Calculates multi-way element discriminant power across all groups.
Evaluates the ability of each element to discriminate among all source groups simultaneously using pairwise comparisons. Computes three metrics for each element-pair combination: difference-to-standard-deviation ratio, discrimination fraction, and t-test p-values. Results show which elements provide optimal discrimination across the entire source dataset. Optionally includes target samples. Supports Box-Cox transformation and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 1874 of file conductor.cpp.
References Results::Append(), SourceSinkData::BoxCoxTransformed(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), SourceSinkData::DifferentiationPower(), SourceSinkData::DifferentiationPower_P_value(), SourceSinkData::DifferentiationPower_Percentage(), elemental_profile_set, high, low, mainwindow, normal, SourceSinkData::OMandSizeConstituents(), results, Interface::SetLimit(), ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), ResultItem::setYAxisTitle(), and ResultItem::SetYLimit().
Referenced by Execute().
|
private |
Executes bootstrap error analysis for uncertainty quantification.
Performs bootstrap resampling to quantify uncertainty in source contribution estimates. Randomly removes a specified percentage of elements in each bootstrap iteration and re-solves the source apportionment problem, generating distributions of contribution estimates. Produces confidence intervals and uncertainty metrics for source contributions. Supports both linear and softmax transformations and optional OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 2037 of file conductor.cpp.
References SourceSinkData::BootStrap(), CheckNegativeElements(), SourceSinkData::CreateCorrectedDataset(), Data(), SourceSinkData::InitializeParametersAndObservations(), mainwindow, results, Results::SetName(), SourceSinkData::SetProgressWindow(), and softmax.
Referenced by Execute().
|
private |
Executes Genetic Algorithm optimization.
Performs standard GA optimization with configurable source profiles, organic matter and size corrections, and comprehensive result collection including contributions, observed vs modeled profiles, and statistical parameters (means, mu, sigma) for both calculated and estimated values.
| arguments | Map of configuration parameters including:
|
Definition at line 217 of file conductor.cpp.
References Results::Append(), CheckNegativeElements(), contribution, SourceSinkData::CreateCorrectedDataset(), Data(), GA, SourceSinkData::InitializeParametersAndObservations(), mainwindow, results, Results::SetName(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), and workingfolder.
Referenced by Execute().
|
private |
Executes Genetic Algorithm with fixed elemental profiles.
Performs GA optimization where source elemental profiles are held constant and only source contributions are estimated. This mode is useful when source compositions are well-characterized and only mixing proportions need determination.
| arguments | Map of configuration parameters including:
|
Definition at line 307 of file conductor.cpp.
References Results::Append(), CheckNegativeElements(), SourceSinkData::CreateCorrectedDataset(), Data(), direct, GA, SourceSinkData::InitializeParametersAndObservations(), mainwindow, only_contributions, results, Results::SetName(), SourceSinkData::SetParameterEstimationMode(), ProgressWindow::SetTitle(), ProgressWindow::SetYAxisTitle(), and workingfolder.
Referenced by Execute().
|
private |
Executes Genetic Algorithm disregarding target constraints.
Performs GA optimization to estimate source elemental profiles based solely on source data, without constraining the solution to match target sample compositions. This mode is useful for characterizing source profiles when target data is unavailable or unreliable.
| arguments | Map of configuration parameters including:
|
Definition at line 365 of file conductor.cpp.
References Results::Append(), Data(), GA, SourceSinkData::InitializeParametersAndObservations(), mainwindow, results, Results::SetName(), SourceSinkData::SetParameterEstimationMode(), source_elemental_profiles_based_on_source_data, and workingfolder.
Referenced by Execute().
|
private |
Executes Kolmogorov-Smirnov goodness-of-fit test for a source/target group.
Performs Kolmogorov-Smirnov test to assess how well elemental concentration distributions within a source or target group conform to a specified theoretical distribution (normal or lognormal). Returns K-S statistics for each element, where larger values indicate poorer fit to the assumed distribution.
| arguments | Map of configuration parameters including:
|
Definition at line 1308 of file conductor.cpp.
References Results::Append(), Data(), lognormal, normal, results, ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), and vector.
Referenced by Execute().
|
private |
Executes Kolmogorov-Smirnov test for a single constituent in a group.
Performs detailed Kolmogorov-Smirnov goodness-of-fit test for one specific element within a source or target group. Returns the cumulative distribution function (CDF) comparison between observed data and the theoretical distribution (normal or lognormal), allowing visual assessment of distribution fit.
| arguments | Map of configuration parameters including:
|
Definition at line 1338 of file conductor.cpp.
References Results::Append(), ConcentrationSet::CreateCDFComparison(), Data(), SourceSinkData::GetElementDistribution(), lognormal, normal, results, ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowTable(), ResultItem::SetType(), and timeseries_set.
Referenced by Execute().
|
private |
Executes Levenberg-Marquardt nonlinear optimization.
Performs Levenberg-Marquardt least squares optimization to estimate source contributions. This deterministic algorithm is faster than GA/MCMC and works well when the problem is well-conditioned. Supports both linear and softmax transformations for contribution constraints.
| arguments | Map of configuration parameters including:
|
Definition at line 400 of file conductor.cpp.
References Results::Append(), CheckNegativeElements(), SourceSinkData::CreateCorrectedDataset(), Data(), direct, SourceSinkData::GetContribution(), SourceSinkData::GetObservedvsModeledElementalProfile(), SourceSinkData::GetObservedvsModeledElementalProfile_Isotope(), SourceSinkData::GetPredictedElementalProfile(), SourceSinkData::InitializeParametersAndObservations(), linear, mainwindow, results, Results::SetName(), SourceSinkData::SetProgressWindow(), ResultItem::SetShowTable(), softmax, and SourceSinkData::SolveLevenberg_Marquardt().
Referenced by Execute().
|
private |
Executes Levenberg-Marquardt optimization across all target samples.
Performs batch Levenberg-Marquardt optimization for all target samples, producing a comprehensive contribution matrix showing source apportionment results across multiple samples. Useful for analyzing spatial or temporal patterns in source contributions.
| arguments | Map of configuration parameters including:
|
Definition at line 463 of file conductor.cpp.
References Results::Append(), CheckNegativeElements(), counter, Data(), Interface::GetOptions(), high, linear, low, mainwindow, results, ResultItem::SetName(), Results::SetName(), Interface::SetOption(), SourceSinkData::SetProgressWindow(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetXAxisMode(), ResultItem::setXAxisTitle(), ResultItem::setYAxisTitle(), ResultItem::SetYLimit(), single_column_x, softmax, stacked_bar_chart, options::X_suffix, and options::Y_suffix.
Referenced by Execute().
|
private |
Executes multiple linear regression versus organic matter and particle size.
Performs multiple linear regression analysis to establish relationships between elemental concentrations and organic matter content/particle size. The resulting regression models are stored and can be used to correct concentrations in subsequent analyses. Supports both linear and power-law regression forms.
| arguments | Map of configuration parameters including:
|
Definition at line 561 of file conductor.cpp.
References Results::Append(), SourceSinkData::CreateCorrectedAndFilteredDataset(), Data(), SourceSinkData::GetMLRResults(), SourceSinkData::GetTargetGroup(), linear, mainwindow, SourceSinkData::PerformRegressionVsOMAndSize(), power, results, Results::SetName(), and SourceSinkData::SetOMandSizeConstituents().
Referenced by Execute().
|
private |
Executes organic matter and particle size correction.
Applies multiple linear regression corrections to adjust elemental concentrations for variations in organic matter content and particle size. Returns corrected source profiles for the specified target sample, which can then be used in subsequent source apportionment analyses.
| arguments | Map of configuration parameters including:
|
Definition at line 535 of file conductor.cpp.
References Results::Append(), SourceSinkData::CreateCorrectedAndFilteredDataset(), Data(), SourceSinkData::GetSourceProfiles(), results, Results::SetName(), and SourceSinkData::SetSelectedTargetSample().
Referenced by Execute().
|
private |
Executes outlier detection analysis for a source/target group.
Performs Box-Cox based outlier detection to identify samples with unusual elemental concentrations within a source or target group. After Box-Cox transformation to normality, calculates standardized residuals and flags values exceeding the specified threshold (typically ±2 or ±3 standard deviations). Supports sample and element filtering.
| arguments | Map of configuration parameters including:
|
Definition at line 1725 of file conductor.cpp.
References Results::Append(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), Data(), high, low, matrix, results, Interface::SetLimit(), ResultItem::SetName(), Results::SetName(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), and ResultItem::SetType().
Referenced by Execute().
|
private |
Executes Stepwise Discriminant Function Analysis between two groups.
Performs stepwise discriminant function analysis to identify the subset of elements that provides optimal discrimination between two source groups. Elements are added sequentially based on their contribution to group separation, evaluated using Wilks' Lambda, chi-squared, and F-test statistics. Supports optional Box-Cox transformation and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 998 of file conductor.cpp.
References Results::Append(), SourceSinkData::BoxCoxTransformed(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), high, log, mainwindow, SourceSinkData::OMandSizeConstituents(), results, ResultItem::SetAbsoluteValue(), ResultItem::SetName(), Results::SetName(), SourceSinkData::SetProgressWindow(), ResultItem::SetResult(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), ResultItem::SetYLimit(), SourceSinkData::StepwiseDiscriminantFunctionAnalysis(), and vector.
Referenced by Execute().
|
private |
Executes multi-way Stepwise Discriminant Function Analysis across all groups.
Performs stepwise discriminant function analysis to identify the optimal subset of elements for discriminating among all source groups simultaneously. Elements are sequentially selected based on their contribution to overall group separation using Wilks' Lambda, chi-squared, and F-test statistics. Optionally modifies the included elements based on results. Supports Box-Cox transformation and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 1099 of file conductor.cpp.
References Results::Append(), CMBVector::append(), SourceSinkData::BoxCoxTransformed(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), CMBVector::ExtractUpToMinimum(), high, SourceSinkData::IncludeExcludeElementsBasedOn(), CMBVector::Labels(), log, mainwindow, SourceSinkData::OMandSizeConstituents(), results, ResultItem::SetAbsoluteValue(), ResultItem::SetName(), Results::SetName(), SourceSinkData::SetProgressWindow(), ResultItem::SetResult(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), ResultItem::SetYLimit(), SourceSinkData::StepwiseDiscriminantFunctionAnalysis(), CMBVector::valueAt(), and vector.
Referenced by Execute().
|
private |
Executes Stepwise Discriminant Function Analysis for one group versus all others.
Performs stepwise discriminant function analysis to identify the optimal subset of elements for discriminating one specified source group from all other groups combined. Elements are sequentially selected based on Wilks' Lambda, chi-squared, and F-test statistics. Supports optional Box-Cox transformation and OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 1215 of file conductor.cpp.
References Results::Append(), SourceSinkData::BoxCoxTransformed(), CheckNegativeElements(), SourceSinkData::CreateCorrectedAndFilteredDataset(), SourceSinkData::CreateCorrectedDataset(), Data(), high, log, mainwindow, SourceSinkData::OMandSizeConstituents(), results, ResultItem::SetAbsoluteValue(), ResultItem::SetName(), Results::SetName(), SourceSinkData::SetProgressWindow(), ResultItem::SetResult(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetYAxisMode(), ResultItem::SetYLimit(), SourceSinkData::StepwiseDiscriminantFunctionAnalysis(), and vector.
Referenced by Execute().
|
private |
Executes source verification analysis.
Performs leave-one-out cross-validation where each sample from a specified source group is treated as an unknown target and contributions are estimated using the remaining sources. If source apportionment is working correctly, the "unknown" sample should show high contribution from its true source group. Results show contribution matrices for all verification samples, enabling assessment of source profile representativeness and model reliability. Supports softmax transformation and optional OM/size corrections.
| arguments | Map of configuration parameters including:
|
Definition at line 2086 of file conductor.cpp.
References Results::Append(), CheckNegativeElements(), counter, Data(), Interface::GetOptions(), high, low, mainwindow, results, ResultItem::SetName(), Results::SetName(), Interface::SetOption(), ProgressWindow::SetProgress(), SourceSinkData::SetProgressWindow(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ResultItem::SetShowGraph(), ResultItem::SetShowTable(), ResultItem::SetType(), ResultItem::SetXAxisMode(), ResultItem::setXAxisTitle(), ResultItem::setYAxisTitle(), ResultItem::SetYLimit(), single_column_x, softmax, stacked_bar_chart, SourceSinkData::VerifySource(), options::X_suffix, and options::Y_suffix.
Referenced by Execute().
|
private |
Executes MCMC test with a simple analytical model.
Performs MCMC sampling on a simple test model (TestMCMC) with known analytical properties to validate the MCMC implementation. Useful for debugging convergence issues, tuning sampler parameters, and verifying posterior distributions against expected theoretical results. Generates both parameter trace samples and posterior distributions.
| arguments | Map of configuration parameters including:
|
Definition at line 1423 of file conductor.cpp.
References Results::Append(), distribution, CMCMC< T >::initialize(), TestMCMC::InitializeParametersObservations(), mainwindow, mcmc_samples, CMCMC< T >::Model, results, samples, ResultItem::SetName(), Results::SetName(), CMCMC< T >::SetProperty(), ResultItem::SetResult(), ResultItem::SetShowAsString(), ProgressWindow::SetTitle(), ResultItem::SetType(), ProgressWindow::SetYAxisTitle(), CMCMC< T >::step(), and workingfolder.
Referenced by Execute().
|
inline |
Creates and returns a heap-allocated copy of current results.
Returns a new Results object allocated on the heap containing a copy of the most recent analysis results. The caller assumes ownership and is responsible for deletion.
Definition at line 96 of file conductor.h.
References results.
|
inline |
Sets the SourceSinkData for analysis.
| _data | Pointer to SourceSinkData (non-owning, must remain valid during operations) |
Definition at line 81 of file conductor.h.
References data.
|
inline |
Sets the working directory for output files.
| wf | Working folder path as QString |
Definition at line 102 of file conductor.h.
References workingfolder.
|
inline |
Returns the current working directory path.
Definition at line 108 of file conductor.h.
References workingfolder.
|
private |
Non-owning pointer to analysis data.
Definition at line 139 of file conductor.h.
Referenced by Data(), ExecuteBracketingAnalysisBatch(), and SetData().
|
private |
Genetic Algorithm optimizer (owned)
Definition at line 140 of file conductor.h.
Referenced by ExecuteGA(), ExecuteGA_FixedProfile(), and ExecuteGA_NoTargets().
|
private |
Non-owning pointer to parent window.
Definition at line 144 of file conductor.h.
Referenced by CheckNegativeElements(), CheckNegativeElements(), ExecuteANOVA(), ExecuteAutoSelect(), ExecuteBracketingAnalysisBatch(), ExecuteCMBBayesian(), ExecuteCMBBayesianBatch(), ExecuteCorrelationMatrix(), ExecuteDFA(), ExecuteDFAM(), ExecuteDFAOnevsRest(), ExecuteDistributionFitting(), ExecuteEDP(), ExecuteEDPM(), ExecuteErrorAnalysis(), ExecuteGA(), ExecuteGA_FixedProfile(), ExecuteGA_NoTargets(), ExecuteLevenbergMarquardt(), ExecuteLevenbergMarquardtBatch(), ExecuteMLR(), ExecuteSDFA(), ExecuteSDFAM(), ExecuteSDFAOnevsRest(), ExecuteSourceVerify(), and ExecuteTestCMBBayesian().
|
private |
MCMC sampler (owned)
Definition at line 141 of file conductor.h.
Referenced by ExecuteCMBBayesian(), and ExecuteCMBBayesianBatch().
|
private |
Current analysis results (cleared each Execute)
Definition at line 142 of file conductor.h.
Referenced by Execute(), ExecuteANOVA(), ExecuteAutoSelect(), ExecuteBoxCox(), ExecuteBracketingAnalysis(), ExecuteBracketingAnalysisBatch(), ExecuteCMBBayesian(), ExecuteCMBBayesianBatch(), ExecuteCorrelationMatrix(), ExecuteCovarianceMatrix(), ExecuteDFA(), ExecuteDFAM(), ExecuteDFAOnevsRest(), ExecuteDistributionFitting(), ExecuteEDP(), ExecuteEDPM(), ExecuteErrorAnalysis(), ExecuteGA(), ExecuteGA_FixedProfile(), ExecuteGA_NoTargets(), ExecuteKolmogorovSmirnov(), ExecuteKolmogorovSmirnovIndividual(), ExecuteLevenbergMarquardt(), ExecuteLevenbergMarquardtBatch(), ExecuteMLR(), ExecuteOMSizeCorrect(), ExecuteOutlierAnalysis(), ExecuteSDFA(), ExecuteSDFAM(), ExecuteSDFAOnevsRest(), ExecuteSourceVerify(), ExecuteTestCMBBayesian(), and GetResults().
|
private |
Output directory path.
Definition at line 143 of file conductor.h.
Referenced by ExecuteCMBBayesian(), ExecuteCMBBayesianBatch(), ExecuteGA(), ExecuteGA_FixedProfile(), ExecuteGA_NoTargets(), ExecuteTestCMBBayesian(), SetWorkingFolder(), and WorkingFolder().