Logo

statsmodels.base.model.LikelihoodModelResults.conf_int

LikelihoodModelResults.conf_int(alpha=0.05, cols=None, method='default')[source]

Returns the confidence interval of the fitted parameters.

Parameters :

alpha : float, optional

The alpha level for the confidence interval. ie., The default alpha = .05 returns a 95% confidence interval.

cols : array-like, optional

cols specifies which confidence intervals to return

method : string

Not Implemented Yet Method to estimate the confidence_interval. “Default” : uses self.bse which is based on inverse Hessian for MLE “jhj” : “jac” : “boot-bse” “boot_quant” “profile”

Returns :

conf_int : array

Each row contains [lower, upper] confidence interval

Notes

The confidence interval is based on the standard normal distribution. Models wish to use a different distribution should overwrite this method.

Examples

>>> import statsmodels.api as sm
>>> data = sm.datasets.longley.load()
>>> data.exog = sm.add_constant(data.exog)
>>> results = sm.OLS(data.endog, data.exog).fit()
>>> results.conf_int()
array([[ -1.77029035e+02,   2.07152780e+02],
[ -1.11581102e-01,   3.99427438e-02],
[ -3.12506664e+00,  -9.15392966e-01],
[ -1.51794870e+00,  -5.48505034e-01],
[ -5.62517214e-01,   4.60309003e-01],
[  7.98787515e+02,   2.85951541e+03],
[ -5.49652948e+06,  -1.46798779e+06]])
>>> results.conf_int(cols=(1,2))
array([[-0.1115811 ,  0.03994274],
[-3.12506664, -0.91539297]])

Previous topic

statsmodels.base.model.LikelihoodModelResults.bse

Next topic

statsmodels.base.model.LikelihoodModelResults.cov_params

This Page