egttools.numerical.estimators

Python wrapper classes for egttools MC estimators.

These wrappers add two things the underlying C++ classes do not provide:

  1. Rich result objects — every method returns a typed dataclass (FixationResult, StrategyDistributionResult, …) that carries the point estimate, standard error, 95 % CI, and prints a readable summary.

  2. Optional progress bar — pass verbose=1 to any estimation method and a tqdm progress bar is shown over the internal chunks. tqdm is an optional dependency; if it is absent the call runs silently.

The wrappers use chunked execution: nb_runs is split into n_chunks equal pieces, each piece runs as a single C++ call, and the SE is computed as std(chunk_means) / sqrt(n_chunks). This gives SE estimates for methods that otherwise return only a point estimate (e.g. PairwiseComparisonNumerical.estimate_fixation_probability).

All other attributes and methods of the underlying C++ object are accessible directly via __getattr__, so these wrappers are drop-in replacements.

Classes

AGoSResult

Average gradient of selection G^A(x) from a network MC estimator.

AbsorptionProbabilityResult

Per-strategy fixation (absorption) probabilities.

AbsorptionTimeResult

Mean absorption (fixation) time from a given initial state.

FixationResult

Fixation probability of an invading strategy into a resident population.

NetworkEstimator

Wraps any NetworkMCEstimator* C++ instance and returns rich result objects with optional progress bars.

PairwiseComparisonEstimator

Wraps egttools.numerical.PairwiseComparisonNumerical and returns rich result objects with standard errors and optional progress bars.

StationaryDistributionResult

Estimated stationary distribution over population states.

StrategyDistributionResult

Time-averaged strategy frequencies with uncertainty.