SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
Conductor Class Reference

Orchestrates execution of source apportionment analysis operations. More...

#include <conductor.h>

Collaboration diagram for Conductor:
Collaboration graph

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.
 
SourceSinkDataData ()
 Returns pointer to the current SourceSinkData.
 
void SetData (SourceSinkData *_data)
 Sets the SourceSinkData for analysis.
 
ResultsGetResults ()
 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

SourceSinkDatadata
 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.
 
MainWindowmainwindow
 Non-owning pointer to parent window.
 

Detailed Description

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:

  • Execute analysis commands with configurable parameters
  • Manage algorithm instances (GA, MCMC)
  • Validate input data for negative concentrations
  • Collect and package analysis results
  • Coordinate with progress reporting UI
Note
The Conductor does not own the SourceSinkData - it operates on externally managed data passed via SetData()

Definition at line 38 of file conductor.h.

Constructor & Destructor Documentation

◆ Conductor()

Conductor::Conductor ( MainWindow mainwindow)
explicit

Constructs a Conductor associated with a MainWindow.

Parameters
mainwindowPointer to the parent MainWindow (non-owning, must outlive Conductor)

Definition at line 12 of file conductor.cpp.

Member Function Documentation

◆ CheckNegativeElements() [1/2]

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.

Parameters
dataPointer to SourceSinkData to check (uses this->data if nullptr)
Returns
true if all concentrations are valid (non-negative), false otherwise
Note
Presents warning dialog to user via MainWindow if validation fails

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().

◆ CheckNegativeElements() [2/2]

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.

Parameters
negative_elementsMap from sample names to lists of elements with negative values
Returns
true if no negative values found, false if any exist
Note
Presents consolidated warning dialog showing all problematic samples

Definition at line 195 of file conductor.cpp.

References mainwindow.

◆ Data()

◆ Execute()

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:

  • "GA": Genetic Algorithm optimization
  • "GA (fixed elemental contribution)": GA with fixed source profiles
  • "GA (disregarding targets)": GA without target constraints
  • "Levenberg-Marquardt": Nonlinear least squares optimization
  • "MCMC": Markov Chain Monte Carlo sampling
  • "Bootstrap": Bootstrap uncertainty analysis
  • "ANOVA": Analysis of variance for source discrimination
  • "Error_Analysis": Error propagation analysis
  • "Source_Verify": Source verification analysis
  • "AutoSelect": Automated element selection
Parameters
commandCommand name identifying the analysis type
argumentsMap of parameter names to values configuring the analysis
Returns
true if execution completed successfully, false if validation failed or errors occurred
Note
Clears previous results at the start of each execution
Validates data for negative element concentrations before proceeding

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.

◆ ExecuteANOVA()

bool Conductor::ExecuteANOVA ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Log Transformation": "true"/"false"
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
  • "P-value threshold": Significance threshold
  • "Modify the included elements based on the results": "true"/"false"
Returns
true if execution completed successfully, false if OM/Size correction unavailable or negative elements found

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().

◆ ExecuteAutoSelect()

bool Conductor::ExecuteAutoSelect ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Include Isotopes": "true"/"false"
  • "Number of elements from each pair": Top N elements per pair
  • "Modify the included elements based on the results": "true"/"false"
Returns
true if execution completed successfully, false if OM/Size correction unavailable or negative elements found

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().

◆ ExecuteBoxCox()

bool Conductor::ExecuteBoxCox ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group": Name of the group to analyze
Returns
true if execution completed successfully

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().

◆ ExecuteBracketingAnalysis()

bool Conductor::ExecuteBracketingAnalysis ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Sample": Target sample name to test
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "Correct based on size and organic matter": "true"/"false"
Returns
true if execution completed successfully, false if negative elements found

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().

◆ ExecuteBracketingAnalysisBatch()

bool Conductor::ExecuteBracketingAnalysisBatch ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "Correct based on size and organic matter": "true"/"false"
Returns
true if execution completed successfully, false if OM/Size correction unavailable or negative elements found

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().

◆ ExecuteCMBBayesian()

bool Conductor::ExecuteCMBBayesian ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Sample": Target sample name
  • "Apply size and organic matter correction": "true"/"false"
  • Plus MCMC-specific parameters (chain count, samples, burnin, etc.)
Returns
true if execution completed successfully, false if OM/Size correction unavailable or errors occur

Definition at line 2225 of file conductor.cpp.

References Data(), Results::Error(), mainwindow, MCMC, SourceSinkData::MCMC(), results, and workingfolder.

Referenced by Execute().

◆ ExecuteCMBBayesianBatch()

