gpuCor               package:gputools               R Documentation

_C_a_l_c_u_l_a_t_e _V_a_r_i_o_u_s _C_o_r_r_e_l_a_t_i_o_n _C_o_e_f_f_i_c_i_e_n_t_s _W_i_t_h _a _G_P_U

_D_e_s_c_r_i_p_t_i_o_n:

     The correlation coefficient will be calculated for each pair
     $x_i$, $y_j$ where $x_i$ is a column of $x$ and $y_j$ is a column
     of $y$.  Currently, Pearson's and Kendall's correlation
     coefficient are implemented.  Pearson's may be calculated for data
     sets containing NAs in which case, the implementation behaves as
     R-native cor function with use="pairwise.complete".

_U_s_a_g_e:

             gpuCor(x, y = NULL, method = c("pearson", "kendall"), anyNAs = FALSE) 

_A_r_g_u_m_e_n_t_s:

       x: a matrix of floating point values in which each column is a 
          random variable.

       y: a matrix of floating point values in which each column is a 
          random variable.

  method: a string.  Either "pearson" or "kendall".

  anyNAs: a logical value.  Set to TRUE to do Pearson's with NAs in 
          your data set.

_V_a_l_u_e:

     For method "pearson" and anyNAs=TRUE, a list with matrices pairs,
     coefficients, and ts.  The matrix entry $i$, $j$ for pairs
     represents the number of pairs of entries $x_i^k$, $y_j^k$ (the
     $k$-th entry from $x_i$ and $y_j$ respectively) where neither are
     NA.  These are the number of entries actually used to calculate
     the coefficients. Entry $i$, $j$ of the coefficients matrix is the
     correlation coeffcient for $x_i$, $y_j$.  Entry $i$, $j$ of the ts
     matrix is the t-score of the $i$, $j$ entry of the coefficient
     matrix.

     For method "pearson" and anyNAs=FALSE, a matrix of floating point
     numbers where entry $i$, $j$ is the correlation coeffcient for
     $x_i$, $y_j$.

     For method "kendall", a matrix of floating point numbers where
     entry  $i$, $j$ is the correlation coeffcient for $x_i$, $y_j$.

_S_e_e _A_l_s_o:

     cor

_E_x_a_m_p_l_e_s:

     numAvars <- 5
     numBvars <- 10
     numSamples <- 30
     A <- matrix(runif(numAvars*numSamples), numSamples, numAvars)
     B <- matrix(runif(numBvars*numSamples), numSamples, numBvars)
     gpuCor(A, B, "pearson")
     gpuCor(A, B, "kendall")
     A[3,2] <- NA
     gpuCor(A, B, "pearson", TRUE)

