Skip to content

Commit

Permalink
Update KClass docs. (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlondschien authored Jul 22, 2024
1 parent 94b8f8d commit 44026e4
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions ivmodels/models/kclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ class KClass(KClassMixin, GeneralizedLinearRegressor):
This includes the the ordinary least-squares (OLS) estimator (:math:`\\kappa = 0`),
the two-stage least-squares (2SLS) estimator
(:math:`\\kappa = 1`), the limited information maximum likelihood (LIML) estimator
(:math:`\\kappa = \\hat\\kappa_\\mathrm{LIML}`), and the Fuller estimator
(:math:`\\kappa = \\hat\\kappa_\\mathrm{LIML}`), and the Fuller estimators
(:math:`\\kappa = \\hat\\kappa_\\mathrm{LIML} - \\alpha / (n - k)`) as special
cases.
Expand All @@ -545,23 +545,22 @@ class KClass(KClassMixin, GeneralizedLinearRegressor):
Parameters
----------
kappa: float or { "ols", "tsls", "2sls", "liml", "fuller", "fuller(a)"}
The kappa parameter of the k-class estimator. If float, then kappa must be in
:math:`[0, \\hat\\kappa_\\mathrm{LIML}]`, where
The kappa parameter of the k-class estimator.
If string, then must be one of ``"ols"``, ``"2sls"``, ``"tsls"``, ``"liml"``,
``"fuller"``, or ``"fuller(a)"``, where ``a`` is numeric. If ``kappa="ols"``,
then ``kappa=0`` and the k-class estimator is the ordinary least squares
estimator. If ``kappa="tsls"`` or ``kappa="2sls"``, then ``kappa=1`` and the
k-class estimator is the two-stage least-squares estimator. If ``kappa="liml"``,
then :math:`\\kappa = \\hat\\kappa_\\mathrm{LIML}` is used, where
:math:`\\kappa_\\mathrm{LIML} \\geq 1` is the smallest eigenvalue of the
matrix :math:`((X \\ \\ y)^T M_Z (X \\ \\ y))^{-1} (X \\ \\ y)^T (X \\ y)`,
where :math:`P_Z` is the projection matrix onto the subspace spanned by :math:`Z`
and :math:`M_Z = Id - P_Z`.
If exogenous included regressors math:`C` are specified, then
:math:`\\kappa_\\mathrm{LIML}` is the smallest eigenvalue of the matrix
:math:`((X \\ \\ y)^T M_{[Z, C]} (X \\ \\ y))^{-1} (X \\ \\ y)^T M_C (X \\ y)`.
If string, then must be one of ``"ols"``, ``"2sls"``, ``"tsls"``, ``"liml"``,
``"fuller"``, or ``"fuller(a)"``, where ``a`` is numeric. If ``kappa="ols"``,
then ``kappa=0`` and the k-class estimator is the ordinary least squares
estimator. If ``kappa="tsls"`` or ``kappa="2sls"``, then ``kappa=1`` and the
k-class estimator is the two-stage least-squares estimator. If ``kappa="liml"``,
then :math:`\\kappa = \\hat\\kappa_\\mathrm{LIML}` is used. If
``kappa="fuller(a)"``, then
:math:`\\kappa = \\hat\\kappa_\\mathrm{LIML} - a / (n - k)`, where
If ``kappa="fuller(a)"``, then
:math:`\\kappa = \\hat\\kappa_\\mathrm{LIML} - a / (n - k - mc)`, where
:math:`n` is the number of observations and :math:`q = \\mathrm{dim}(Z)` is the
number of instruments. The string ``"fuller"`` is interpreted as
``"fuller(1.0)"``, yielding an estimator that is unbiased up to
Expand Down Expand Up @@ -601,7 +600,7 @@ class KClass(KClassMixin, GeneralizedLinearRegressor):
intercept_: float
The estimated intercept for the linear regression problem.
kappa_: float
The kappa parameter of the k-class estimator.
The numerical kappa parameter of the k-class estimator.
fuller_alpha_: float
If ``kappa`` is one of ``{"fuller", "fuller(a)", "liml"}`` for some numeric
value ``a``, the alpha parameter of the Fuller estimator.
Expand Down

0 comments on commit 44026e4

Please sign in to comment.