statsmodels.discrete.discrete_model.NegativeBinomialP.fit#

NegativeBinomialP.fit(start_params=None, method='bfgs', maxiter=35, full_output=1, disp=1, callback=None, use_transparams=False, cov_type='nonrobust', cov_kwds=None, use_t=None, optim_kwds_prelim=None, **kwargs)[source]#

Fit the NegativeBinomialP model.

Parameters:
start_paramsarray_like, optional

Initial guess of the solution for the loglikelihood maximization. The default is an array of zeros.

methodstr, optional

The method determines which solver from scipy.optimize is used, and it can be chosen from among the following strings:

  • ‘newton’ for Newton-Raphson, ‘nm’ for Nelder-Mead

  • ‘bfgs’ for Broyden-Fletcher-Goldfarb-Shanno (BFGS)

  • ‘lbfgs’ for limited-memory BFGS with optional box constraints

  • ‘powell’ for modified Powell’s method

  • ‘cg’ for conjugate gradient

  • ‘ncg’ for Newton-conjugate gradient

  • ‘basinhopping’ for global basin-hopping solver

  • ‘minimize’ for generic wrapper of scipy minimize (BFGS by default)

The explicit arguments in fit are passed to the solver, with the exception of the basin-hopping solver. Each solver has several optional arguments that are not the same across solvers. See the notes section below (or scipy.optimize) for the available arguments and for the list of explicit arguments that the basin-hopping solver supports.

maxiterint, optional

The maximum number of iterations to perform.

full_outputbool, optional

Set to True to have all available output in the Results object’s mle_retvals attribute. The output is dependent on the solver. See LikelihoodModelResults notes section for more information.

dispbool, optional

Set to True to print convergence messages.

callbackcallable callback(xk), optional

Called after each iteration, as callback(xk), where xk is the current parameter vector.

use_transparamsbool

If True, use an internal transformation to impose the no-underdispersion constraint, alpha > 0. Default is False. The transformation is ignored if method is “newton” or “ncg”.

cov_typestr, optional

Covariance estimator to use when computing parameter covariance.

cov_kwdsdict, optional

Additional keywords for the selected covariance estimator.

use_tbool, optional

If True, use the Student’s t distribution for inference.

optim_kwds_prelimdict, optional

Additional keyword arguments for the preliminary Poisson fit used to construct starting values when start_params is None.