statsmodels.discrete.conditional_models.ConditionalMNLogit.fit#

ConditionalMNLogit.fit(start_params=None, method='BFGS', maxiter=100, full_output=True, disp=False, fargs=(), callback=None, retall=False, skip_hessian=False, rng=None, **kwargs)[source]#

Fit the conditional multinomial logit model.

Parameters:
start_paramsarray_like, optional

Initial guess of the solution for the loglikelihood maximization. If None, random values are drawn using generator.

methodstr, optional

The method determines which solver from scipy.optimize is used, see LikelihoodModel.fit for more information.

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.

dispbool, optional

Set to True to print convergence messages.

fargstuple, optional

Extra arguments passed to the likelihood function.

callbackcallable, optional

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

retallbool, optional

Set to True to return list of solutions at each iteration.

skip_hessianbool, optional

If False, the covariance matrix is calculated using the numerical Hessian after the optimization. If True, the Hessian is not calculated and the returned results have no covariance matrix.

rngint, array_like of int, numpy.random.Generator, or numpy.random.RandomState, optional

Used to draw random starting values for start_params when start_params is None. If rng is None, the legacy global (singleton) RandomState provided by numpy.random is used; this behavior is deprecated and will change to creating a new Generator using fresh entropy from the operating system in a future release. If rng is an int or array of ints, a new Generator is created, seeded with rng. If rng is already a Generator or RandomState instance, that instance is used.

Deprecated since version 0.15: After statsmodels 0.15 is released, the default (rng=None) method for producing random start_params will change to a new instance of a numpy.random.Generator. To obtain deterministic starting values today, either pass a Generator or RandomState explicitly using rng, or call numpy.random.seed() beforehand.

**kwargs

Additional keyword arguments used by the solver.

Returns:
MultinomialResultsWrapper

The fitted model results.