statsmodels.base.model.LikelihoodModelResults¶
-
class statsmodels.base.model.LikelihoodModelResults(model, params, normalized_cov_params=
None
, scale=1.0
, **kwargs)[source]¶ Class to contain results from likelihood models
- Parameters:¶
- model
LikelihoodModel
instance
orsubclass
instance
LikelihoodModelResults holds a reference to the model that is fit.
- params1d array_like
parameter estimates from estimated model
- normalized_cov_params2d
array
Normalized (before scaling) covariance of params. (dot(X.T,X))**-1
- scale
float
For (some subset of models) scale will typically be the mean square error from the estimated model (sigma^2)
- model
- Attributes:¶
- mle_retvals
dict
Contains the values returned from the chosen optimization method if full_output is True during the fit. Available only if the model is fit by maximum likelihood. See notes below for the output from the different methods.
- mle_settings
dict
Contains the arguments passed to the chosen optimization method. Available if the model is fit by maximum likelihood. See LikelihoodModel.fit for more information.
- model
model
instance
LikelihoodResults contains a reference to the model that is fit.
- params
ndarray
The parameters estimated for the model.
- scale
float
The scaling factor of the model given during instantiation.
- tvalues
ndarray
The t-values of the standard errors.
- mle_retvals
Notes
The covariance of params is given by scale times normalized_cov_params.
Return values by solver if full_output is True during fit:
- ‘newton’
- foptfloat
The value of the (negative) loglikelihood at its minimum.
- iterationsint
Number of iterations performed.
- scorendarray
The score vector at the optimum.
- Hessianndarray
The Hessian at the optimum.
- warnflagint
1 if maxiter is exceeded. 0 if successful convergence.
- convergedbool
True: converged. False: did not converge.
- allvecslist
List of solutions at each iteration.
- ‘nm’
- foptfloat
The value of the (negative) loglikelihood at its minimum.
- iterationsint
Number of iterations performed.
- warnflagint
1: Maximum number of function evaluations made. 2: Maximum number of iterations reached.
- convergedbool
True: converged. False: did not converge.
- allvecslist
List of solutions at each iteration.
- ‘bfgs’
- foptfloat
Value of the (negative) loglikelihood at its minimum.
- goptfloat
Value of gradient at minimum, which should be near 0.
- Hinvndarray
value of the inverse Hessian matrix at minimum. Note that this is just an approximation and will often be different from the value of the analytic Hessian.
- fcallsint
Number of calls to loglike.
- gcallsint
Number of calls to gradient/score.
- warnflagint
1: Maximum number of iterations exceeded. 2: Gradient and/or function calls are not changing.
- convergedbool
True: converged. False: did not converge.
- allvecslist
Results at each iteration.
- ‘lbfgs’
- foptfloat
Value of the (negative) loglikelihood at its minimum.
- goptfloat
Value of gradient at minimum, which should be near 0.
- fcallsint
Number of calls to loglike.
- warnflagint
Warning flag:
0 if converged
1 if too many function evaluations or too many iterations
2 if stopped for another reason
- convergedbool
True: converged. False: did not converge.
- ‘powell’
- foptfloat
Value of the (negative) loglikelihood at its minimum.
- direcndarray
Current direction set.
- iterationsint
Number of iterations performed.
- fcallsint
Number of calls to loglike.
- warnflagint
1: Maximum number of function evaluations. 2: Maximum number of iterations.
- convergedbool
True : converged. False: did not converge.
- allvecslist
Results at each iteration.
- ‘cg’
- foptfloat
Value of the (negative) loglikelihood at its minimum.
- fcallsint
Number of calls to loglike.
- gcallsint
Number of calls to gradient/score.
- warnflagint
1: Maximum number of iterations exceeded. 2: Gradient and/ or function calls not changing.
- convergedbool
True: converged. False: did not converge.
- allvecslist
Results at each iteration.
- ‘ncg’
- foptfloat
Value of the (negative) loglikelihood at its minimum.
- fcallsint
Number of calls to loglike.
- gcallsint
Number of calls to gradient/score.
- hcallsint
Number of calls to hessian.
- warnflagint
1: Maximum number of iterations exceeded.
- convergedbool
True: converged. False: did not converge.
- allvecslist
Results at each iteration.
Methods
conf_int
([alpha, cols])Construct confidence interval for the fitted parameters.
cov_params
([r_matrix, column, scale, cov_p, ...])Compute the variance/covariance matrix.
f_test
(r_matrix[, cov_p, invcov])Compute the F-test for a joint linear hypothesis.
initialize
(model, params, **kwargs)Initialize (possibly re-initialize) a Results instance.
load
(fname)Load a pickled results instance
See specific model class docstring
predict
([exog, transform])Call self.model.predict with self.params as the first argument.
Remove data arrays, all nobs arrays from result and model.
save
(fname[, remove_data])Save a pickle of this instance.
summary
()Summary
t_test
(r_matrix[, cov_p, use_t])Compute a t-test for a each linear hypothesis of the form Rb = q.
t_test_pairwise
(term_name[, method, alpha, ...])Perform pairwise t_test with multiple testing corrected p-values.
wald_test
(r_matrix[, cov_p, invcov, use_f, ...])Compute a Wald-test for a joint linear hypothesis.
wald_test_terms
([skip_single, ...])Compute a sequence of Wald tests for terms over multiple columns.
Properties
The standard errors of the parameter estimates.
Log-likelihood of model
The two-tailed p values for the t-stats of the params.
Return the t-statistic for a given parameter estimate.
Flag indicating to use the Student's distribution in inference.