dist2_w: Boosted Pairwise Euclidean distances

dist2_wR Documentation

Boosted Pairwise Euclidean distances

Description

Computes the boosted Euclidean distances between all pairs of data point given

Usage

dist2_w(X, C, weight)

Arguments

X

A data matrix where each row is a different data point

C

A data matrix where each row is a different data point. If this matrix is the same as X, pairwise distances for all data points are computed.

weight

A sequence indicating the weights of each features.

Value

Returns an N x M matrix where N is the number of rows in X and M is the number of rows in M. element (n,m) is the squared Euclidean distance between nth data point in X and mth data point in C

References

Weighed network fusion through association signal annotations, Peifeng Ruan, Ya Wang, Ronglai Shen, Shuang Wang.

Examples


#load data
data(data1)
data(data2)
data(weight1)
data(weight2)

# Calculate boosted distance matrices(here we calculate Euclidean Distance, 
Dist1 = dist2_w(as.matrix(data1), as.matrix(data1),weight1)
Dist2 = dist2_w(as.matrix(data2), as.matrix(data2),weight2)


pfruan/abSNF documentation built on Sept. 16, 2022, 5:40 a.m.