Irescale (version 0.2.6)

calculateWeightedDistMatrix: Calculates a weighted representation of the distance matrix.

Description

calculateWeightedDistMatrix The weighted matrix is used as a standardized version of the distance matrix.

Usage

calculateWeightedDistMatrix(distM)

Arguments

distM,

2D matrix with the distance among all pair of coordinates.

Value

weighted distance matrix. The sum of this matrix is 1.

Details

Computes the similarity matrix of the distance by taking the reciprocal of the distance \(\frac{1}{d}\). A value of Zero is assigned when this value can not be calculated. The whole reciprocal matrix is scaled by dividing each value by the sum of all the elements of the matrix.

Examples

Run this code
# NOT RUN {
fileInput <- system.file("testdata", "chen.csv", package="Irescale")
data<-loadFile(fileInput)
distM<-calculateEuclideanDistance(data$data)
distW<-calculateWeightedDistMatrix(distM)
# }

Run the code above in your browser using DataLab