Input-Output iolib

Input-Output iolib statsmodels offers some functions for input and output. These include a reader for STATA files, a class for generating tables for printing in several formats and two helper functions for pickling. Users can also leverage the powerful input/output functions provided by pandas.io. Among other things, pandas (a statsmodels dependency) allows reading and writing to Excel, CSV, and HDF5 (PyTables). Examples SimpleTable: Basic example Module Reference foreign.StataReader(f

MixedLM.hessian_sqrt()

statsmodels.regression.mixed_linear_model.MixedLM.hessian_sqrt MixedLM.hessian_sqrt(params) [source] Returns the Hessian matrix of the log-likelihood evaluated at a given point, calculated with respect to the parameterization in which the random effects covariance matrix is represented through its Cholesky square root. Parameters: params : MixedLMParams or array-like The model parameters. If array-like, must contain packed parameters that are compatible with this model. Returns: The Hes

ArmaProcess.invertroots()

statsmodels.tsa.arima_process.ArmaProcess.invertroots ArmaProcess.invertroots(retnew=False) [source] make MA polynomial invertible by inverting roots inside unit circle Parameters: retnew : boolean If False (default), then return the lag-polynomial as array. If True, then return a new instance with invertible MA-polynomial Returns: manew : array new invertible MA lag-polynomial, returned if retnew is false. wasinvertible : boolean True if the MA lag-polynomial was already invertible,

PHRegResults.remove_data()

statsmodels.duration.hazard_regression.PHRegResults.remove_data PHRegResults.remove_data() remove data arrays, all nobs arrays from result and model This reduces the size of the instance, so it can be pickled with less memory. Currently tested for use with predict from an unpickled results and model instance. Warning Since data and some intermediate results have been removed calculating new statistics that require them will raise exceptions. The exception will occur the first time an attrib

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

Logit.pdf()

statsmodels.discrete.discrete_model.Logit.pdf Logit.pdf(X) [source] The logistic probability density function Parameters: X : array-like X is the linear predictor of the logit model. See notes. Returns: pdf : ndarray The value of the Logit probability mass function, PMF, for each point of X. np.exp(-x)/(1+np.exp(-X))**2 Notes In the logit model,

OLS.from_formula()

statsmodels.regression.linear_model.OLS.from_formula classmethod OLS.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 : extra a

IVGMM.fitgmm_cu()

statsmodels.sandbox.regression.gmm.IVGMM.fitgmm_cu IVGMM.fitgmm_cu(start, optim_method='bfgs', optim_args=None) estimate parameters using continuously updating GMM Parameters: start : array_like starting values for minimization Returns: paramest : array estimated parameters Notes todo: add fixed parameter option, not here ??? uses scipy.optimize.fmin

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. :

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 :