pytyche.analysis.evaluate_against_truth

pytyche.analysis.evaluate_against_truth(posterior, tree, truth)[source]

Evaluate the posterior + tree policy against ground truth.

Sim-mode only: generators pair observed data with a CalibrationTruth; real-data mode has no truth and raises RuntimeError.

Parameters:
Return type:

TruthComparison

Returns:

TruthComparison with all six metrics populated.

Raises:
  • RuntimeError – When truth is None (real-data mode — nothing to evaluate against).

  • ValueError – When posterior.observed is None, when the truth lacks the K-appropriate contrast or potential-outcome fields, or when the truth shapes do not match the posterior.