Learn R Programming

SETPath (version 1.0)

unbias.eigens: Unbiased estimation of leading eigenvalues

Description

A function called by setpath(), used to attain unbiased estimates of leading eigenvalues and to estimate the leading eigenvalues under the null hypothesis.

Usage

unbias.eigens(L, g, w, minalpha = NULL)

Arguments

L
A vector of length two containing a leading eigenvalue from each of the two datasets.
g
A vector of length two containing the gamma (p/n) values from the two datasets.
w
The weights to assign to the two classes when estimating common leading eigenvalues under the null hypothesis.
minalpha
Can be used to tweak the estimation of the leading eigenvalues under the null hypothesis. If NULL, eigenvalues are truncated below at 1 + 2*sqrt(gamma). Otherwise, eigenvalues are truncated below at 1 + sqrt(gamma) + minalpha.

Value

  • QLcorrectionThe correction factor to remove the bias in the difference between the two eigenvalues.
  • a0The common eigenvalue estimated under the null hypothesis
  • aThe unbiased eigenvalue estimates from each class

Details

Called by the setpath() function, not useful on its own.

References

Patrick Danaher, Debashis Paul, and Pei Wang. "Covariance-based analyses of biological pathways." Biometrika (2015)

Examples

Run this code
## The function is currently defined as
function (L, g, w, minalpha = NULL) 
{
    if (length(minalpha) == 0) {
        minalpha = sqrt(max(g))
    }
    a = c()
    for (k in 1:2) {
        if (L[k] < (1 + sqrt(g[k]))^2) {
            a[k] = 1 + sqrt(max(g)) + minalpha
        }
        if (L[k] >= (1 + sqrt(g[k]))^2) {
            a[k] = ((1 + L[k] - g[k]) + sqrt((1 + L[k] - g[k])^2 - 
                4 * L[k]))/2
        }
    }
    a0 = sum(a * w)
    a0 = max(c(a0, 1 + sqrt(g)))
    QLcorrection = (g[1] - g[2]) * a0/(a0 - 1)
    return(list(QLcorrection = QLcorrection, a0 = a0, a = a))
  }

Run the code above in your browser using DataLab