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 estimating equations but 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.

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

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

regression_predictions(X, theta, covariance)

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

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.

Differentiation

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

Numerical approximation to compute the gradient.

auto_differentiation(xk, f)

Forward-mode automatic differentiation.