discrete.discrete_model.DiscreteResults()

statsmodels.discrete.discrete_model.DiscreteResults class statsmodels.discrete.discrete_model.DiscreteResults(model, mlefit, cov_type='nonrobust', cov_kwds=None, use_t=None) [source] A results class for the discrete dependent variable models. Parameters: model : A DiscreteModel instance params : array-like The parameters of a fitted model. hessian : array-like The hessian of the fitted model. scale : float A scale parameter for the covariance matrix. Returns: *Attributes* : aic : fl

discrete.discrete_model.DiscreteModel()

statsmodels.discrete.discrete_model.DiscreteModel class statsmodels.discrete.discrete_model.DiscreteModel(endog, exog, **kwargs) [source] Abstract class for discrete choice models. This class does not do anything itself but lays out the methods and call signature expected of child classes in addition to those of statsmodels.model.LikelihoodModel. Methods cdf(X) The cumulative distribution function of the model. cov_params_func_l1(likelihood_model, xopt, ...) Computes cov_params on a reduce

discrete.discrete_model.CountResults()

statsmodels.discrete.discrete_model.CountResults class statsmodels.discrete.discrete_model.CountResults(model, mlefit, cov_type='nonrobust', cov_kwds=None, use_t=None) [source] A results class for count data Parameters: model : A DiscreteModel instance params : array-like The parameters of a fitted model. hessian : array-like The hessian of the fitted model. scale : float A scale parameter for the covariance matrix. Returns: *Attributes* : aic : float Akaike information criterion.

discrete.discrete_model.CountModel()

statsmodels.discrete.discrete_model.CountModel class statsmodels.discrete.discrete_model.CountModel(endog, exog, offset=None, exposure=None, missing='none', **kwargs) [source] Methods cdf(X) The cumulative distribution function of the model. cov_params_func_l1(likelihood_model, xopt, ...) Computes cov_params on a reduced parameter space corresponding to the nonzero parameters resulting from the l1 regularized fit. fit([start_params, method, maxiter, ...]) Fit the model using maximum likel

discrete.discrete_model.BinaryResults()

statsmodels.discrete.discrete_model.BinaryResults class statsmodels.discrete.discrete_model.BinaryResults(model, mlefit, cov_type='nonrobust', cov_kwds=None, use_t=None) [source] A results class for binary data Parameters: model : A DiscreteModel instance params : array-like The parameters of a fitted model. hessian : array-like The hessian of the fitted model. scale : float A scale parameter for the covariance matrix. Returns: *Attributes* : aic : float Akaike information criterio

discrete.discrete_model.BinaryModel()

statsmodels.discrete.discrete_model.BinaryModel class statsmodels.discrete.discrete_model.BinaryModel(endog, exog, **kwargs) [source] Methods cdf(X) The cumulative distribution function of the model. cov_params_func_l1(likelihood_model, xopt, ...) Computes cov_params on a reduced parameter space corresponding to the nonzero parameters resulting from the l1 regularized fit. fit([start_params, method, maxiter, ...]) Fit the model using maximum likelihood. fit_regularized([start_params, met

Discrete Choice Models Overview

Discrete Choice Models Overview Link to Notebook GitHub In [1]: from __future__ import print_function import numpy as np import statsmodels.api as sm Data Load data from Spector and Mazzeo (1980). Examples follow Greene's Econometric Analysis Ch. 21 (5th Edition). In [2]: spector_data = sm.datasets.spector.load() spector_data.exog = sm.add_constant(spector_data.exog, prepend=False) Inspect the data: In [3]: print(spector_data.exog[:5,:]) print(spector_d

Discrete Choice Models

Discrete Choice Models Link to Notebook GitHub Fair's Affair data A survey of women only was conducted in 1974 by Redbook asking about extramarital affairs. In [1]: from __future__ import print_function import numpy as np from scipy import stats import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.formula.api import logit, probit, poisson, ols In [2]: print(sm.datasets.fair.SOURCE) Fair, Ray. 1978. "A Theory of Extramarital Affa

DescStatUV.test_var()

statsmodels.emplike.descriptive.DescStatUV.test_var DescStatUV.test_var(sig2_0, return_weights=False) [source] Returns -2 x log-likelihoog ratio and the p-value for the hypothesized variance Parameters: sig2_0 : float Hypothesized variance to be tested return_weights : bool If True, returns the weights that maximize the likelihood of observing sig2_0. Default is False Returns: test_results : tuple The log-likelihood ratio and the p_value of sig2_0 Examples >>> random_numbe

DescStatUV.test_kurt()

statsmodels.emplike.descriptive.DescStatUV.test_kurt DescStatUV.test_kurt(kurt0, return_weights=False) [source] Returns -2 x log-likelihood and the p-value for the hypothesized kurtosis. Parameters: kurt0 : float Kurtosis value to be tested return_weights : bool If True, function also returns the weights that maximize the likelihood ratio. Default is False. Returns: test_results : tuple The log-likelihood ratio and p-value of kurt0