# Minkowski distance with Missing Values

Im currently doing a subject for data science, and have the following point that im trying to understand.

We are looking to calculate distance in data sets where values may not be present. Now i know that R does this by default, but we are learning the "how" behind the what.

Literature we are give states. "The idea is to normalise the inner sum by the number of valid (non-missing) terms, so distances computed from different amounts of terms are commensurable. Otherwise, distances computed with fewer missing values tend to be artificially larger."

Given the following data set.

We have the following sample formulas for Euclidean and Manhattan

Euclidean distance: d(x1, x2) = √(4/3) *( (2 – 7)2 + (1 – (-4))2 + (0 – 8)2 ) = √(4/3)*114 = 12.328

Manhattan: d(x3, x4) = (4/2) * ( |3 – 10| + |2 – 5| ) = (4/2)*10 = 20

Assuming the normalization section fro euclidean is number of non missing terms of each row divided?

How do you derive the normalization section on the Manhattan formula?

• Welcome to the site! You have two different issues here. First is the definition of Euclidean and Manhattan distances. Second is dealing with missing values. Commented Sep 11, 2018 at 8:11