tools.tools.monotone_fn_inverter()

statsmodels.tools.tools.monotone_fn_inverter statsmodels.tools.tools.monotone_fn_inverter(fn, x, vectorized=True, **keywords) 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.

tools.tools.isestimable()

statsmodels.tools.tools.isestimable statsmodels.tools.tools.isestimable(C, D) [source] True if (Q, P) contrast C is estimable for (N, P) design D From an Q x P contrast matrix C and an N x P design matrix D, checks if the contrast C is estimable by looking at the rank of vstack([C,D]) and verifying it is the same as the rank of D. Parameters: C : (Q, P) array-like contrast matrix. If C has is 1 dimensional assume shape (1, P) D: (N, P) array-like : design matrix Returns: tf : bool Tr

tools.tools.fullrank()

statsmodels.tools.tools.fullrank statsmodels.tools.tools.fullrank(X, r=None) [source] Return a matrix whose column span is the same as X. If the rank of X is known it can be specified as r ? no check is made to ensure that this really is the rank of X.

tools.tools.ECDF()

statsmodels.tools.tools.ECDF class statsmodels.tools.tools.ECDF(x, side='right') Return the Empirical CDF of an array as a step function. Parameters: x : array-like Observations side : {?left?, ?right?}, optional Default is ?right?. Defines the shape of the intervals constituting the steps. ?right? correspond to [a, b) intervals and ?left? to (a, b]. Returns: Empirical CDF as a step function. : Examples >>> import numpy as np >>> from statsmodels.distributions.empir

tools.tools.clean0()

statsmodels.tools.tools.clean0 statsmodels.tools.tools.clean0(matrix) [source] Erase columns of zeros: can save some time in pseudoinverse.

tools.tools.categorical()

statsmodels.tools.tools.categorical statsmodels.tools.tools.categorical(data, col=None, dictnames=False, drop=False) [source] Returns a dummy matrix given an array of categorical variables. Parameters: data : array A structured array, recarray, or array. This can be either a 1d vector of the categorical variable or a 2d array with the column specifying the categorical variable specified by the col argument. col : ?string?, int, or None If data is a structured array or a recarray, col can

tools.tools.add_constant()

statsmodels.tools.tools.add_constant statsmodels.tools.tools.add_constant(data, prepend=True, has_constant='skip') [source] This appends a column of ones to an array if prepend==False. Parameters: data : array-like data is the column-ordered design matrix prepend : bool True and the constant is prepended rather than appended. has_constant : str {?raise?, ?add?, ?skip?} Behavior if ``data?? already has a constant. The default will return data without adding another constant. If ?raise?,

tools.numdiff.approx_hess_cs()

statsmodels.tools.numdiff.approx_hess_cs statsmodels.tools.numdiff.approx_hess_cs(x, f, epsilon=None, args=(), kwargs={}) [source] Calculate Hessian with complex-step derivative approximation Calculate Hessian with finite difference derivative approximation Parameters: x : array_like value at which function derivative is evaluated f : function function of one array f(x, *args, **kwargs) epsilon : float or array-like, optional Stepsize used, if None, then stepsize is automatically chose

tools.numdiff.approx_hess3()

statsmodels.tools.numdiff.approx_hess3 statsmodels.tools.numdiff.approx_hess3(x, f, epsilon=None, args=(), kwargs={}) [source] Calculate Hessian with finite difference derivative approximation Parameters: x : array_like value at which function derivative is evaluated f : function function of one array f(x, *args, **kwargs) epsilon : float or array-like, optional Stepsize used, if None, then stepsize is automatically chosen according to EPS**(1/4)*x. args : tuple Arguments for functio

tools.numdiff.approx_hess2()

statsmodels.tools.numdiff.approx_hess2 statsmodels.tools.numdiff.approx_hess2(x, f, epsilon=None, args=(), kwargs={}, return_grad=False) [source] Calculate Hessian with finite difference derivative approximation Parameters: x : array_like value at which function derivative is evaluated f : function function of one array f(x, *args, **kwargs) epsilon : float or array-like, optional Stepsize used, if None, then stepsize is automatically chosen according to EPS**(1/3)*x. args : tuple Ar