linearmodels.iv.results.IVGMMResults.j_stat

property IVGMMResults.j_stat : InvalidTestStatistic | WaldTestStatistic

J-test of overidentifying restrictions.

Returns:

J statistic test of overidentifying restrictions. An InvalidTestStatistic is returned if the estimate of the covariance of the moment conditions that was inverted to compute the weight matrix is singular. This can only happen at the final estimates of IVGMMCUE, since IVGMM and IVGMMCUE raise a ValueError if it is singular, which is the case if there are too few clusters.

Return type:

linearmodels.shared.hypotheses.WaldTestStatistic or linearmodels.shared.hypotheses.InvalidTestStatistic

Notes

The J statistic tests whether the moment conditions are sufficiently close to zero to indicate that the model is not overidentified. The statistic is defined as

\[n \bar{g}'W^{-1}\bar{g} \sim \chi^2_q\]

where \(\bar{g} = n^{-1}\sum \hat{\epsilon}_i z_i\) where \(z_i\) includes both the exogenous variables and instruments and \(\hat{\epsilon}_i\) are the model residuals. \(W\) is a consistent estimator of the variance of \(\sqrt{n}\bar{g}\). The degree of freedom is \(q = n_{instr} - n_{endog}\).

The statistic is not defined if the estimate of the covariance of the moment conditions that is inverted to compute the weight matrix is singular. A clustered estimate that uses G clusters has rank at most G, and at most G - 1 if the moment conditions are centered (center is True), because the centered cluster sums add to zero. There have to be at least as many clusters as moment conditions, and more if they are centered. The rank of a kernel or robust estimate is bounded in the same way by the number of observations. Whether the estimate is singular does not depend on the units in which the variables are measured.

IVGMM.fit raises a ValueError if the estimate is singular in any step, and IVGMMCUE.fit raises one if it is singular at the first step estimates, since the weight matrix and the objective function are not defined. The statistic is invalid only if the estimate of IVGMMCUE is singular at its final estimates and not at the first step estimates.