statsmodels.emplike.descriptive.DescStatUV.ci_var

DescStatUV.ci_var(lower_bound=None, upper_bound=None, sig=0.05)[source]

Returns the confidence interval for the variance.

Parameters:

lower_bound : float

The minimum value the lower confidence interval can take. The p-value from test_var(lower_bound) must be lower than 1 - significance level. Default is .99 confidence limit assuming normality

upper_bound : float

The maximum value the upper confidence interval can take. The p-value from test_var(upper_bound) must be lower than 1 - significance level. Default is .99 confidence limit assuming normality

sig : float

The significance level. Default is .05

Returns:

Interval : tuple

Confidence interval for the variance

Notes

If the function returns the error f(a) and f(b) must have different signs, consider lowering lower_bound and raising upper_bound.

Examples

>>> import numpy as np
>>> import statsmodels.api as sm
>>> random_numbers = np.random.standard_normal(100)
>>> el_analysis = sm.emplike.DescStat(random_numbers)
>>> el_analysis.ci_var()
(0.7539322567470305, 1.229998852496268)
>>> el_analysis.ci_var(.5, 2)
(0.7539322567469926, 1.2299988524962664)