MNLogit.hessian()

statsmodels.discrete.discrete_model.MNLogit.hessian MNLogit.hessian(params) [source] Multinomial logit Hessian matrix of the log-likelihood Parameters: params : array-like The parameters of the model Returns: hess : ndarray, (J*K, J*K) The Hessian, second derivative of loglikelihood function with respect to the flattened parameters, evaluated at params Notes where equals 1 if j = l and 0 otherwise. The actual Hessian matrix has J**2 * K x K elements. Our Hessian is reshaped to be

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 :

MNLogit.fit_regularized()

statsmodels.discrete.discrete_model.MNLogit.fit_regularized MNLogit.fit_regularized(start_params=None, method='l1', maxiter='defined_by_method', full_output=1, disp=1, callback=None, alpha=0, trim_mode='auto', auto_trim_tol=0.01, size_trim_tol=0.0001, qc_tol=0.03, **kwargs) Fit the model using a regularized maximum likelihood. The regularization method AND the solver used is determined by the argument method. Parameters: start_params : array-like, optional Initial guess of the solution for

MNLogit.fit()

statsmodels.discrete.discrete_model.MNLogit.fit MNLogit.fit(start_params=None, method='newton', maxiter=35, full_output=1, disp=1, callback=None, **kwargs) Fit the model using maximum likelihood. The rest of the docstring is from statsmodels.base.model.LikelihoodModel.fit Fit method for likelihood based models Parameters: start_params : array-like, optional Initial guess of the solution for the loglikelihood maximization. The default is an array of zeros. method : str, optional The metho

MNLogit.cov_params_func_l1()

statsmodels.discrete.discrete_model.MNLogit.cov_params_func_l1 MNLogit.cov_params_func_l1(likelihood_model, xopt, retvals) Computes cov_params on a reduced parameter space corresponding to the nonzero parameters resulting from the l1 regularized fit. Returns a full cov_params matrix, with entries corresponding to zero?d values set to np.nan.

MNLogit.cdf()

statsmodels.discrete.discrete_model.MNLogit.cdf MNLogit.cdf(X) [source] Multinomial logit cumulative distribution function. Parameters: X : array The linear predictor of the model XB. Returns: cdf : ndarray The cdf evaluated at X. Notes In the multinomial logit model. .. math:: frac{expleft(beta_{j}^{prime}x_{i}right)}{sum_{k=0}^{J}expleft(beta_{k}^{prime}x_{i}right)}

MixedLMResults.wald_test()

statsmodels.regression.mixed_linear_model.MixedLMResults.wald_test MixedLMResults.wald_test(r_matrix, cov_p=None, scale=1.0, invcov=None, use_f=None) Compute a Wald-test for a joint linear hypothesis. Parameters: r_matrix : array-like, str, or tuple array : An r x k array where r is the number of restrictions to test and k is the number of regressors. It is assumed that the linear combination is equal to zero. str : The full hypotheses to test can be given as a string. See the examples. tu

MixedLMResults.t_test()

statsmodels.regression.mixed_linear_model.MixedLMResults.t_test MixedLMResults.t_test(r_matrix, cov_p=None, scale=None, use_t=None) Compute a t-test for a each linear hypothesis of the form Rb = q Parameters: r_matrix : array-like, str, tuple array : If an array is given, a p x k 2d array or length k 1d array specifying the linear restrictions. It is assumed that the linear combination is equal to zero. str : The full hypotheses to test can be given as a string. See the examples. tuple : A

MixedLMResults.summary()

statsmodels.regression.mixed_linear_model.MixedLMResults.summary MixedLMResults.summary(yname=None, xname_fe=None, xname_re=None, title=None, alpha=0.05) [source] Summarize the mixed model regression results. Parameters: yname : string, optional Default is y xname_fe : list of strings, optional Fixed effects covariate names xname_re : list of strings, optional Random effects covariate names title : string, optional Title for the top table. If not None, then this replaces the default

MixedLMResults.save()

statsmodels.regression.mixed_linear_model.MixedLMResults.save MixedLMResults.save(fname, remove_data=False) save a pickle of this instance Parameters: fname : string or filehandle fname can be a string to a file path or filename, or a filehandle. remove_data : bool If False (default), then the instance is pickled without changes. If True, then all arrays with length nobs are set to None before pickling. See the remove_data method. In some cases not all arrays will be set to None. Notes