Calculate the integrals (up to 4 non-zero terms) used in Theorem 1 (Formula 7) to approximate the covariance between transformed statistics.

getGFishercoef(D, M, p.type = "two", use.cpp = TRUE)

Arguments

D

A vector of degrees of freedom for a GFisher statistic.

M

Correlation matrix of the input Z-scores from which the input p-values were obtained.

p.type

Character string: "two" for two-sided (default), "one" for one-sided input p-values.

use.cpp

Logical, default TRUE. If TRUE, uses fast C++ implementation. Set to FALSE to force pure R implementation.

Value

A list of 4 vectors of integrals used in formula (7):

coeff2

Vector of \(I_1(2), I_2(2), ..., I_n(2)\) for two-sided, or \(I_1(1), ..., I_n(1)\) for one-sided

coeff4

Vector of \(I_1(4), I_2(4), ..., I_n(4)\) for two-sided, or \(I_1(2), ..., I_n(2)\) for one-sided

coeff6

Vector of \(I_1(6), I_2(6), ..., I_n(6)\) for two-sided, or \(I_1(3), ..., I_n(3)\) for one-sided

coeff8

Vector of \(I_1(8), I_2(8), ..., I_n(8)\) for two-sided, or \(I_1(4), ..., I_n(4)\) for one-sided

Details

Compute Hermite Polynomial Coefficients for GFisher

This function implements the literal calculation of integrals in formula (7) of the GFisher paper.

For two-sided p-values:

The function computes: $$I_j(k) = \int_{-8}^{8} F^{-1}_{d_j}(\Phi(x^2)) \phi(x) H_k(x) dx$$ where \(F^{-1}_{d_j}\) is the inverse chi-square CDF, \(\Phi\) is the standard normal CDF, \(\phi\) is the standard normal PDF, and \(H_k(x)\) are Hermite polynomials:

  • \(H_2(x) = x^2 - 1\)

  • \(H_4(x) = x^4 - 6x^2 + 3\)

  • \(H_6(x) = x^6 - 15x^4 + 45x^2 - 15\)

  • \(H_8(x) = x^8 - 28x^6 + 210x^4 - 420x^2 + 105\)

For one-sided p-values:

Similar integrals are computed but with \(\Phi(x)\) instead of \(\Phi(x^2)\) and different Hermite polynomials (\(H_1, H_2, H_3, H_4\)).

If a single degree of freedom is provided, it is replicated to match the dimension of M.

Performance Note: When use.cpp = TRUE (default), this function uses a C++ implementation with composite Gauss-Legendre quadrature for numerical integration, providing substantial speedup over the pure R implementation. The C++ version automatically falls back to R if unavailable.

References

Zhang, H., & Wu, Z. (2023). The generalized Fisher's combination and accurate p-value calculation under dependence. Biometrics, 79(2), 1159-1172. See Theorem 1 and Formula (7).

Author

Hong Zhang