statsmodels.discrete.conditional_models.ConditionalLogit.fit#

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

Fit the conditional 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, 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, its score and its Hessian. The conditional models do not take any, so this is only useful in a subclass that overrides these methods.

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.

**kwargs

Additional keyword arguments used by the solver, see LikelihoodModel.fit. This includes warn_convergence. Robust covariance estimators are not available, so cov_type must be “nonrobust” if it is passed.

Changed in version 0.15.1: fargs, callback, retall and the additional keyword arguments are forwarded to the solver. They were previously ignored.

Returns:
ConditionalResultsWrapper

The fitted model results.