API reference¶
This is the task-oriented entrance to the complete PyMixEF Python API. Every public module is linked to its generated reference page, while the tables name the classes, functions, constants, and protocols that readers are most likely to search for directly.
Use the generated module index when you already know
the import path. Use the alias reference when code uses a
convenience name such as pymixef.load, Normal, NB2, dry_run, or
estimated_marginal_means.
Find an API by task¶
Goal |
Start here |
Principal modules |
|---|---|---|
Fit or inspect a model |
|
|
Parse a formula or build design matrices |
|
|
Normalize, audit, or reconcile data |
|
|
Run LMM, GLMM, or MMRM calculations |
|
|
Calculate probability distributions |
|
|
Declare covariance or parameter constraints |
|
|
Work with fit results, diagnostics, or uncertainty |
7. Results, diagnostics, simulation, inference, and reporting |
|
Author a pharmacometric model |
|
|
Process dosing events, PK, or ODE systems |
9. Events, closed-form PK, ODE simulation, and population primitives |
|
Inspect or migrate the model IR |
|
|
Translate external formats |
|
|
Capture evidence and reproducibility |
12. Capabilities, provenance, randomness, and validation evidence |
|
Register extensions |
|
|
Handle errors, warnings, native discovery, or the CLI |
|
Root exports and submodule APIs¶
The pymixef root module is the concise everyday
surface. It exports fit, Model, ModelIR, FitResult, compare,
bootstrap, render_report, capability and validation helpers, convergence
types, stable exception types, and the families, covariance, diagnostics,
interoperability, and pharmacometrics namespaces.
Specialized APIs remain in their owning modules:
import pymixef
from pymixef.data import audit_data
from pymixef.formula import compile_formula
from pymixef.pharmacometrics import canonicalize_events, simulate_ode
result = pymixef.fit("response ~ time + (1 | subject)", data=data)
audited = audit_data(data, response="response", covariates=("time",))
matrices = compile_formula("response ~ time", data)
An object can therefore be public without being a direct pymixef.<name>
export. For example, DiagnosticTable belongs to pymixef.diagnostics,
Capability belongs to pymixef.capabilities, and CompatibilityReport
belongs to pymixef.interoperability. Prefer the documented owning module for
stable imports. See API alias reference for names that deliberately resolve to
another public object.
Important
Catalog availability is not estimator support The family, covariance, IR, and pharmacometric catalogs are broader than the formula backends that can execute a complete fit.
Formula LMM execution is Gaussian ML or REML.
Formula GLMM execution is the documented Bernoulli, binomial, Poisson, and negative-binomial-2 Laplace subset.
The dedicated MMRM path is Gaussian REML with an explicit residual covariance.
Other
Familyclasses remain useful for normalized likelihood, probability, moment, and simulation calculations, but their presence does not make them executable bypymixef.fit.Priors and distributional predictors can be represented in
ModelIR; current formula backends do not execute those declarations.fit_focei()deliberately rejects because an integrated production FOCEI path is not present.experimental_saem()is a callback-driven experimental kernel rather than an integrated population estimator.
Check pymixef.iter_capabilities() or pymixef capabilities --json before
depending on an experimental calculation path.
1. Fit, compile, validate, and explain a model¶
Module |
Public objects |
|---|---|
|
|
Classes |
Model.from_formula() creates a backend-neutral model. Model.validate(),
Model.explain(), and Model.compile() inspect compatibility before
optimization. ExecutionPlan.validate(), ExecutionPlan.explain(), and
ExecutionPlan.to_backend_data() expose the deterministic compiled plan;
ExecutionPlan.fit() executes it. pymixef.fit() is the direct formula or
prebuilt-Model entry point.
2. Formulas and design matrices¶
Module |
Public classes |
Public functions |
|---|---|---|
|
|
Search for FormulaSpec.to_ir, FormulaSpec.explain,
DesignMatrices.to_backend_data, DesignMatrices.explanation, and
DesignMatrices.explain when inspecting compilation. Formula expressions
support documented fixed effects, interactions, nesting, correlated | and
independent || random blocks, categorical encoding, safe transforms, and
row-complete audit metadata.
3. Data adaptation, missingness, and audit¶
Module |
Public classes and enums |
Public functions |
|---|---|---|
|
|
ColumnarData is the immutable internal table and exposes n_rows,
n_columns, column_names, take, to_dict, and fingerprint. DataAudit
exposes source-to-analysis reconciliation through excluded_rows,
excluded_row_ids, reason_counts, and to_dict.
4. LMM, GLMM, and MMRM backends¶
Module |
Public API |
|---|---|
|
|
|
|
|
|
|
|
|
The backend functions return the lower-level payload contract.
pymixef.fit() and ExecutionPlan.fit() convert that payload into a
FitResult with convergence, provenance, warnings, diagnostics, and archived
model semantics.
5. Probability families and links¶
pymixef.families defines the common
Family and Link contracts.
Catalog |
Public objects |
|---|---|
Links |
|
Continuous |
|
Discrete and categorical |
|
Mixture and observation wrappers |
|
Survival |
|
The shared calculation vocabulary is log_prob, log_probability, logpdf,
logpmf, cdf, logcdf, sf, logsf, rvs, random, mean, variance,
and moments. The alias reference lists short names including
Normal, NB1, NB2, GenPoisson, and the *Family and *Survival aliases.
6. Covariance structures and parameter transforms¶
Module |
Public API |
|---|---|
|
|
|
CovarianceStructure.parameter_count, parameter_names, covariance,
matrix, validate, derivatives, simulate, and to_dict form the
structure contract. Transform.forward, inverse,
log_abs_det_jacobian, and jacobian form the optimizer-to-natural-scale
contract.
7. Results, diagnostics, simulation, inference, and reporting¶
Module |
Public API |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
DiagnosticTable.save() and DiagnosticTable.load() handle JSON and CSV
diagnostic data. BootstrapResult.intervals() provides the documented portable
percentile interval path. GroupInfluenceResult retains group-level refit and
approximation failures; ApproximationSensitivityResult retains exact named
settings and cross-refit failures. ComparisonResult.assert_within() and
ComparisonResult.write_report() support explicit cross-platform tolerances
and reports. render_report() emits Markdown, HTML, PDF, or Word according to
the destination suffix and installed optional dependencies.
9. Events, closed-form PK, ODE simulation, and population primitives¶
Module |
Public API |
|---|---|
|
|
|
|
|
|
|
CanonicalEvent exposes event classification, effective dose/rate/duration, and
record conversion. EventTable provides subject selection, source and
canonical record conversion, ADDL and infusion expansion, and provenance.
ODESimulationResult.state() and sensitivity() select named output arrays.
10. Model IR, schema migration, hashing, and diffing¶
pymixef.ir defines:
schema constants
IR_SCHEMA_VERSION,MODEL_IR_SCHEMA_VERSION,LEGACY_IR_SCHEMA_VERSION, andSUPPORTED_IR_SCHEMA_VERSIONS;IRNodeand the typed nodesParameterIR,FixedEffectIR,RandomEffectIR,PredictorIR,LikelihoodIR,CovarianceIR,TransformIR,PriorIR,StateEquationIR,EventIR, andOutputIR;the complete
ModelIRgraph;register_ir_migration,migrate_ir,diff_models, and aliasmodel_diff;DiffEntryandModelDiff.
ModelIR.to_dict(), canonical_json(), to_json(), from_dict(),
from_json(), semantically_equal(), and diff() are the serialization and
comparison operations. ModelIR.semantic_hash and ModelIR.hash are
properties. ModelDiff.equal and ModelDiff.categories are also properties.
11. Interoperability and compatibility accounting¶
Module |
Public API |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
Every interchange function returns a value with explicit compatibility
accounting. Use CompatibilityReport.supported, by_status,
require_supported, to_dict, and write; use
InterchangeResult.require_supported() when unsupported constructs must stop a
workflow.
12. Capabilities, provenance, randomness, and validation evidence¶
Module |
Public API |
|---|---|
|
|
|
|
|
|
|
|
|
RunManifest.capture() records model and data fingerprints, environment,
settings, seeds, reproducibility class, convergence, and warnings.
RandomStreamManager.generator() and replicates() derive order-independent
Philox streams. Validation bundles are created by
create_validation_bundle() and checked by verify_validation_bundle().
13. Plugins and advanced backend contracts¶
pymixef.plugins exposes:
PluginInfoand genericRegistry;protocols
CovariancePluginandEstimatorPlugin;discover_plugins;FAMILY_REGISTRY,LINK_REGISTRY,COVARIANCE_REGISTRY,ESTIMATOR_REGISTRY,DIAGNOSTIC_REGISTRY,EXPORTER_REGISTRY, andODE_SOLVER_REGISTRY.
Use Registry.register, unregister, get, info, names, and snapshot
for explicit runtime registration. Low-level implementers should also consult
pymixef.backends.base for the Backend
protocol and compiled numeric payload contracts.
14. Errors, warnings, native discovery, and command line¶
Module |
Public API |
|---|---|
|
|
|
|
|
|
programmatic function |
|
|
Expected PyMixEF exceptions carry code, remediation, details, and
source_location; use PyMixEFError.to_dict() instead of parsing display
messages. Structured warnings carry a WarningRecord, and
load_warning_catalog() returns the packaged stable warning catalog.