Poisson.information()

statsmodels.discrete.discrete_model.Poisson.information Poisson.information(params) Fisher information matrix of model Returns -Hessian of loglike evaluated at params.

Poisson.initialize()

statsmodels.discrete.discrete_model.Poisson.initialize Poisson.initialize() Initialize is called by statsmodels.model.LikelihoodModel.__init__ and should contain any preprocessing that needs to be done for a model.

Poisson.hessian()

statsmodels.discrete.discrete_model.Poisson.hessian Poisson.hessian(params) [source] Poisson model Hessian matrix of the loglikelihood Parameters: params : array-like The parameters of the model Returns: hess : ndarray, (k_vars, k_vars) The Hessian, second derivative of loglikelihood function, evaluated at params Notes where the loglinear model is assumed

Poisson.from_formula()

statsmodels.discrete.discrete_model.Poisson.from_formula classmethod Poisson.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 :

Poisson.fit_constrained()

statsmodels.discrete.discrete_model.Poisson.fit_constrained Poisson.fit_constrained(constraints, start_params=None, **fit_kwds) [source] fit the model subject to linear equality constraints The constraints are of the form R params = q where R is the constraint_matrix and q is the vector of constraint_values. The estimation creates a new model with transformed design matrix, exog, and converts the results back to the original parameterization. Parameters: constraints : formula expression or

Poisson.fit_regularized()

statsmodels.discrete.discrete_model.Poisson.fit_regularized Poisson.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) [source] 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 sol

Poisson.deviance()

statsmodels.genmod.families.family.Poisson.deviance Poisson.deviance(endog, mu, scale=1.0) [source] Poisson deviance function Parameters: endog : array-like Endogenous response variable mu : array-like Fitted mean response variable scale : float, optional An optional scale argument Returns: deviance : float The deviance function at (endog,mu) as defined below. Notes If a constant term is included it is defined as

Poisson.fit()

statsmodels.discrete.discrete_model.Poisson.fit Poisson.fit(start_params=None, method='newton', maxiter=35, full_output=1, disp=1, callback=None, **kwargs) [source] 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

Poisson.fitted()

statsmodels.genmod.families.family.Poisson.fitted Poisson.fitted(lin_pred) Fitted values based on linear predictors lin_pred. Parameters: lin_pred : array Values of the linear predictor of the model. dot(X,beta) in a classical linear model. Returns: mu : array The mean response variables given by the inverse of the link function.

Plot Interaction of Categorical Factors

Plot Interaction of Categorical Factors Link to Notebook GitHub In this example, we will vizualize the interaction between categorical factors. First, we will create some categorical data are initialized. Then plotted using the interaction_plot function which internally recodes the x-factor categories to ingegers. In [1]: import numpy as np import matplotlib.pyplot as plt import pandas as pd from statsmodels.graphics.factorplots import interaction_plot In [2]: np.random.