rpucor {rpud}R Documentation

Kendall's Tau-b Correlation Coefficient on GPU

Description

This function computes the correlation matrix of two multivariate statistics.

Usage

## Default S3 method:
rpucor(x, y = NULL, 
    use = "everything",
    method = c("pearson", "spearman", "kendall", "gamma"), ...)

Arguments

x

a numeric vector, matrix or data frame.

y

a vector, matrix or data frame with compatible dimensions to 'x'. The default 'NULL' value is equivalent to 'y = x'.

use

a string representing the method to handle missing values. Currently supported values are: "everything"(default), "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs".

method

a string representing the name of the correlation to be computed. The supported values are: "pearson"(default), "spearman", "kendall", and "gamma".

...

further arguments to be passed to or from methods.

Details

Perform the Kendall correlation with GPU using the rpudplus add-on for rpud. The Pearson and Spearman correlation are just stubs that invoke the default implementation of R. In absense of rpudplus, rpud computes the Kendall correlation also with the stock R implementation, and there will be no speed gain.

Value

The correlation matrix of the input statistics. An attribute named "method" contains the name of the correlation, and another attribute named "use" contains the method to handle missing values.

See Also

cor, gpuCor

Examples

## Not run: 

num <- 5
dim1 <- 6
dim2 <- 8
x <- matrix(runif(num*dim1), num, dim1)
y <- matrix(runif(num*dim2), num, dim2)
rpucor(x, y, method = "kendall")

# introduce missing values
x[3,5] <- NA
y[4,1] <- NA
rpucor(x, y, method = "kendall", use="pairwise.complete.obs")


## End(Not run)

[Package rpud version 0.7.2 Index]