Utilities

For manipulation of output or inputs, there are several basic utility functionalities for transformation of variables, predicted parameters, or computations. Some are used internally by the built-in estimating equations but these methods are also made available to users.

Data transformations

logit(prob)

Logistic transformation.

inverse_logit(logodds)

Inverse logistic transformation.

identity(value)

Identity transformation.

robust_loss_functions(residual, loss, k[, a, b])

Loss functions for robust mean and robust regression estimating equations.

aggregate_efuncs(est_funcs, group)

Aggregate estimating function contributions from the individual-level to the specified group-level.

spline(variable, knots[, power, restricted, ...])

Generate generic polynomial spline terms for a given NumPy array and pre-specified knots.

polygamma(n, x)

Polygamma function.

digamma(z)

Digamma function.

standard_normal_cdf(x)

Cumulative distribution function for the standard normal distribution.

standard_normal_pdf(x)

Probability density function for the standard normal distribution.

Design matrices

additive_design_matrix(X, specifications[, ...])

Generate an additive design matrix for generalized additive models (GAM) given a set of spline specifications to apply.

Model predictions

regression_predictions(X, theta, covariance)

Generate predicted values of the outcome given a design matrix, point estimates, and covariance matrix.

aft_predictions_individual(X, times, theta, ...)

Compute predicted survival analysis measures from an accelerated failure time (AFT) model for given a design matrix and times.

aft_predictions_function(X, times, theta, ...)

Compute estimated functions for survival analysis measures from an accelerated failure time (AFT) model across a specified time period.

plogit_predict(theta, t, delta, X[, S, ...])

Compute predicted survival analysis measures from a pooled logistic regression model for given a design matrix and times.

Differentiation

approx_differentiation(xk, f[, epsilon, method])

Numerical approximation to compute the gradient.

auto_differentiation(xk, f)

Forward-mode automatic differentiation.

Variance Estimators

compute_sandwich(stacked_equations, theta[, ...])

Compute the empirical sandwich variance estimator for a given set of estimating equations and parameter estimates.

delta_method(theta, g, covariance[, ...])

Function to apply the Delta Method for a given parameter vector and transformation.