Source: the reference implementation CLR in the CRAN package ivmodel
(file R/CLR.r), implementing Moreira, M. J. (2003), Econometrica 71,
1027-1048, with the conditional p-value integral of Andrews, Moreira and Stock
(2007), Journal of Econometrics 138, 46-81; Kleibergen, F. (2002), Econometrica 70,
1781-1803, supplies the score decomposition. With P_Z the projection on the
partialled-out instruments and sigmaHat = crossprod(M_Z [Y D]) / (n - k - L),
a0 = (beta0, 1), b0 = (1, -beta0): \(QS = ||P_Z [Y D] b0||^2 / (b0'
sigmaHat b0)\), \(QT = ||P_Z [Y D] sigmaHat^-1 a0||^2 / (a0' sigmaHat^-1 a0)\),
QTS the corresponding normalised cross term, and LR = (QS - QT +
sqrt((QS+QT)^2 - 4(QS QT - QTS^2)))/2.
Details
For L = 1 the conditional p-value is 1 - pf(LR, 1, df2).
For L >= 2 the package source integrates
2 K int_0^1 pchisq((QT+LR)/(1 + QT x^2/LR), L) (1-x^2)^((L-3)/2) dx
with K = gamma(L/2)/(sqrt(pi) gamma((L-1)/2)); the
substitution x = sin(theta) used here turns that into
\(2 K int_0^{pi/2} pchisq((QT+LR)/(1 + QT sin^2(theta)/LR), L)
cos^(L-2)(theta) dtheta\), whose integrand is bounded and smooth for
every L >= 2, so the epsilon-regularised L = 4 special
case in the package is not needed. A fixed 4096-interval composite
Simpson rule is used, so the result is deterministic.
