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.
- method
str,optional The method determines which solver from scipy.optimize is used, see LikelihoodModel.fit for more information.
- maxiter
int,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.
- fargs
tuple,optional Extra arguments passed to the likelihood function.
- callback
callable,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.
- rng
int, array_likeofint,numpy.random.Generator,ornumpy.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)
RandomStateprovided bynumpy.randomis used; this behavior is deprecated and will change to creating a newGeneratorusing fresh entropy from the operating system in a future release. If rng is an int or array of ints, a newGeneratoris created, seeded with rng. If rng is already aGeneratororRandomStateinstance, 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 anumpy.random.Generator. To obtain deterministic starting values today, either pass aGeneratororRandomStateexplicitly using rng, or callnumpy.random.seed()beforehand.- **kwargs
Additional keyword arguments used by the solver.
- start_paramsarray_like,
- Returns:
MultinomialResultsWrapperThe fitted model results.