tools.numdiff.approx_fprime_cs()

statsmodels.tools.numdiff.approx_fprime_cs statsmodels.tools.numdiff.approx_fprime_cs(x, f, epsilon=None, args=(), kwargs={}) [source] Calculate gradient or Jacobian with complex step derivative approximation Parameters: x : array parameters at which the derivative is evaluated f : function f(*((x,)+args), **kwargs) returning either one value or 1d array epsilon : float, optional Stepsize, if None, optimal stepsize is used. Optimal step-size is EPS*x. See note. args : tuple Tuple of

stats.gof.gof_chisquare_discrete()

statsmodels.stats.gof.gof_chisquare_discrete statsmodels.stats.gof.gof_chisquare_discrete(distfn, arg, rvs, alpha, msg) [source] perform chisquare test for random sample of a discrete distribution Parameters: distname : string name of distribution function arg : sequence parameters of distribution alpha : float significance level, threshold for p-value Returns: result : bool 0 if test passes, 1 if test fails Notes originally written for scipy.stats test suite, still needs to be c

Autoregressive.covariance_matrix_solve()

statsmodels.genmod.cov_struct.Autoregressive.covariance_matrix_solve Autoregressive.covariance_matrix_solve(expval, index, stdev, rhs) [source] Solves matrix equations of the form covmat * soln = rhs and returns the values of soln, where covmat is the covariance matrix represented by this class. Parameters: expval: array-like : The expected value of endog for each observed value in the group. index: integer : The group index. stdev : array-like The standard deviation of endog for each

Gamma.loglike()

statsmodels.genmod.families.family.Gamma.loglike Gamma.loglike(endog, mu, scale=1.0) [source] Loglikelihood function for Gamma exponential family distribution. Parameters: endog : array-like Endogenous response variable mu : array-like Fitted mean response variable scale : float, optional The default is 1. Returns: llf : float The value of the loglikelihood function evaluated at (endog,mu,scale) as defined below. Notes llf = -1/scale * sum(endog/mu + log(mu) + (scale-1)*log(endog

tsa.filters.filtertools.convolution_filter()

statsmodels.tsa.filters.filtertools.convolution_filter statsmodels.tsa.filters.filtertools.convolution_filter(x, filt, nsides=2) [source] Linear filtering via convolution. Centered and backward displaced moving weighted average. Parameters: x : array_like data array, 1d or 2d, if 2d then observations in rows filt : array_like Linear filter coefficients in reverse time-order. Should have the same number of dimensions as x though if 1d and x is 2d will be coerced to 2d. nsides : int, opti

AR.score()

statsmodels.tsa.ar_model.AR.score AR.score(params) [source] Return the gradient of the loglikelihood at params. Parameters: params : array-like The parameter values at which to evaluate the score function. Notes Returns numerical gradient.

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

PHReg.fit()

statsmodels.duration.hazard_regression.PHReg.fit PHReg.fit(groups=None, **args) [source] Fit a proportional hazards regression model. Parameters: groups : array-like Labels indicating groups of observations that may be dependent. If present, the standard errors account for this dependence. Does not affect fitted values. Returns a PHregResults instance. :

GLMResults.load()

statsmodels.genmod.generalized_linear_model.GLMResults.load classmethod GLMResults.load(fname) load a pickle, (class method) Parameters: fname : string or filehandle fname can be a string to a file path or filename, or a filehandle. Returns: unpickled instance :

MNLogit.from_formula()

statsmodels.discrete.discrete_model.MNLogit.from_formula classmethod MNLogit.from_formula(formula, data, subset=None, *args, **kwargs) Create a Model from a formula and dataframe. Parameters: formula : str or generic Formula object The formula specifying the model data : array-like The data for the model. See Notes. subset : array-like An array-like object of booleans, integers, or index values that indicate the subset of df to use in the model. Assumes df is a pandas.DataFrame args :