static ARMAResults.bic()

statsmodels.tsa.arima_model.ARMAResults.bic static ARMAResults.bic() [source]

tsa.arima_process.lpol2index()

statsmodels.tsa.arima_process.lpol2index statsmodels.tsa.arima_process.lpol2index(ar) [source] remove zeros from lagpolynomial, squeezed representation with index Parameters: ar : array_like coefficients of lag polynomial Returns: coeffs : array non-zero coefficients of lag polynomial index : array index (lags) of lagpolynomial with non-zero elements

OLSResults.compare_lm_test()

statsmodels.regression.linear_model.OLSResults.compare_lm_test OLSResults.compare_lm_test(restricted, demean=True, use_lr=False) Use Lagrange Multiplier test to test whether restricted model is correct Parameters: restricted : Result instance The restricted model is assumed to be nested in the current model. The result instance of the restricted model is required to have two attributes, residual sum of squares, ssr, residual degrees of freedom, df_resid. demean : bool Flag indicating whe

PoissonZiGMLE.reduceparams()

statsmodels.miscmodels.count.PoissonZiGMLE.reduceparams PoissonZiGMLE.reduceparams(params)

Generalized Linear Models

Generalized Linear Models Link to Notebook GitHub In [1]: from __future__ import print_function import numpy as np import statsmodels.api as sm from scipy import stats from matplotlib import pyplot as plt GLM: Binomial response data Load data In this example, we use the Star98 dataset which was taken with permission from Jeff Gill (2000) Generalized linear models: A unified approach. Codebook information can be obtained by typing: In [2]: print(sm.datasets.star98.NOTE)

iolib.foreign.StataReader()

statsmodels.iolib.foreign.StataReader class statsmodels.iolib.foreign.StataReader(fname, missing_values=False, encoding=None) [source] Stata .dta file reader. Provides methods to return the metadata of a Stata .dta file and a generator for the data itself. Parameters: file : file-like A file-like object representing a Stata .dta file. missing_values : bool If missing_values is True, parse missing_values and return a Missing Values object instead of None. encoding : string, optional Use

GLM.hessian_factor()

statsmodels.genmod.generalized_linear_model.GLM.hessian_factor GLM.hessian_factor(params, scale=None, observed=True) [source] Weights for calculating Hessian Parameters: params : ndarray parameter at which Hessian is evaluated scale : None or float If scale is None, then the default scale will be calculated. Default scale is defined by self.scaletype and set in fit. If scale is not None, then it is used as a fixed scale. observed : bool If True, then the observed Hessian is returned. I

MixedLMResults.conf_int()

statsmodels.regression.mixed_linear_model.MixedLMResults.conf_int MixedLMResults.conf_int(alpha=0.05, cols=None, method='default') Returns the confidence interval of the fitted parameters. Parameters: alpha : float, optional The significance level for the confidence interval. ie., The default alpha = .05 returns a 95% confidence interval. cols : array-like, optional cols specifies which confidence intervals to return method : string Not Implemented Yet Method to estimate the confidence

Regression Diagnostics and Specification Tests

Regression Diagnostics and Specification Tests Introduction In many cases of statistical analysis, we are not sure whether our statistical model is correctly specified. For example when using ols, then linearity and homoscedasticity are assumed, some test statistics additionally assume that the errors are normally distributed or that we have a large sample. Since our results depend on these statistical assumptions, the results are only correct of our assumptions hold (at least approximately).

TransfTwo_gen.interval()

statsmodels.sandbox.distributions.transformed.TransfTwo_gen.interval TransfTwo_gen.interval(alpha, *args, **kwds) Confidence interval with equal areas around the median. Parameters: alpha : array_like of float Probability that an rv will be drawn from the returned range. Each value should be in the range [0, 1]. arg1, arg2, ... : array_like The shape parameter(s) for the distribution (see docstring of the instance object for more information). loc : array_like, optional location parame