bool Conductor::ExecuteCMBBayesianBatch ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Apply size and organic matter correction": "true"/"false"
  • Plus MCMC-specific parameters (chain count, samples, burnin, etc.)
Returns
true if execution completed successfully, false if OM/Size correction unavailable

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().

◆ ExecuteCorrelationMatrix()

bool Conductor::ExecuteCorrelationMatrix ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group": Name of the group to analyze
  • "Threshold": Correlation threshold for highlighting
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
Returns
true if execution completed successfully, false if OM/Size correction unavailable

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().

◆ ExecuteCovarianceMatrix()

bool Conductor::ExecuteCovarianceMatrix ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group": Name of the group to analyze
Returns
true if execution completed successfully

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().

◆ ExecuteDFA()

bool Conductor::ExecuteDFA ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group I": First group name
  • "Source/Target group II": Second group name
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
Returns
true if execution completed successfully, false if groups are identical or matrix is singular

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().

◆ ExecuteDFAM()

bool Conductor::ExecuteDFAM ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
Returns
true if execution completed successfully, false if matrix is singular or negative elements found

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().

◆ ExecuteDFAOnevsRest()

bool Conductor::ExecuteDFAOnevsRest ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source group": Group name to discriminate from others
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
Returns
true if execution completed successfully, false if matrix is singular

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().

◆ ExecuteDistributionFitting()

bool Conductor::ExecuteDistributionFitting ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group": Name of the group to analyze
  • "Constituent": Specific element name to fit
  • "Use only selected samples": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
Returns
true if execution completed successfully, false if OM/Size correction unavailable or negative elements found

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().

◆ ExecuteEDP()

bool Conductor::ExecuteEDP ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group I": First group name
  • "Source/Target group II": Second group name
  • "Use only selected samples": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
  • "P-value threshold": Significance threshold for highlighting
Returns
true if execution completed successfully, false if OM/Size correction unavailable or negative elements found

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().

◆ ExecuteEDPM()

bool Conductor::ExecuteEDPM ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Include target samples": "true"/"false"
  • "Use only selected samples": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
  • "P-value threshold": Significance threshold for highlighting
Returns
true if execution completed successfully, false if OM/Size correction unavailable or negative elements found

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().

◆ ExecuteErrorAnalysis()

bool Conductor::ExecuteErrorAnalysis ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Sample": Target sample name
  • "Apply size and organic matter correction": "true"/"false"
  • "Softmax transformation": "true"/"false"
  • "Pecentage eliminated": Percentage of elements to remove per iteration
  • "Number of realizations": Number of bootstrap iterations
Returns
true if execution completed successfully, false if OM/Size correction unavailable or negative elements found

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().

◆ ExecuteGA()

bool Conductor::ExecuteGA ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Sample": Target sample name
  • "Apply size and organic matter correction": "true"/"false"
  • Plus other GA-specific parameters passed to SetProperties
Returns
true if execution completed successfully, false if validation failed

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().

◆ ExecuteGA_FixedProfile()

bool Conductor::ExecuteGA_FixedProfile ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Sample": Target sample name
  • "Apply size and organic matter correction": "true"/"false"
  • Plus other GA-specific parameters
Returns
true if execution completed successfully, false if validation failed

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().

◆ ExecuteGA_NoTargets()

bool Conductor::ExecuteGA_NoTargets ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Sample": Target sample name (used for naming only)
  • Plus other GA-specific parameters
Returns
true if execution completed successfully, false if validation failed

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().

◆ ExecuteKolmogorovSmirnov()

bool Conductor::ExecuteKolmogorovSmirnov ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group": Name of the group to analyze
  • "Distribution": "Normal" or "Lognormal"
Returns
true if execution completed successfully

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().

◆ ExecuteKolmogorovSmirnovIndividual()

bool Conductor::ExecuteKolmogorovSmirnovIndividual ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group": Name of the group to analyze
  • "Constituent": Specific element name to test
  • "Distribution": "Normal" or "Lognormal"
Returns
true if execution completed successfully

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().

◆ ExecuteLevenbergMarquardt()

bool Conductor::ExecuteLevenbergMarquardt ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Sample": Target sample name
  • "Apply size and organic matter correction": "true"/"false"
  • "Softmax transformation": "true"/"false"
Returns
true if execution completed successfully, false if validation failed

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().

◆ ExecuteLevenbergMarquardtBatch()

bool Conductor::ExecuteLevenbergMarquardtBatch ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Apply size and organic matter correction": "true"/"false"
  • "Softmax transformation": "true"/"false"
