unmixing: Unmix sediment or marine particle mixtures

View source: R/unmixing.R

unmixingR Documentation

Unmix sediment or marine particle mixtures

Description

Estimates the fractional contribution of each potential source to one or more mixtures. Users can seamlessly switch between a lightning-fast Frequentist least-squares approach (with optional Linear Variability Propagation) or a standard Bayesian MCMC approach.

Usage

unmixing(
  data,
  model = "frequentist",
  iter = 1000L,
  variability = "SEM",
  lvp = TRUE,
  seed = 123456L,
  ...
)

Arguments

data

Data frame in the standard OceanTracer format.

model

Character. "frequentist" (default) or "bayesian".

iter

Integer. Number of iterations for frequentist Monte Carlo/LVP. Default 1000L.

variability

Character. Uncertainty metric: "SEM" (Standard Error of the Mean, default) or "SD" (Standard Deviation).

lvp

Logical. TRUE (default) uses Linear Variability Propagation; FALSE uses classical Monte Carlo resampling.

seed

Integer. Random seed for reproducibility. Default 123456L.

...

Additional arguments passed to the Bayesian engine (e.g., run = "test").

Details

Both raw (individual observations) and averaged (Mean_/SD_ columns) input formats are accepted. When multiple mixture samples are present, the model processes each independently.

Value

For the "frequentist" model, a data frame with one row per iteration and mixture. For the "bayesian" model, a named list containing the formatted apportionment data frame, the MixSIAR summary statistics, and the raw JAGS model object.

References

Latorre, B., Lizaga, I., Gaspar, L., & Navas, A. (2025). Evaluating the impact of high source variability and extreme contributing sources on sediment fingerprinting models. Water Resources Management. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11269-025-04169-8")}


OceanTracer documentation built on Oct. 15, 2026, 5:09 p.m.