WeightedEuclidean: Weighted Eulidean Distance Matrix

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/WeightedEuclidean.R

Description

Produces Weighted Eulidean Distance Matrix

Usage

1
WeightedEuclidean(Data, Weights)

Arguments

Data

[1:n,1:c] data matric

Weights

vector [1:c]

Details

The second and las example shows the difference to common Euclidean distance. Only the first example shows how to use the weighted euclidean for cluster analysis.

Value

Distance Matrix

Note

should be implemented in Rcpp for efficiency

Author(s)

Michael Thrun

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#lets assume that feature 2 and 3
# are correlated, then one can use:
DistanceMatrix=WeightedEuclidean(FCPS$Hepta$Data,Weights = c(1,0.5,0.5))


##Comparisions for (un)correlated features:

#There is no difference to normal Euclid
# if uncorrelated, because the weights are always one
WeightedEuclidean(FCPS$Hepta$Data,Weights = c(1,1,1))-DistanceMatrix(FCPS$Hepta$Data)

#in case of correlations there is a difference
WeightedEuclidean(FCPS$Hepta$Data,Weights = c(1,0.5,0.5))-DistanceMatrix(FCPS$Hepta$Data)

Mthrun/Distances documentation built on Feb. 4, 2020, 8:39 p.m.