({{, (RefLink[NormalizedSquaredEuclideanDistance, paclet:ref/NormalizedSquaredEuclideanDistance])[u,v]
gives the normalized squared Euclidean distance between vectors u and v.}})

OpenersNotesSection(Spacer1)Details

(RefLink[NormalizedSquaredEuclideanDistance, paclet:ref/NormalizedSquaredEuclideanDistance])[u,v] is equivalent to 1/2*(RefLink[Norm, paclet:ref/Norm])[(u-(RefLink[Mean, paclet:ref/Mean])[u])-(v-(RefLink[Mean, paclet:ref/Mean])[v])]^2/((RefLink[Norm, paclet:ref/Norm])[u-(RefLink[Mean, paclet:ref/Mean])[u]]^2+(RefLink[Norm, paclet:ref/Norm])[v-(RefLink[Mean, paclet:ref/Mean])[v]]^2).

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

The normalized squared Euclidean distance between two vectors:

NormalizedSquaredEuclideanDistance[{a,b},{x,y}]

The normalized squared Euclidean distance between numeric vectors:

NormalizedSquaredEuclideanDistance[{1,2,3},{3,5,10}]

OpenersExampleSection1(Spacer1)Scope  (2)

Compute the distance between any vectors of equal length:

NormalizedSquaredEuclideanDistance[RandomReal[5,100],RandomReal[5,100]]

Compute the distance between vectors of any precision:

NormalizedSquaredEuclideanDistance[N[{1,5,2,3,10},50],N[{4,15,20,5,5},50]]

OpenersExampleSection3(Spacer1)Applications  (1)

Cluster data using normalized squared Euclidean distance:

FindClusters[{{2,3},{5,10},{4,5},{2,2}},DistanceFunction->NormalizedSquaredEuclideanDistance]

OpenersExampleSection4(Spacer1)Properties & Relations  (2)

Normalized squared Euclidean distance includes a squared Euclidean distance scaled by norms:

u={a,b,c};
v={x,y,z};
1/2*Norm[(u-Mean@u)-(v-Mean@v)]^2/(Norm[u-Mean@u]^2+Norm[v-Mean@v]^2)

NormalizedSquaredEuclideanDistance[u,v]==%

The normalized squared Euclidean distance of two vectors or real numbers is in the range from 0 to 1:

u={a,b,c};
v={x,y,z};
First@Maximize[N@NormalizedSquaredEuclideanDistance[u,v],{a,b,c,x,y,z},Reals]

First@Minimize[N@NormalizedSquaredEuclideanDistance[u,v],{a,b,c,x,y,z},Reals]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[CorrelationDistance, paclet:ref/CorrelationDistance])  ▪  (RefLink[CosineDistance, paclet:ref/CosineDistance])  ▪  (RefLink[SquaredEuclideanDistance, paclet:ref/SquaredEuclideanDistance])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Partitioning Data into Clusters, paclet:tutorial/PartitioningDataIntoClusters])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Distance and Similarity Measures, paclet:guide/DistanceAndSimilarityMeasures])}})}})