4.7.14. statsmodels.tools.tools

Utility functions models code

4.7.14.1. Functions

add_constant(data[, prepend, has_constant]) This appends a column of ones to an array if prepend==False.
categorical(data[, col, dictnames, drop]) Returns a dummy matrix given an array of categorical variables.
chain_dot(*arrs) Returns the dot product of the given matrices.
clean0(matrix) Erase columns of zeros: can save some time in pseudoinverse.
drop_missing(Y[, X, axis]) Returns views on the arrays Y and X where missing observations are dropped.
fullrank(X[, r]) Return a matrix whose column span is the same as X.
isestimable(C, D) True if (Q, P) contrast C is estimable for (N, P) design D
maybe_unwrap_results(results) Gets raw results back from wrapped results.
monotone_fn_inverter(fn, x[, vectorized]) Given a monotone function x (no checking is done to verify monotonicity) and a set of x values, return an linearly interpolated approximation to its inverse from its values on x.
nan_dot(A, B) Returns np.dot(left_matrix, right_matrix) with the convention that nan * 0 = 0 and nan * x = nan if x != 0.
pinv_extended(X[, rcond]) Return the pinv of an array X as well as the singular values used in computation.
rank(X[, cond]) Return the rank of a matrix X based on its generalized inverse, not the SVD.
recipr(X) Return the reciprocal of an array, setting all entries less than or equal to 0 to 0.
recipr0(X) Return the reciprocal of an array, setting all entries equal to 0 as 0.
unsqueeze(data, axis, oldshape) Unsqueeze a collapsed array

4.7.14.2. Classes

Bunch(**kw) Returns a dict-like object with keys accessible via attribute lookup.
ECDF(x[, side]) Return the Empirical CDF of an array as a step function.
StepFunction(x, y[, ival, sorted, side]) A basic step function.