Auto-generated index of all exports from bossanova.internal. Each module’s __all__ is introspected to list classes, functions, and constants with their first-line docstrings.
Summary¶
| Module | Classes | Functions | Attributes | Total |
|---|---|---|---|---|
structs.data | 3 | 0 | 0 | 3 |
structs.display | 2 | 0 | 0 | 2 |
structs.explore | 6 | 0 | 0 | 6 |
structs.fit | 1 | 0 | 0 | 1 |
structs.formula | 1 | 0 | 0 | 1 |
structs.inference | 4 | 0 | 0 | 4 |
structs.marginal | 1 | 0 | 0 | 1 |
structs.mixed | 3 | 0 | 0 | 3 |
structs.prediction | 2 | 0 | 0 | 2 |
structs.simulation | 1 | 0 | 0 | 1 |
structs.specs | 4 | 0 | 4 | 8 |
schemas | 1 | 0 | 37 | 38 |
validators | 0 | 25 | 0 | 25 |
builders | 0 | 30 | 0 | 30 |
compare | 0 | 2 | 0 | 4 |
design | 2 | 24 | 0 | 26 |
fit | 1 | 24 | 1 | 26 |
formula | 3 | 5 | 0 | 9 |
infer | 1 | 24 | 0 | 25 |
marginal | 4 | 33 | 0 | 37 |
rendering | 0 | 5 | 0 | 5 |
simulation | 2 | 20 | 0 | 22 |
backend | 1 | 7 | 1 | 9 |
batching | 0 | 2 | 0 | 2 |
config | 0 | 5 | 0 | 5 |
convergence | 1 | 2 | 0 | 3 |
differentiation | 0 | 5 | 0 | 5 |
distributions | 6 | 12 | 0 | 18 |
family | 1 | 50 | 3 | 59 |
inference | 6 | 45 | 0 | 51 |
linalg | 5 | 7 | 0 | 12 |
predict | 0 | 3 | 0 | 3 |
rng | 1 | 1 | 0 | 2 |
rounding | 0 | 2 | 0 | 2 |
solvers | 3 | 16 | 0 | 20 |
tolerances | 0 | 13 | 4 | 17 |
transforms | 8 | 1 | 1 | 10 |
variance | 0 | 1 | 0 | 1 |
weights | 1 | 2 | 0 | 3 |
viz | 0 | 21 | 1 | 22 |
containers¶
structs.data¶
| Name | Kind | Description |
|---|---|---|
DataBundle | class | Validated model data (valid observations only) |
REInfo | class | Random effects metadata |
RankInfo | class | Rank deficiency information for a design matrix |
structs.display¶
| Name | Kind | Description |
|---|---|---|
MathDisplay | class | Display wrapper for model equation with IPython rich display |
TermInfo | class | Parsed information about a single model term |
structs.explore¶
| Name | Kind | Description |
|---|---|---|
Condition | class | A conditioning specification in explore formula |
ContrastExpr | class | Bracket contrast expression: Drug[A - B, C - D] |
ContrastItem | class | A single contrast: left operand minus right operand |
ContrastOperand | class | One side of a bracket contrast item |
ExploreFormulaError | class | Error in explore formula syntax |
ExploreFormulaSpec | class | Parsed explore formula |
structs.fit¶
| Name | Kind | Description |
|---|---|---|
FitState | class | Immutable fitting result |
structs.formula¶
| Name | Kind | Description |
|---|---|---|
FormulaSpec | class | Learned formula encoding — everything needed to replay on new data |
structs.inference¶
| Name | Kind | Description |
|---|---|---|
CVState | class | Cross-validation results for model evaluation |
InferenceState | class | Inference results that augment params or estimates |
JointTestState | class | Joint hypothesis test results for model terms |
ResamplesState | class | Unified resampling results from bootstrap or permutation inference |
structs.marginal¶
| Name | Kind | Description |
|---|---|---|
MeeState | class | Marginal effects / estimated marginal means results |
structs.mixed¶
| Name | Kind | Description |
|---|---|---|
ProfileState | class | Profile likelihood state for variance component CIs |
VaryingSpreadState | class | Variance components for mixed models |
VaryingState | class | Random effects (BLUPs) for mixed models |
structs.prediction¶
| Name | Kind | Description |
|---|---|---|
PredictionConfig | class | Configuration that produced a PredictionState |
PredictionState | class | Prediction results with optional intervals |
structs.simulation¶
| Name | Kind | Description |
|---|---|---|
SimulationInferenceState | class | Simulation inference results for post-fit or power analysis simulations |
structs.specs¶
| Name | Kind | Description |
|---|---|---|
Distribution | class | Protocol for distribution objects that can generate random samples |
FAMILIES | attribute | Supported distribution families |
FAMILY_DEFAULT_LINKS | attribute | Default link functions per family |
LINKS | attribute | Supported link functions |
METHODS | attribute | Supported estimation methods |
ModelSpec | class | Immutable model configuration |
SimulationSpec | class | Specification for data generation in simulation-first workflows |
VaryingSpec | class | Specification for random effect grouping in simulation |
schemas¶
validators¶
| Name | Kind | Description |
|---|---|---|
convert_corr_to_dict | function | Convert correlation specification to dictionary format |
is_choice_str | function | Build a validator for a string constrained to a fixed set of choices |
is_conf_level | function | Validate that a value is a normalized confidence level in (0, 1) |
is_ndarray | function | Validate that a value is a numpy ndarray |
is_nonnegative_int | function | Validate that a value is a non-negative integer |
is_optional_conf_level | function | Validate that a value is a normalized confidence level or None |
is_optional_int | function | Validate that a value is an int or None |
is_optional_ndarray | function | Validate that a value is a numpy ndarray or None |
is_optional_positive_int | function | Validate that a value is a positive integer or None |
is_optional_sparse_csc | function | Validate that a value is a scipy.sparse.csc_matrix or None |
is_optional_str | function | Validate that a value is a string or None |
is_optional_str_key_dict | function | Validate that a value is a dict with string keys or None |
is_optional_tuple_of_str | function | Validate that a value is a tuple of strings or None |
is_positive_int | function | Validate that a value is a positive integer |
is_tuple_of_str | function | Validate that a value is a tuple of strings |
normalize_conf_level | function | Normalize conf_level to a float in (0, 1) |
normalize_optional_conf_level | function | Normalize an optional confidence level |
to_factor_dict | function | Convert factor dict values from lists to tuples |
to_frozen_dict | function | Ensure dict values are tuples where applicable |
to_optional_tuple | function | Convert an optional list of strings to a tuple |
to_tuple | function | Convert list to tuple for immutability |
to_tuple_of_tuples | function | Convert dict values to tuples for immutability |
validate_correlations | function | Validate correlation values are in [-1, 1] |
validate_sigma | function | Validate sigma is non-negative |
validate_slope_sds | function | Validate slope SDs are non-negative |
builders¶
| Name | Kind | Description |
|---|---|---|
append_inference_columns | function | Append standard inference columns to a DataFrame if available |
build_cv_state | function | Build a CVState from cross-validation computation |
build_effects_dataframe | function | Build the .effects DataFrame from marginal effects state |
build_fit_state | function | Build a FitState instance with validation |
build_inference_state | function | Build an InferenceState from computed inference values |
build_joint_test_dataframe | function | Build an ANOVA-style DataFrame from joint test results |
build_joint_test_state | function | Build a JointTestState from computed joint test values |
build_mee_resamples | function | Build ResamplesState from MEE inference if samples are available |
build_mee_state | function | Build a MeeState from marginal effects computation |
build_model_spec | function | Build a ModelSpec from raw inputs |
build_model_spec_from_formula | function | Build ModelSpec from a pre-parsed formula structure and resolve defaults |
build_params_dataframe | function | Build the .params DataFrame from fit state |
build_params_resamples | function | Build ResamplesState from params inference if samples are available |
build_prediction_state | function | Build a PredictionState from prediction computation |
build_predictions_dataframe | function | Build the .predictions DataFrame from prediction state |
build_resamples_dataframe | function | Build a long-format DataFrame of raw resampled values |
build_resamples_state | function | Build a ResamplesState from resampling results |
build_simulation_inference_state | function | Build a SimulationInferenceState from computed values |
build_simulation_spec | function | Build a SimulationSpec for data generation |
build_simulation_spec_from_formula | function | Build SimulationSpec from formula with defaults for unspecified variables |
build_simulations_dataframe | function | Build the .simulations DataFrame with optional inference columns |
build_varying_corr_dataframe | function | Build the .varying_corr DataFrame from random effect correlations |
build_varying_offsets_dataframe | function | Build the .varying_offsets DataFrame from varying state |
build_varying_params_dataframe | function | Build the .varying_params DataFrame (population + offsets) |
build_varying_spec | function | Build a VaryingSpec for random effect structure |
build_varying_spread_dataframe | function | Build the .varying_spread DataFrame from variance components |
build_varying_spread_state | function | Build a VaryingSpreadState from variance component estimates |
build_varying_state | function | Build a VaryingState from computed BLUPs |
extract_mee_names | function | Extract human-readable names from a MeeState |
get_varying_random_terms | function | Get all random terms (Intercept + slope terms) for a VaryingSpec |
domain¶
compare¶
| Name | Kind | Description |
|---|---|---|
compare | module | Model comparison utilities for nested model testing |
compare_aic | function | Compare models by AIC with delta-AIC and Akaike weights |
compare_bic | function | Compare models by BIC with delta-BIC and Schwarz weights |
lrt | module | Likelihood ratio test for comparing nested mixed models |
design¶
| Name | Kind | Description |
|---|---|---|
DesignColumnInfo | class | Parsed design matrix column metadata |
RandomEffectsInfo | class | Complete random effects specification for lmer/glmer |
array_to_coding_matrix | function | Convert user-specified contrasts to a coding matrix for design matrices |
build_random_effects | function | Build complete random effects specification |
build_reference_design_matrix | function | Build design matrix for reference grid points |
build_reference_row | function | Build a single row of the reference design matrix |
build_slope_reference_matrix | function | Build reference matrices for computing marginal slopes |
build_z_crossed | function | Build Z matrix for crossed random effects |
build_z_nested | function | Build Z matrix for nested random effects |
build_z_simple | function | Build Z matrix for single grouping factor |
convert_coding_to_hypothesis | function | Convert a coding matrix back to interpretable hypothesis contrasts |
extract_base_term | function | Extract base term name from column name |
extract_categorical_variables | function | Find all categorical base variable names from design matrix columns |
extract_level_from_column | function | Extract level value for a specific focal variable from column name |
helmert_coding | function | Build Helmert contrast matrix |
helmert_coding_labels | function | Get column labels for Helmert contrast |
identify_column_type | function | Identify column type from name (simplified version) |
parse_design_column_name | function | Parse design matrix column name into components |
poly_coding | function | Build orthogonal polynomial contrast matrix |
poly_coding_labels | function | Get column labels for polynomial contrast |
sequential_coding | function | Build sequential (successive differences) contrast matrix |
sequential_coding_labels | function | Get column labels for sequential contrast |
sum_coding | function | Build sum (effects) contrast matrix |
sum_coding_labels | function | Get column labels for sum contrast |
treatment_coding | function | Build treatment (dummy) contrast matrix |
treatment_coding_labels | function | Get column labels for treatment contrast |
fit¶
| Name | Kind | Description |
|---|---|---|
FitResult | class | Immutable result of the fit lifecycle |
VALID_SOLVERS | attribute | |
augment_data_with_diagnostics | function | Augment raw data with diagnostic columns after fit |
build_mixed_post_fit_state | function | Compute BLUPs, variance components, and emit convergence warnings |
build_predict_grid | function | Build a Cartesian-product prediction grid |
check_convergence | function | Run convergence diagnostics on a fitted mixed model |
compute_diagnostics | function | Compute model-level diagnostics as a single-row DataFrame |
compute_metadata | function | Compute model metadata as a single-row DataFrame |
compute_optimizer_diagnostics | function | Compute optimizer convergence diagnostics as a single-row DataFrame |
compute_predictions_from_formula | function | Parse a predict formula, build the grid, compute predictions, and attach grid... |
compute_r_squared | function | Compute R-squared and adjusted R-squared from raw arrays |
compute_varying_spread_state | function | Compute VaryingSpreadState (variance components) from theta parameters |
compute_varying_state | function | Compute VaryingState (BLUPs) from fitted random effects parameters |
execute_fit | function | Execute the full fit lifecycle: bundle rebuild → fit → post-fit state → diagn... |
fit_glm_irls | function | Fit generalized linear model using Iteratively Reweighted Least Squares |
fit_glmer_pirls | function | Fit generalized linear mixed model using Penalized IRLS |
fit_lmer_pls | function | Fit linear mixed-effects model using Penalized Least Squares |
fit_model | function | Dispatch to appropriate fitter based on model specification |
fit_ols_qr | function | Fit ordinary or weighted least squares using QR decomposition |
get_theta_lower_bounds | function | Get lower bounds for theta parameters |
parse_fit_kwargs | function | Validate and extract fitting parameters from **kwargs |
parse_predict_formula | function | Parse an explore-style formula and build a prediction grid |
per_factor_re_info | function | Split global RE metadata into per-factor structures and names |
resolve_condition_values | function | Resolve a :class:Condition to concrete values or None |
resolve_solver | function | Select the appropriate solver for a model configuration |
validate_fit_method | function | Validate and apply a user-specified fitting method to a ModelSpec |
formula¶
| Name | Kind | Description |
|---|---|---|
DesignResult | class | Output of build_design_matrices(). Separates arrays from metadata |
FormulaError | class | Exception raised for formula parsing errors |
TermResult | class | Result of evaluating one formula term |
build_design_matrices | function | Build X and y matrices from a parsed formula spec |
build_random_effects_from_spec | function | Build random effects design matrix from FormulaSpec |
evaluate_newdata | module | Newdata evaluation — apply learned encoding to new observations |
expand_double_verts | function | Expand || syntax into separate uncorrelated random effects terms |
expand_nested_syntax | function | Expand nested / syntax into separate crossed random effects terms |
parse_formula | function | Parse formula and detect categoricals from data |
infer¶
| Name | Kind | Description |
|---|---|---|
InferResult | class | Immutable result of inference dispatch |
augment_spread_with_profile_ci | function | Augment variance components with profile likelihood confidence intervals |
build_emm_reference_grid | function | Build reference grid X matrix for EMM computation |
compute_bootstrap_params | function | Generate bootstrap distribution of coefficient estimates |
compute_bootstrap_pvalue | function | Compute bootstrap p-values |
compute_cv_metrics | function | Compute k-fold or leave-one-out cross-validation metrics |
compute_jackknife_coefs | function | Compute leave-one-out jackknife coefficient estimates |
compute_mee_bootstrap | function | Compute bootstrap inference for marginal effects |
compute_mee_permutation | function | Compute permutation-based inference for marginal effects |
compute_params_asymptotic | function | Compute asymptotic (Wald) inference for model parameters |
compute_params_bootstrap | function | Compute bootstrap inference for parameters |
compute_params_bootstrap_mixed | function | Compute bootstrap inference for mixed model parameters |
compute_params_cv_inference | function | Compute CV-based parameter importance via ablation |
compute_params_permutation | function | Compute permutation-based inference for model parameters |
compute_prediction_asymptotic | function | Compute asymptotic inference for predictions via delta method |
compute_prediction_bootstrap | function | Compute bootstrap inference for predictions |
compute_profile_inference | function | Compute profile likelihood CIs for variance components |
compute_satterthwaite_emm_df | function | Compute Satterthwaite denominator df for EMM contrast rows |
compute_simulation_inference | function | Compute inference for simulations |
dispatch_infer | function | Dispatch inference to the correct backend based on method and last operation |
dispatch_mee_inference | function | Dispatch marginal effects inference to the appropriate method |
dispatch_params_inference | function | Dispatch parameter inference to the appropriate method |
dispatch_prediction_inference | function | Dispatch prediction inference to the appropriate method |
generate_group_kfold_splits | function | Generate group-aware k-fold cross-validation indices |
generate_kfold_splits | function | Generate k-fold cross-validation train/test indices |
marginal¶
| Name | Kind | Description |
|---|---|---|
Condition | class | A conditioning specification in explore formula |
ExploreFormulaError | class | Error in explore formula syntax |
ExploreFormulaSpec | class | Parsed explore formula |
ResolvedConditions | class | Typed buckets for resolved conditioning specifications |
apply_bracket_contrasts | function | Apply bracket contrast expression to an EMM MeeState |
apply_bracket_contrasts_grouped | function | Apply bracket contrasts within each condition group of a crossed MeeState |
apply_contrasts | function | Apply contrast matrix to marginal means/effects |
apply_contrasts_grouped | function | Apply contrasts within each condition group of a crossed MeeState |
apply_rhs_bracket_contrast | function | Apply a bracket contrast on a RHS condition column |
build_all_pairwise_matrix | function | Build all pairwise contrasts between EMM levels |
build_bracket_contrast_matrix | function | Build contrast matrix and labels from bracket contrast expression |
build_contrast_matrix | function | Build a contrast matrix based on contrast type |
build_helmert_matrix | function | Build Helmert contrasts (each level vs mean of previous levels) |
build_pairwise_matrix | function | Build (n-1) linearly independent pairwise contrasts |
build_poly_matrix | function | Build orthogonal polynomial contrast matrix for EMMs |
build_reference_grid | function | Construct reference grid for marginal effects evaluation |
build_sequential_matrix | function | Build sequential (successive differences) contrasts |
build_sum_to_zero_matrix | function | Build sum-to-zero contrasts (deviation coding) |
build_treatment_matrix | function | Build treatment (Dunnett-style) contrasts against a reference level |
combine_resolved | function | Merge two ResolvedConditions, with b taking precedence on conflicts |
compose_contrast_matrix | function | Compose contrast matrix with prediction matrix |
compute_compound_bracket_contrasts | function | Compute bracket contrasts for a compound focal variable |
compute_conditional_emm | function | Compute per-group conditional EMMs incorporating intercept BLUPs |
compute_conditional_slopes | function | Compute per-group conditional slopes incorporating BLUPs |
compute_contrasts | function | Apply contrast matrix to EMMs |
compute_emm | function | Compute estimated marginal means for a categorical focal variable |
compute_joint_test | function | Compute joint hypothesis tests for model terms |
compute_mee_inference | function | Compute delta method inference for marginal effects |
compute_mee_inference_fallback | function | Compute inference for MEE without L_matrix (fallback path) |
compute_mee_se | function | Compute standard errors for MEE estimates (means or slopes) |
compute_slopes | function | Compute marginal slope for a continuous focal variable |
compute_slopes_crossed | function | Compute crossed slopes over focal variable x condition grid |
compute_slopes_finite_diff | function | Compute marginal slopes via centered finite differences |
dispatch_marginal_computation | function | Route a parsed explore formula to the appropriate marginal computation |
get_contrast_labels | function | Generate human-readable labels for contrasts |
parse_explore_formula | function | Parse an explore formula string |
resolve_conditions | function | Classify each Condition into the appropriate typed bucket |
rendering¶
| Name | Kind | Description |
|---|---|---|
build_equation | function | Build a structural LaTeX equation from model containers |
dataframe_to_markdown | function | Convert a Polars DataFrame to a pipe-delimited markdown table |
equation_to_markdown | function | Wrap a LaTeX equation in display math delimiters for Quarto |
to_markdown | function | Convert a Polars DataFrame to a markdown table, optionally saving to file |
write_text | function | Write text content to a file, creating parent directories |
simulation¶
| Name | Kind | Description |
|---|---|---|
MonteCarloResult | class | Results from a Monte Carlo simulation study |
SimulateResult | class | Immutable result of the simulate lifecycle |
bias | function | Compute bias: E[beta_hat] - beta_true |
compute_mc_iteration | function | Execute a single Monte Carlo iteration |
compute_mu_with_new_re | function | Compute conditional mean with newly sampled random effects |
compute_wilson_ci | function | Wilson score confidence interval for a binomial proportion |
coverage | function | Compute coverage probability |
empirical_se | function | Compute empirical standard error (SD of estimates) |
execute_simulate | function | Execute simulation: power analysis, post-fit sampling, or pre-fit generation |
expand_sweep_grid | function | Full factorial grid from base DGP + power sweep overrides |
generate_data_from_spec | function | Generate a synthetic dataset from a simulation specification |
generate_glm_data | function | Generate GLM data with known parameters |
generate_glmer_data | function | Generate GLMM data with known parameters |
generate_lm_data | function | Generate linear model data with known parameters |
generate_lmer_data | function | Generate linear mixed model data with known parameters |
mean_se | function | Compute mean of standard errors across simulations |
rejection_rate | function | Compute rejection rate (proportion of p-values < alpha) |
rmse | function | Compute root mean squared error |
run_monte_carlo | function | Run a Monte Carlo simulation study |
run_power_analysis | function | Run simulation-based power analysis for a model formula |
run_power_study | function | Run power analysis across a sweep grid |
simulate_responses_from_fit | function | Simulate new responses from a fitted model |
maths¶
backend¶
| Name | Kind | Description |
|---|---|---|
ArrayOps | class | Protocol for array operations across backends |
BackendName | attribute | |
backend | function | Context manager for temporary backend switching |
clear_ops_cache | function | Clear the backend operations cache |
get_backend | function | Get the current backend name |
get_ops | function | Get array operations for the current backend |
lock_backend | function | Lock the backend to prevent switching after model fitting |
reset_backend | function | Reset backend state (for testing only) |
set_backend | function | Set the backend to use for computations |
batching¶
| Name | Kind | Description |
|---|---|---|
compute_batch_size | function | Compute optimal batch size for jax.lax.map |
get_available_memory_gb | function | Query available system memory in GB |
config¶
| Name | Kind | Description |
|---|---|---|
get_display_digits | function | Get the number of significant figures for DataFrame display output |
get_singular_tolerance | function | Get the current singular tolerance for mixed models |
is_singular | function | Check whether a mixed model fit is singular |
set_display_digits | function | Set the number of significant figures for DataFrame display output |
set_singular_tolerance | function | Set the global singular tolerance for mixed models |
convergence¶
| Name | Kind | Description |
|---|---|---|
ConvergenceMessage | class | A convergence diagnostic message with technical and user-friendly parts |
diagnose_convergence | function | Analyze model convergence state and generate diagnostic messages |
format_convergence_warnings | function | Format convergence messages for display as warning text |
differentiation¶
| Name | Kind | Description |
|---|---|---|
compute_gradient_richardson | function | Compute gradient using Richardson extrapolation |
compute_hessian_numerical | function | Compute Hessian using central finite differences |
compute_hessian_richardson | function | Compute Hessian using Richardson extrapolation with genD method |
compute_jacobian_numerical | function | Compute Jacobian using central finite differences |
compute_jacobian_richardson | function | Compute Jacobian using Richardson extrapolation |
distributions¶
| Name | Kind | Description |
|---|---|---|
ConvolvedDistribution | class | Distribution representing the sum of two independent random variables |
Distribution | class | Wrapper for scipy.stats distributions with visualization |
FoldedDistribution | class | Distribution of |X| - the absolute value of X |
Probability | class | Rich probability result from distribution queries |
TransformedDistribution | class | Distribution resulting from an affine transformation: Y = scale*X + shift |
TruncatedDistribution | class | Distribution truncated to an interval [low, high] |
beta | function | Beta distribution |
binomial | function | Binomial distribution |
chi2 | function | Chi-squared distribution |
exponential | function | Exponential distribution (rate parameterization) |
f_dist | function | F distribution |
figure_to_html | function | Convert matplotlib figure to base64-encoded HTML img tag |
gamma | function | Gamma distribution |
normal | function | Normal (Gaussian) distribution |
poisson | function | Poisson distribution |
t | function | Student’s t distribution (location-scale parameterization) |
t_dist | function | Student’s t distribution |
uniform | function | Uniform distribution |
family¶
| Name | Kind | Description |
|---|---|---|
CANONICAL_LINKS | attribute | |
ESTIMATED_DISPERSION_FAMILIES | attribute | |
Family | class | Family configuration for GLM fitting |
LINK_FUNCTIONS | attribute | |
apply_link | function | Apply link function by name: η = g(μ) |
apply_link_deriv | function | Apply link function derivative by name: dη/dμ |
apply_link_inverse | function | Apply inverse link function by name: μ = g⁻¹(η) |
binomial | module | Binomial family functions for GLM fitting |
binomial_deviance | function | Binomial unit deviance: d(y, μ) = 2[y log(y/μ) + (1-y) log((1-y)/(1-μ))] |
binomial_dispersion | function | Dispersion parameter for binomial family |
binomial_initialize | function | Initialize μ for binomial family |
binomial_loglik | function | Binomial conditional log-likelihood (per observation) |
binomial_variance | function | Binomial variance function: V(μ) = μ(1-μ) |
build_family | function | Create a Family object from family and link names |
cloglog_link | function | Complementary log-log link function: η = log(-log(1-μ)) |
cloglog_link_deriv | function | Cloglog link derivative: dη/dμ = 1/((1-μ) * (-log(1-μ))) |
cloglog_link_inverse | function | Cloglog inverse link: μ = 1 - exp(-exp(η)) |
gamma | module | Gamma family functions for GLM fitting |
gamma_deviance | function | Gamma unit deviance: d(y, μ) = 2[-log(y/μ) + (y - μ)/μ] |
gamma_dispersion | function | Estimate dispersion parameter for Gamma family |
gamma_initialize | function | Initialize μ for Gamma family |
gamma_loglik | function | Gamma conditional log-likelihood (per observation) |
gamma_variance | function | Gamma variance function: V(μ) = μ² |
gaussian | module | Gaussian family functions for GLM fitting |
gaussian_deviance | function | Gaussian unit deviance: d(y, μ) = (y - μ)² |
gaussian_dispersion | function | Estimate dispersion parameter for Gaussian family |
gaussian_initialize | function | Initialize μ for Gaussian family |
gaussian_loglik | function | Gaussian conditional log-likelihood (per observation) |
gaussian_variance | function | Gaussian variance function: V(μ) = 1 |
identity_link | function | Identity link function: η = μ |
identity_link_deriv | function | Identity link derivative: dη/dμ = 1 |
identity_link_inverse | function | Identity inverse link: μ = η |
inverse_link | function | Inverse link function: η = 1/μ |
inverse_link_deriv | function | Inverse link derivative: dη/dμ = -1/μ² |
inverse_link_inverse | function | Inverse link inverse: μ = 1/η |
log_link | function | Log link function: η = log(μ) |
log_link_deriv | function | Log link derivative: dη/dμ = 1/μ |
log_link_inverse | function | Log inverse link: μ = exp(η) |
logit_link | function | Logit link function: η = log(μ/(1-μ)) |
logit_link_deriv | function | Logit link derivative: dη/dμ = 1/(μ(1-μ)) |
logit_link_inverse | function | Logit inverse link: μ = 1/(1 + exp(-η)) |
poisson | module | Poisson family functions for GLM fitting |
poisson_deviance | function | Poisson unit deviance: d(y, μ) = 2[y log(y/μ) - (y - μ)] |
poisson_dispersion | function | Dispersion parameter for Poisson family |
poisson_initialize | function | Initialize μ for Poisson family |
poisson_loglik | function | Poisson conditional log-likelihood (per observation) |
poisson_variance | function | Poisson variance function: V(μ) = μ |
probit_link | function | Probit link function: η = Φ⁻¹(μ) |
probit_link_deriv | function | Probit link derivative: dη/dμ = 1/φ(Φ⁻¹(μ)) |
probit_link_inverse | function | Probit inverse link: μ = Φ(η) |
resolve_sigma | function | Resolve optional sigma to a concrete float |
sample_response | function | Sample response values from a GLM family distribution |
tdist | module | Student-t family functions for robust GLM fitting |
tdist_deviance | function | Placeholder - use tdist(df=...) factory to get proper function |
tdist_dispersion | function | Estimate dispersion (scale) parameter for Student-t family |
tdist_initialize | function | Initialize μ for Student-t family |
tdist_loglik | function | Placeholder - use tdist(df=...) factory to get proper function |
tdist_robust_weights | function | Placeholder - use tdist(df=...) factory to get proper function |
tdist_variance | function | Student-t variance function: V(μ) = 1 |
inference¶
| Name | Kind | Description |
|---|---|---|
CellInfo | class | Information about factor cells for Welch-style inference |
Chi2TestResult | class | Result container for chi-square test |
FTestResult | class | Result container for F-test |
InferenceResult | class | Results from coefficient inference computation |
MixedModelProtocol | class | Protocol for mixed-effects models compatible with profile likelihood |
TTestResult | class | Result container for t-test |
adjust_pvalues | function | Adjust p-values for multiple comparisons |
build_cholesky_with_derivs | function | Build Cholesky factor L and its derivatives w.r.t. theta |
compute_aic | function | Compute Akaike Information Criterion |
compute_akaike_weights | function | Compute Akaike weights from information criterion values |
compute_bic | function | Compute Bayesian Information Criterion |
compute_cell_info | function | Compute cell-based variance information for Welch inference |
compute_chi2_test | function | Compute Wald chi-square test for L @ β = 0 |
compute_ci | function | Compute confidence interval bounds |
compute_coefficient_inference | function | Compute inference statistics for regression coefficients |
compute_contrast_variance | function | Compute variance-covariance of linear contrasts L @ β |
compute_cooks_distance | function | Compute Cook’s distance for influence |
compute_cr_vcov | function | Compute cluster-robust covariance matrix for Gaussian mixed models |
compute_deviance | function | Compute deviance from log-likelihood |
compute_f_pvalue | function | Compute p-value from F-statistic |
compute_f_test | function | Compute F-test for linear hypothesis L @ β = 0 |
compute_glm_cr_vcov | function | Compute cluster-robust covariance matrix for non-Gaussian mixed models |
compute_glm_hc_vcov | function | Compute heteroscedasticity-consistent covariance matrix for GLM |
compute_hc_vcov | function | Compute heteroscedasticity-consistent covariance matrix |
compute_leverage | function | Compute diagonal of hat matrix (leverage values) |
compute_mvt_critical | function | Compute multivariate-t critical value for simultaneous inference |
compute_pvalue | function | Compute p-values from test statistics |
compute_satterthwaite_df | function | Compute Satterthwaite degrees of freedom for each fixed effect |
compute_satterthwaite_summary_table | function | Compute full coefficient table with Satterthwaite df and p-values |
compute_satterthwaite_t_test | function | Compute t-statistics, p-values, and confidence intervals |
compute_sd_jacobian | function | Compute SDs and Jacobian of SDs w.r.t. varpar = [theta, sigma] |
compute_se_from_vcov | function | Compute standard errors from variance-covariance matrix |
compute_sigma_se_wald | function | Compute Wald standard error for sigma |
compute_studentized_residuals | function | Compute internally studentized (standardized) residuals |
compute_t_critical | function | Compute t-distribution critical value for confidence interval |
compute_t_test | function | Compute t-test for a single contrast L @ β = 0 |
compute_tukey_critical | function | Compute Tukey HSD critical value for pairwise comparisons |
compute_vif | function | Compute variance inflation factors |
compute_wald_ci_varying | function | Compute Wald CIs for variance components on SD scale |
compute_wald_statistic | function | Compute Wald statistic for testing L @ β = 0 |
compute_welch_satterthwaite_df_per_coef | function | Compute per-coefficient Welch-Satterthwaite degrees of freedom |
compute_z_critical | function | Compute z-distribution critical value for confidence interval |
convert_theta_ci_to_sd | function | Convert theta-scale CIs to SD-scale CIs |
delta_method_se | function | Compute standard errors for predictions via delta method |
extract_ci_bound | function | Extract CI bound by finding where spline equals target zeta |
extract_factors_from_formula | function | Extract factor (categorical) column names from a model formula |
format_pvalue_with_stars | function | Format p-value with R-style significance codes |
parse_conf_int | function | Parse flexible confidence interval input to float |
profile_likelihood | function | Compute profile likelihood confidence intervals for variance components |
profile_theta_parameter | function | Profile a single theta parameter bidirectionally from its MLE |
satterthwaite_df_for_contrasts | function | Compute Satterthwaite degrees of freedom for arbitrary contrasts |
linalg¶
| Name | Kind | Description |
|---|---|---|
CHOLMODFactorization | class | Wrapper around CHOLMOD sparse Cholesky factorization |
QRSolveResult | class | Result container for QR solve |
SPLUFactorization | class | Wrapper around scipy.sparse.linalg.splu factorization |
SVDSolveResult | class | Result container for SVD solve |
SparseFactorization | class | Abstract base class for sparse matrix factorization |
compute_sparse_cholesky | function | Factor a sparse symmetric positive definite matrix |
compute_vcov_schur_sparse | function | Compute variance-covariance matrix of fixed effects via Schur complement |
detect_rank_deficiency | function | Detect rank deficiency in a design matrix via pivoted QR |
qr_solve | function | Solve least squares via pivoted QR decomposition |
qr_solve_jax | function | Solve least squares via pivoted QR decomposition (returns backend arrays) |
svd_solve | function | Solve least squares via SVD (handles rank deficiency) |
svd_solve_jax | function | Solve least squares via SVD (returns backend arrays) |
predict¶
| Name | Kind | Description |
|---|---|---|
fill_valid | function | Fill valid positions in result array with computed values |
get_valid_rows | function | Identify valid (non-NA) rows in a design matrix |
init_na_array | function | Create an array of NaN values |
rng¶
| Name | Kind | Description |
|---|---|---|
RNG | class | Unified RNG wrapper for JAX and NumPy backends |
build_rng | function | Create RNG from seed (convenience function) |
rounding¶
| Name | Kind | Description |
|---|---|---|
round_float_columns | function | Round all Float64 columns to digits significant figures |
round_sigfigs | function | Round array values to n significant figures |
solvers¶
| Name | Kind | Description |
|---|---|---|
LambdaTemplate | class | Template for efficient Lambda matrix updates during optimization |
PLSInvariants | class | Pre-computed quantities that don’t change during theta optimization |
PatternTemplate | class | Template for preserving sparsity patterns across theta evaluations |
apply_sqrt_weights | function | Apply sqrt(weights) transformation to design matrices and response |
build_lambda_sparse | function | Build sparse block-diagonal Lambda matrix from theta |
build_lambda_template | function | Build a Lambda template for efficient repeated updates |
compute_agq_deviance | function | Compute AGQ deviance for Stage 2 optimization |
compute_irls_quantities | function | Compute IRLS working weights and working response |
compute_pls_invariants | function | Pre-compute quantities that are constant during optimization |
fit_glm_irls | function | Fit GLM using IRLS algorithm |
fit_glmm_pirls | function | Fit GLMM using PIRLS with outer optimization over theta |
glmm_deviance | function | Compute GLMM deviance via Laplace approximation |
glmm_deviance_objective | function | Compute GLMM deviance for outer optimization |
lmm_deviance_sparse | function | Compute LMM deviance for optimization |
optimize_theta | function | Optimize theta using BOBYQA via NLOPT |
pirls_sparse | module | Sparse PIRLS (Penalized Iteratively Reweighted Least Squares) core routines |
solve_pls_sparse | function | Solve Penalized Least Squares system using Schur complement |
solve_weighted_pls_sparse | function | Solve weighted Penalized Least Squares for GLMM |
theta_to_cholesky_block | function | Convert theta vector to lower-triangular Cholesky block |
update_lambda_from_template | function | Update Lambda matrix from template using new theta values |
tolerances¶
| Name | Kind | Description |
|---|---|---|
DEFAULT_SAFETY | attribute | |
EPS | attribute | |
MAX_COND | attribute | |
MAX_COND_INVERSE | attribute | |
algorithm_comparison_atol | function | Absolute tolerance for comparing different algorithms |
algorithm_comparison_rtol | function | Relative tolerance for comparing different algorithms |
decomposition_atol | function | Absolute tolerance for decomposition properties |
fitted_atol | function | Absolute tolerance for fitted value comparisons |
glm_score_atol | function | Absolute tolerance for GLM score equation checks |
has_full_rank | function | Check if matrix has full column rank |
hat_matrix_atol | function | Absolute tolerance for hat matrix property checks |
inference_atol | function | Absolute tolerance for inference result comparisons |
is_well_conditioned | function | Check if matrix is well-conditioned for stable computation |
orthogonality_atol | function | Absolute tolerance for orthogonality checks |
residual_atol | function | Absolute tolerance for residual orthogonality checks |
solve_atol | function | Absolute tolerance for linear solve operations |
solve_rtol | function | Relative tolerance for linear solve operations |
transforms¶
| Name | Kind | Description |
|---|---|---|
Center | class | Mean-centering transform: x - mean(x) |
Norm | class | Normalization transform: x / std(x) |
Rank | class | Average-method rank transform: rank(x) |
STATEFUL_TRANSFORMS | attribute | |
Scale | class | Gelman scaling transform: (x - mean(x)) / (2 * std(x)) |
SignedRank | class | Signed-rank transform: sign(x) * rank(|x|) |
StatefulTransform | class | Base class for stateful transforms |
TransformState | class | Container for captured transform parameters |
Zscore | class | Z-score transform: (x - mean(x)) / std(x) |
build_transform | function | Create a stateful transform instance by name |
variance¶
| Name | Kind | Description |
|---|---|---|
theta_to_variance_components | function | Convert theta parameters to named variance components |
weights¶
| Name | Kind | Description |
|---|---|---|
WeightInfo | class | Metadata for weights derived from factor columns |
compute_inverse_variance_weights | function | Compute inverse-variance weights from a factor column |
detect_weight_type | function | Check if a column is categorical (should use inverse-variance weights) |
viz¶
viz¶
| Name | Kind | Description |
|---|---|---|
BOSSANOVA_STYLE | attribute | |
compute_figsize | function | Compute figure size based on number of items |
compute_grid_figsize | function | Compute figure size for grid/subplot layouts |
extract_params | function | Extract parameter estimates from a fitted model |
extract_residuals | function | Extract residual diagnostics from a fitted model |
get_model_fitted | function | Extract fitted values from model, supporting both APIs |
get_model_formula | function | Extract formula string from model, supporting both old and new API |
get_model_params | function | Extract parameter estimates from model, supporting both APIs |
get_model_residuals | function | Extract residuals from model, supporting both APIs |
get_model_response | function | Extract response variable name from model, supporting both APIs |
is_unified_model | function | Check if model is the new unified model() class (or proxy) |
plot_compare | function | Compare coefficients across multiple fitted models |
plot_design | function | Plot design matrix as an annotated heatmap |
plot_explore | function | Plot marginal estimated effects |
plot_params | function | Plot fixed effect estimates as a forest plot |
plot_predict | function | Plot marginal predictions across a predictor’s range |
plot_profile | function | Plot profile likelihood curves |
plot_ranef | function | Plot random effects as a caterpillar plot |
plot_relationships | function | Plot pairwise relationships between response and predictors |
plot_resamples | function | Plot distribution of resampled statistics |
plot_resid | function | Plot residual diagnostics as a faceted grid |
plot_vif | function | Plot VIF diagnostics as correlation heatmap |