Empirical Likelihood emplike
¶
Introduction¶
Empirical likelihood is a method of nonparametric inference and estimation that lifts the
obligation of having to specify a family of underlying distributions. Moreover, empirical
likelihood methods do not require re-sampling but still
uniquely determine confidence regions whose shape mirrors the shape of the data.
In essence, empirical likelihood attempts to combine the benefits of parametric
and nonparametric methods while limiting their shortcomings. The main difficulties of
empirical likelihood is the computationally intensive methods required to conduct inference.
statsmodels.emplike
attempts to provide a user-friendly interface that allows the
end user to effectively conduct empirical likelihood analysis without having to concern
themselves with the computational burdens.
Currently, emplike
provides methods to conduct hypothesis tests and form confidence
intervals for descriptive statistics. Empirical likelihood estimation and inference
in a regression, accelerated failure time and instrumental variable model are
currently under development.
References¶
The main reference for empirical likelihood is:
Owen, A.B. "Empirical Likelihood." Chapman and Hall, 2001.
Examples¶
In [1]: import numpy as np
In [2]: import statsmodels.api as sm
ImportErrorTraceback (most recent call last)
<ipython-input-2-085740203b77> in <module>()
----> 1 import statsmodels.api as sm
/builddir/build/BUILD/statsmodels-0.9.0/statsmodels/api.py in <module>()
5 from . import regression
6 from .regression.linear_model import OLS, GLS, WLS, GLSAR
----> 7 from .regression.recursive_ls import RecursiveLS
8 from .regression.quantile_regression import QuantReg
9 from .regression.mixed_linear_model import MixedLM
/builddir/build/BUILD/statsmodels-0.9.0/statsmodels/regression/recursive_ls.py in <module>()
14 from statsmodels.regression.linear_model import OLS
15 from statsmodels.tools.data import _is_using_pandas
---> 16 from statsmodels.tsa.statespace.mlemodel import (
17 MLEModel, MLEResults, MLEResultsWrapper)
18 from statsmodels.tools.tools import Bunch
/builddir/build/BUILD/statsmodels-0.9.0/statsmodels/tsa/statespace/mlemodel.py in <module>()
16 from scipy.stats import norm
17
---> 18 from .simulation_smoother import SimulationSmoother
19 from .kalman_smoother import SmootherResults
20 from .kalman_filter import (INVERT_UNIVARIATE, SOLVE_LU)
/builddir/build/BUILD/statsmodels-0.9.0/statsmodels/tsa/statespace/simulation_smoother.py in <module>()
8
9 import numpy as np
---> 10 from .kalman_smoother import KalmanSmoother
11 from . import tools
12
/builddir/build/BUILD/statsmodels-0.9.0/statsmodels/tsa/statespace/kalman_smoother.py in <module>()
9 import numpy as np
10
---> 11 from statsmodels.tsa.statespace.representation import OptionWrapper
12 from statsmodels.tsa.statespace.kalman_filter import (KalmanFilter,
13 FilterResults)
/builddir/build/BUILD/statsmodels-0.9.0/statsmodels/tsa/statespace/representation.py in <module>()
8
9 import numpy as np
---> 10 from .tools import (
11 find_best_blas_type, validate_matrix_shape, validate_vector_shape
12 )
/builddir/build/BUILD/statsmodels-0.9.0/statsmodels/tsa/statespace/tools.py in <module>()
205 'z': _statespace.zcopy_index_vector
206 })
--> 207 set_mode(compatibility=None)
208
209
/builddir/build/BUILD/statsmodels-0.9.0/statsmodels/tsa/statespace/tools.py in set_mode(compatibility)
57 if not compatibility:
58 from scipy.linalg import cython_blas
---> 59 from . import (_representation, _kalman_filter, _kalman_smoother,
60 _simulation_smoother, _tools)
61 compatibility_mode = False
ImportError: cannot import name _representation
# Generate Data
In [3]: x = np.random.standard_normal(50)
# initiate EL
In [4]: el = sm.emplike.DescStat(x)
NameErrorTraceback (most recent call last)
<ipython-input-4-e1d4d3fa00cb> in <module>()
----> 1 el = sm.emplike.DescStat(x)
NameError: name 'sm' is not defined
# confidence interval for the mean
In [5]: el.ci_mean()
NameErrorTraceback (most recent call last)
<ipython-input-5-e0fc1e97a935> in <module>()
----> 1 el.ci_mean()
NameError: name 'el' is not defined
# test variance is 1
In [6]: el.test_var(1)
NameErrorTraceback (most recent call last)
<ipython-input-6-db77c92530f5> in <module>()
----> 1 el.test_var(1)
NameError: name 'el' is not defined
Module Reference¶
descriptive.DescStat (endog) |
Returns an instance to conduct inference on descriptive statistics via empirical likelihood. |
descriptive.DescStatUV (endog) |
A class to compute confidence intervals and hypothesis tests involving mean, variance, kurtosis and skewness of a univariate random variable. |
descriptive.DescStatMV (endog) |
A class for conducting inference on multivariate means and correlation. |