openghg_inversions.models.additive_sigma#

Model-owned likelihood with an additive model-data-mismatch scale.

For reported observation-error variance \(s_y^2\), optional fixed mismatch \(s_{fixed}\), inferred mismatch scale \(\sigma\), and fixed aggregation covariance \(C_{agg}\), this component constructs the independent variance

\[v = s_y^2 + s_{fixed}^2 + \sigma^2\]

An optional error-floor policy may apply a lower bound to total marginal standard deviation. add_additive_sigma_likelihood is the one direct model component: RHIME-specific site/frequency translation lives outside this module.

openghg_inversions.models.additive_sigma.add_additive_sigma_likelihood(*, observations: DataArray, observation_error: DataArray, aggregation_error: AggregationError, mean: TensorVariable, minimum_error_floor: DataArray | None = None, fixed_model_mismatch: DataArray | None = None, additive_sigma_alignment: SigmaAlignment | None = None, additive_sigma_prior: dict[str, Any] | None = None, output_dim: str = 'nmeasure', observation_error_name: str = 'error') TensorVariable#

Add a Gaussian likelihood with additive mismatch variance.

fixed_model_mismatch is a known observation-aligned standard deviation. The inferred absolute mismatch scale is observation-aligned through additive_sigma_alignment and enters as a separate variance term. When no alignment is supplied, no inferred scale is constructed. Fixed diagonal, dense, or low-rank aggregation error is included only when explicitly selected. If supplied, minimum_error_floor floors the total marginal standard deviation.

Parameters:
  • observations – Observed mole fractions.

  • observation_error – Reported observation-error standard deviations.

  • aggregation_error – Validated fixed aggregation-error representation.

  • mean – Completed forward-model concentration aligned with output_dim.

  • minimum_error_floor – Optional minimum total-error standard deviations.

  • fixed_model_mismatch – Optional known model-data mismatch standard deviation, in the same units and observation order as observations.

  • additive_sigma_alignment – Mapping from observations to absolute additive mismatch-scale parameters. Omit it for a fixed-error likelihood.

  • additive_sigma_prior – Prior arguments used to construct the absolute additive mismatch scale.

  • output_dim – Observation dimension used for named PyMC variables.

  • observation_error_name – PyMC data name for the reported error.

Returns:

The observed Gaussian variable, named y. The total marginal error scale is also recorded in the active model as epsilon.

Raises:

ValueError – If the observation or aggregation-error inputs are inconsistent with output_dim.