R → Python parity¶
The frozen R reference is gp3bayes 0.5.0. dev/parity/function_map.csv contains every exported R function, its exact raw R signature, source file, source line, help file, proposed Python module, and current implementation status.
Parity is classified by exact structural parity, numerical tolerance parity, stochastic/distributional parity, semantic parity, or documented intentional Python divergence. Identical MCMC draws are not required across independent backends.
GPB-PY-01 core parity checkpoint¶
The contract/readiness/specification core is frozen against R gp3bayes 0.5.0 structural expectations. Six exports are now implemented: create_model_contract, audit_model_readiness, build_model_formula, create_prior_specification, validate_prior_specification, and create_model_specification. backend_capabilities remains implemented_initial until backend/environment-specific parity is tested.
Current ledger counts: 6 implemented, 1 implemented_initial, 451 mapped_not_implemented = 458 total exports. The fixture dev/parity/core_reference_cases_0.5.0.json records its R-derived, non-runtime-captured provenance explicitly.
GPB-PY-02 binary foundation checkpoint¶
The backend-independent binary workflow foundation is frozen against R gp3bayes 0.5.0 source and test expectations. Four additional exports are now implemented: simulate_hierarchical_binary_data, prepare_hierarchical_binary_data, specify_binary_model, and check_binary_prior_predictive.
Simulation and prior-predictive parity are stochastic/semantic rather than bit-identical because R and NumPy use different random-number generators. Preparation and model-specification parity are structural/deterministic where the R contract permits.
Current ledger counts: 10 implemented, 1 implemented_initial, 447 mapped_not_implemented = 458 total exports. backend_capabilities remains implemented_initial.
The fixture dev/parity/binary_foundation_reference_0.5.0.json records the frozen signatures, reference provenance, and parity classification for this tranche.
GPB-PY-03 duration foundation checkpoint¶
The backend-independent duration workflow foundation is frozen against R gp3bayes 0.5.0 source and test expectations. Four additional exports are now implemented: simulate_hierarchical_duration_data, prepare_hierarchical_duration_data, specify_duration_model, and check_duration_prior_predictive.
Duration preparation preserves explicit source/analysis-unit provenance, strictly positive finite outcomes, one-based dropped-row provenance, and R-style sample-SD predictor scaling. Simulation and prior-predictive parity are stochastic/semantic rather than bit-identical because R and NumPy use different random-number generators.
Current ledger counts: 14 implemented, 1 implemented_initial, 443 mapped_not_implemented = 458 total exports. backend_capabilities remains implemented_initial.
The fixture dev/parity/duration_foundation_reference_0.5.0.json records the frozen signatures, reference provenance, and parity classification for this tranche.
GPB-PY-04 restricted fitting checkpoint¶
The restricted binary and duration fitting layer is frozen against the R gp3bayes 0.5.0 fitting contracts. Four additional exports are now implemented: translate_binary_model_to_brms, fit_binary_model, translate_duration_model_to_brms, and fit_duration_model.
The public compatibility names are retained from R, while Python execution is an intentional backend adaptation to PyMC/NUTS. Fit objects report the actual Python backend truthfully and retain the R brms/rstan pathway only as source-provenance metadata. The API exposes only governed sampling controls and does not provide unrestricted formula, family, prior, algorithm, backend, or arbitrary keyword escape hatches.
A real Windows/Python 3.13.15 backend smoke completed both binary and duration NUTS fits. This demonstrates executable backend integration only; short smoke chains do not establish convergence, posterior adequacy, predictive validity, robustness, or substantive validity. Runtime evidence is frozen in dev/parity/fitting_backend_validation_0.1.0.dev0.json.
Current ledger counts: 18 implemented, 1 implemented_initial, 439 mapped_not_implemented = 458 total exports. backend_capabilities remains implemented_initial because the broader backend-capability contract has not yet been closed.
GPB-PY-05 posterior foundation checkpoint¶
The backend-neutral posterior extraction, posterior summary, and sampling-diagnostic layer is frozen against the R gp3bayes 0.5.0 posterior contracts. Five additional exports are now implemented: extract_posterior_draws, diagnose_binary_fit, summarise_binary_posterior, diagnose_duration_fit, and summarise_duration_posterior.
The Python port preserves the R-facing posterior parameter naming convention while adapting storage to PyMC InferenceData, xarray, pandas, and NumPy. Rank-normalized R-hat, bulk ESS, tail ESS, divergences, treedepth saturation, and E-BFMI are assessed through the governed ArviZ/PyMC pathway. Posterior summaries remain descriptive and do not automatically establish convergence, posterior adequacy, predictive validity, robustness, or substantive validity.
A real Windows/Python 3.13.15 PyMC/ArviZ smoke completed both binary and duration posterior paths. The deliberately short two-chain, 50-draw smoke failed the prespecified diagnostic thresholds for both families; this is expected and confirms conservative reporting rather than a backend failure. Runtime evidence is frozen in dev/parity/posterior_backend_validation_0.1.0.dev0.json.
Current ledger counts: 23 implemented, 1 implemented_initial, 434 mapped_not_implemented = 458 total exports. backend_capabilities remains implemented_initial until its broader capability contract is separately closed.
GPB-PY-06 predictive foundation checkpoint¶
The governed prediction layer is frozen against the R gp3bayes 0.5.0 prediction-support.R contracts. Ten additional exports are now implemented: create_prediction_grid, audit_prediction_support, prediction_support_table, predict_model, prediction_table, extract_expected_predictions, extract_posterior_predictions, extract_linear_predictions, predict_binary_probability, and predict_duration.
Expected-response, posterior-predictive, linear-predictor, and duration-median quantities remain distinct. Population-level predictions omit fitted grouping effects by default; grouping effects require explicit inclusion, and unseen grouping levels require explicit permission. Support auditing is advisory and never removes or rejects rows automatically. Prediction remains descriptive under the fitted model and does not establish causal effects or out-of-sample adequacy.
A real Windows/Python 3.13.15 PyMC/NUTS smoke completed binary and duration predictive paths with 25 draws over two prediction rows for each family. Runtime evidence is frozen against implementation commit a8feb83 in dev/parity/predictive_backend_validation_0.1.0.dev0.json.
Current ledger counts: 33 implemented, 1 implemented_initial, 424 mapped_not_implemented = 458 total exports. backend_capabilities remains implemented_initial until its broader capability contract is separately closed.
GPB-PY-07 posterior predictive checkpoint¶
The governed posterior-predictive validation layer is frozen against the R gp3bayes 0.5.0 binary and duration posterior-validation contracts. Two additional exports are now implemented: check_binary_posterior_predictive and check_duration_posterior_predictive.
Binary checks compare six declared observed summaries with replicated outcomes and report a Brier score from posterior expected probabilities. Duration checks compare nine positive-scale summaries and report log-scale RMSE from posterior expected durations. Central predictive intervals retain the R quantile(type = 8) convention and statuses remain limited to the declared summaries.
A real Windows/Python 3.13.15 PyMC/NUTS smoke completed both PPC paths at implementation commit fd046c2. The binary smoke status was review and the duration smoke status was pass; neither result is a global model-adequacy declaration. Runtime evidence is frozen in dev/parity/posterior_predictive_backend_validation_0.1.0.dev0.json.
Current ledger counts: 35 implemented, 1 implemented_initial, 422 mapped_not_implemented = 458 total exports. backend_capabilities remains implemented_initial until its broader capability contract is separately closed.
GPB-PY-08 predictive scoring and calibration checkpoint¶
The compact predictive-diagnostics layer is frozen against the R gp3bayes 0.5.0 prediction-support.R contracts. Eight additional exports are now implemented: binary_prediction_scores, binary_threshold_metrics, binary_calibration_table, duration_prediction_scores, duration_quantile_calibration, duration_pit_table, predictive_coverage_table, and posterior_predictive_summary_table.
Binary scoring preserves Brier score, finite-clipped log loss, average-rank AUC, threshold accuracy, sensitivity, specificity, balanced accuracy, equal-frequency calibration summaries, and threshold curves. Duration scoring preserves response-scale and log-scale errors, predictive quantile calibration, and empirical posterior-predictive PIT values. Generic predictive coverage and posterior-predictive summary tables retain the frozen R default quantile convention (type = 7).
A real Windows/Python 3.13.15 PyMC/NUTS smoke completed both binary and duration scoring/calibration paths at implementation commit cde4776. The smoke produced binary Brier 0.16904163877577907, binary AUC 0.86, duration log-RMSE 0.43882913179095007, and four calibration bins. No threshold, score, calibration result, or coverage summary made an automatic decision or established global model adequacy. Runtime evidence is frozen in dev/parity/predictive_scoring_backend_validation_0.1.0.dev0.json.
Current ledger counts: 43 implemented, 1 implemented_initial, 414 mapped_not_implemented = 458 total exports. backend_capabilities remains implemented_initial until its broader capability contract is separately closed.
GPB-PY-09 predictive contrasts and diagnostics checkpoint¶
The descriptive predictive-diagnostics layer is frozen against the R gp3bayes 0.5.0 prediction-support.R contracts. Five additional exports are now implemented: prediction_contrast, prediction_exceedance_probability, prediction_uncertainty_decomposition, grouped_prediction_check, and predictive_residuals.
Contrast rows retain R one-based identifiers and ratio or odds-ratio summaries remain restricted to valid response scales. Exceedance probabilities use strict above/below comparisons. Prediction uncertainty separates expected-response Monte Carlo variance from total posterior-predictive variance only descriptively and is explicitly not a causal variance decomposition. Grouped checks never exclude groups automatically, and residuals remain descriptive model diagnostics rather than adequacy declarations.
A real Windows/Python 3.13.15 PyMC/NUTS smoke completed binary and duration diagnostic paths at implementation commit c4c5221. The smoke produced a difference mean of -0.010147057651756204, odds-ratio mean of 1.071040109372952, duration-ratio mean of 0.8580219252316759, and six grouped rows. No contrast or exceedance result made an automatic decision; no group was automatically excluded; uncertainty was not interpreted causally; and global adequacy remained unestablished. Runtime evidence is frozen in dev/parity/predictive_diagnostics_backend_validation_0.1.0.dev0.json.
Current ledger counts: 48 implemented, 1 implemented_initial, 409 mapped_not_implemented = 458 total exports. backend_capabilities remains implemented_initial until its broader capability contract is separately closed.
Full 0.5.0 Python closure¶
The cumulative completion candidate promotes all 458 frozen exports to implemented. backend_capabilities, previously implemented_initial, is now closed with the backend/schema reliability layer. The packaged and development manifests are identical at 458 implemented / 0 implemented_initial / 0 mapped_not_implemented.
All 59 canonical R vignettes have Python-facing article pages, and the repository includes executable family-level examples. Historical GPB-PY-01 through GPB-PY-10 closure tests remain as minimum milestone checks rather than freezing obsolete ledger counts.
No final closure claim is inferred from namespace existence alone: the candidate is gated by regression tests, explicit-signature checks, build/fresh-install validation, runnable examples, and pupil/predictive/LOO integration smokes.