Returns
true if execution completed successfully, false if validation failed

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().

◆ ExecuteMLR()

bool Conductor::ExecuteMLR ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Organic Matter constituent": OM variable name (can be empty)
  • "Particle Size constituent": Size variable name (can be empty)
  • "Equation": "Linear" or "Power"
  • "P-value threshold": Statistical significance threshold
  • "Use only selected samples": "true"/"false"
Returns
true if execution completed successfully, false if no constituents selected

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().

◆ ExecuteOMSizeCorrect()

bool Conductor::ExecuteOMSizeCorrect ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Sample": Target sample name for correction basis
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
Returns
true if execution completed successfully

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().

◆ ExecuteOutlierAnalysis()

bool Conductor::ExecuteOutlierAnalysis ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group": Name of the group to analyze
  • "Threshold": Standard deviation threshold for outlier detection
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
Returns
true if execution completed successfully, false if negative elements found

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().

◆ ExecuteSDFA()

bool Conductor::ExecuteSDFA ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source/Target group I": First group name
  • "Source/Target group II": Second group name
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
Returns
true if execution completed successfully, false if groups identical, matrix singular, or negative elements found

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().

◆ ExecuteSDFAM()

bool Conductor::ExecuteSDFAM ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
  • "Modify the included elements based on the results": "true"/"false"
Returns
true if execution completed successfully, false if matrix singular or negative elements found

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().

◆ ExecuteSDFAOnevsRest()

bool Conductor::ExecuteSDFAOnevsRest ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source group": Group name to discriminate from others
  • "Use only selected samples": "true"/"false"
  • "Use only selected elements": "true"/"false"
  • "OM and Size Correct based on target sample": Sample name or empty
  • "Box-cox transformation": "true"/"false"
Returns
true if execution completed successfully, false if matrix singular or negative elements found

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().

◆ ExecuteSourceVerify()

bool Conductor::ExecuteSourceVerify ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Source Group": Source group name to verify
  • "Apply size and organic matter correction": "true"/"false"
  • "Softmax transformation": "true"/"false"
Returns
true if execution completed successfully, false if OM/Size correction unavailable or negative elements found

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().

◆ ExecuteTestCMBBayesian()

bool Conductor::ExecuteTestCMBBayesian ( const std::map< std::string, std::string > &  arguments)
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.

Parameters
argumentsMap of configuration parameters including:
  • "Number of samples": Total MCMC samples per chain
  • "Number of chains": Number of independent chains
  • "Samples to be discarded (burnout)": Burnin period
  • "samples_file_name": Output file name for samples
Returns
true if execution completed successfully

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().

◆ GetResults()

Results * Conductor::GetResults ( )
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.

Returns
Heap-allocated Results pointer (caller must delete)
Note
This allocates memory - caller must ensure proper cleanup
Warning
Results are cleared at the start of each Execute() call, so this should be called before the next analysis

Definition at line 96 of file conductor.h.

References results.

◆ SetData()

void Conductor::SetData ( SourceSinkData _data)
inline

Sets the SourceSinkData for analysis.

Parameters
_dataPointer to SourceSinkData (non-owning, must remain valid during operations)

Definition at line 81 of file conductor.h.

References data.

◆ SetWorkingFolder()

void Conductor::SetWorkingFolder ( const QString &  wf)
inline

Sets the working directory for output files.

Parameters
wfWorking folder path as QString

Definition at line 102 of file conductor.h.

References workingfolder.

◆ WorkingFolder()

QString Conductor::WorkingFolder ( ) const
inline

Returns the current working directory path.

Returns
Working folder path as QString

Definition at line 108 of file conductor.h.

References workingfolder.

Member Data Documentation

◆ data

SourceSinkData* Conductor::data
private

Non-owning pointer to analysis data.

Definition at line 139 of file conductor.h.

Referenced by Data(), ExecuteBracketingAnalysisBatch(), and SetData().

◆ GA

std::unique_ptr<CGA<SourceSinkData> > Conductor::GA
private

Genetic Algorithm optimizer (owned)

Definition at line 140 of file conductor.h.

Referenced by ExecuteGA(), ExecuteGA_FixedProfile(), and ExecuteGA_NoTargets().

◆ mainwindow

◆ MCMC

std::unique_ptr<CMCMC<SourceSinkData> > Conductor::MCMC
private

MCMC sampler (owned)

Definition at line 141 of file conductor.h.

Referenced by ExecuteCMBBayesian(), and ExecuteCMBBayesianBatch().

◆ results

◆ workingfolder

QString Conductor::workingfolder
private

The documentation for this class was generated from the following files: