pymixef.inference module

Restartable deterministic bootstrap workflows.

class pymixef.inference.BootstrapResult(draws, failures, seed, resampling)[source]

Bases: object

Parameter draws, failure accounting, and interval calculations.

Parameters:
  • draws (DiagnosticTable)

  • failures (tuple[Mapping[str, Any], ...])

  • seed (int)

  • resampling (str)

draws: DiagnosticTable
failures: tuple[Mapping[str, Any], ...]
seed: int
resampling: str
property successful_replicates: int
property failed_replicates: int
intervals(level=0.95, *, method='percentile')[source]
Parameters:
  • level (float)

  • method (str)

Return type:

DiagnosticTable

to_dict()[source]
Return type:

dict[str, Any]

pymixef.inference.bootstrap(fit_function, data, *, n_replicates, seed, cluster=None, checkpoint=None, resume=True)[source]

Run a nonparametric row or cluster bootstrap with restartable checkpoints.

Parameters:
  • fit_function (Callable[[Mapping[str, ndarray]], FitResult])

  • data (Any)

  • n_replicates (int)

  • seed (int)

  • cluster (str | None)

  • checkpoint (str | Path | None)

  • resume (bool)

Return type:

BootstrapResult