collapseDistMatrices: Collapse/sum matrices using weights

Description Usage Arguments Value Examples

Description

This function collapses/sums the individual matrices from different feature columns together.

Right now, the weights are not actually implemented (multiplying each matrix by 1 minus its weight did not give distances that clearly stratified between true and false patient matches.)

The matrices are simply summed together and then divided by the total number of matrices fed in to provide a single output distance matrix, where each index is on a scale of 0 to 1, with 0 being a perfect match (zero distance between the two rows.)

Usage

1
collapseDistMatrices(distMatrixList, weightVector = NULL, NAweight = 0.5)

Arguments

distMatrixList

list of distances matrices and a vector of corresponding weights default: all equal weights for each input matrix

weightVector

a vector of weights for each matrix. If NULL, then each matrix will be weighted equally.

NAweight

a custom parameter specifying the score to be assigned for missing data.

Value

a single weighted distance matrix

Examples

1
2
3
4
5
# just sum two of the same matrices:
caseIDVector <- data.frame(c("AB-10-1", "AB-10-5", "AB-10_1"))
m1 <- nameDists(caseIDVector)
m2 <- nameDists(caseIDVector)
summedDistMatrix <- collapseDistMatrices(list(m1, m2), c(0.5, 0.5))

Hackout3/epimatch documentation built on May 6, 2019, 9:48 p.m.