Skip to main content
added 218 characters in body
Source Link
mzzx
  • 123
  • 5

I want to use the Wasserstein distance from scipy.stats.wasserstein_distance to get a measure for the difference between two probability distribution. However, I do not understand how the support matters here.

For example, I would have expected stats.wasserstein_distance([0,1,0],[1,0,0]) to be 1 (as we need to move a mass of weight 1 by a distance of 1), however it is 0. Why is this?

I know this is related to this question: what does the Wasserstein distance between two distributions quantify.

My understanding is that the Wasserstein distance is the earth-movers distance; thus, it would be that it is able to show a further distance between delta-function like probability distributions where the peaks are not aligned but further apart - eg, the difference between distributions of two variables with cardinality four [1,0,0,0] and [0,0,1,0] should be higher than between distributions [1,0,0,0] and [0,1,0,0]. The Jensen-Shannon divergence would be the , where the same in both cases. However, in the scipy implementation the Wasserstein distance is zero in both cases also.

Edit: This question was closed without an explanation and despite an upvote.

Thankfully, I found the answer here: https://stackoverflow.com/questions/57402842/why-is-the-wasserstein-distance-between-0-1-and-1-0-zero — I also asked on stackoverflow before asking here and have clarified things there, but in short, the Wasserstein distance from scipy does NOT calculate the distance between two distributions P(A) and P(B) where A and B have the same support but different probabilities for each state; rather, it calculates the difference between different samples of a single distribution.

Edit 2: You can use the scipy implementation for this but need to use the weights. Summary is here: https://stackoverflow.com/questions/76049158/wasserstein-distance-in-scipy-definition-of-support/76061410#76061410

I want to use the Wasserstein distance from scipy.stats.wasserstein_distance to get a measure for the difference between two probability distribution. However, I do not understand how the support matters here.

For example, I would have expected stats.wasserstein_distance([0,1,0],[1,0,0]) to be 1 (as we need to move a mass of weight 1 by a distance of 1), however it is 0. Why is this?

I know this is related to this question: what does the Wasserstein distance between two distributions quantify.

My understanding is that the Wasserstein distance is the earth-movers distance; thus, it would be that it is able to show a further distance between delta-function like probability distributions where the peaks are not aligned but further apart - eg, the difference between distributions of two variables with cardinality four [1,0,0,0] and [0,0,1,0] should be higher than between distributions [1,0,0,0] and [0,1,0,0]. The Jensen-Shannon divergence would be the , where the same in both cases. However, in the scipy implementation the Wasserstein distance is zero in both cases also.

Edit: This question was closed without an explanation and despite an upvote.

Thankfully, I found the answer here: https://stackoverflow.com/questions/57402842/why-is-the-wasserstein-distance-between-0-1-and-1-0-zero — I also asked on stackoverflow before asking here and have clarified things there, but in short, the Wasserstein distance from scipy does NOT calculate the distance between two distributions P(A) and P(B) where A and B have the same support but different probabilities for each state; rather, it calculates the difference between different samples of a single distribution.

I want to use the Wasserstein distance from scipy.stats.wasserstein_distance to get a measure for the difference between two probability distribution. However, I do not understand how the support matters here.

For example, I would have expected stats.wasserstein_distance([0,1,0],[1,0,0]) to be 1 (as we need to move a mass of weight 1 by a distance of 1), however it is 0. Why is this?

I know this is related to this question: what does the Wasserstein distance between two distributions quantify.

My understanding is that the Wasserstein distance is the earth-movers distance; thus, it would be that it is able to show a further distance between delta-function like probability distributions where the peaks are not aligned but further apart - eg, the difference between distributions of two variables with cardinality four [1,0,0,0] and [0,0,1,0] should be higher than between distributions [1,0,0,0] and [0,1,0,0]. The Jensen-Shannon divergence would be the , where the same in both cases. However, in the scipy implementation the Wasserstein distance is zero in both cases also.

Edit: This question was closed without an explanation and despite an upvote.

Thankfully, I found the answer here: https://stackoverflow.com/questions/57402842/why-is-the-wasserstein-distance-between-0-1-and-1-0-zero — I also asked on stackoverflow before asking here and have clarified things there, but in short, the Wasserstein distance from scipy does NOT calculate the distance between two distributions P(A) and P(B) where A and B have the same support but different probabilities for each state; rather, it calculates the difference between different samples of a single distribution.

Edit 2: You can use the scipy implementation for this but need to use the weights. Summary is here: https://stackoverflow.com/questions/76049158/wasserstein-distance-in-scipy-definition-of-support/76061410#76061410

added 442 characters in body
Source Link
mzzx
  • 123
  • 5

I want to use the Wasserstein distance from scipy.stats.wasserstein_distance to get a measure for the difference between two probability distribution. However, I do not understand how the support matters here.

For example, I would have expected stats.wasserstein_distance([0,1,0],[1,0,0]) to be 1 (as we need to move a mass of weight 1 by a distance of 1), however it is 0. Why is this?

I know this is related to this question: what does the Wasserstein distance between two distributions quantify. 

My understanding is that the Wasserstein distance is the earth-movers distance; thus, it would be that it is able to show a further distance between delta-function like probability distributions where the peaks are not aligned but further apart - eg, the difference between distributions of two variables with cardinality four [1,0,0,0] and [0,0,1,0] should be higher than between distributions [1,0,0,0] and [0,1,0,0]. The Jensen-Shannon divergence would be the , where the same in both cases. However, in the scipy implementation the Wasserstein distance is zero in both cases also. Is this incorrect or what am I misunderstanding?

Edit: (IThis question was closed without an explanation and despite an upvote.

Thankfully, I found the answer here: https://stackoverflow.com/questions/57402842/why-is-the-wasserstein-distance-between-0-1-and-1-0-zero — I also asked on stackoverflow before asking here and have clarified things there, but realized that maybe crossvalidated isin short, the better community for this questionWasserstein distance from scipy does NOT calculate the distance between two distributions P(A) and P(B) where A and B have the same support but different probabilities for each state; rather, it calculates the difference between different samples of a single distribution.

I want to use the Wasserstein distance from scipy.stats.wasserstein_distance to get a measure for the difference between two probability distribution. However, I do not understand how the support matters here.

For example, I would have expected stats.wasserstein_distance([0,1,0],[1,0,0]) to be 1 (as we need to move a mass of weight 1 by a distance of 1), however it is 0. Why is this?

I know this is related to this question: what does the Wasserstein distance between two distributions quantify. My understanding is that the Wasserstein distance is the earth-movers distance; thus, it would be that it is able to show a further distance between delta-function like probability distributions where the peaks are not aligned but further apart - eg, the difference between distributions of two variables with cardinality four [1,0,0,0] and [0,0,1,0] should be higher than between distributions [1,0,0,0] and [0,1,0,0]. The Jensen-Shannon divergence would be the , where the same in both cases. However, in the scipy implementation the Wasserstein distance is zero in both cases also. Is this incorrect or what am I misunderstanding? (I also asked on stackoverflow but realized that maybe crossvalidated is the better community for this question)

I want to use the Wasserstein distance from scipy.stats.wasserstein_distance to get a measure for the difference between two probability distribution. However, I do not understand how the support matters here.

For example, I would have expected stats.wasserstein_distance([0,1,0],[1,0,0]) to be 1 (as we need to move a mass of weight 1 by a distance of 1), however it is 0. Why is this?

I know this is related to this question: what does the Wasserstein distance between two distributions quantify. 

My understanding is that the Wasserstein distance is the earth-movers distance; thus, it would be that it is able to show a further distance between delta-function like probability distributions where the peaks are not aligned but further apart - eg, the difference between distributions of two variables with cardinality four [1,0,0,0] and [0,0,1,0] should be higher than between distributions [1,0,0,0] and [0,1,0,0]. The Jensen-Shannon divergence would be the , where the same in both cases. However, in the scipy implementation the Wasserstein distance is zero in both cases also.

Edit: This question was closed without an explanation and despite an upvote.

Thankfully, I found the answer here: https://stackoverflow.com/questions/57402842/why-is-the-wasserstein-distance-between-0-1-and-1-0-zero — I also asked on stackoverflow before asking here and have clarified things there, but in short, the Wasserstein distance from scipy does NOT calculate the distance between two distributions P(A) and P(B) where A and B have the same support but different probabilities for each state; rather, it calculates the difference between different samples of a single distribution.

added 253 characters in body
Source Link
mzzx
  • 123
  • 5

I want to use the Wasserstein distance from scipy.stats.wasserstein_distance to get a measure for the difference between two probability distribution. However, I do not understand how the support matters here.

For example, I would have expected stats.wasserstein_distance([0,1,0],[1,0,0]) to be 1 (as we need to move a mass of weight 1 by a distance of 1), however it is 0. Why is this?

I know this is related to this question: what does the Wasserstein distance between two distributions quantify but different as I am asking specifically about the support. In particular, I thought the advantage ofMy understanding is that the Wasserstein distance is the earth-movers distance; thus, it would be that it is able to show a further distance between delta-function like probability distributions where the peaks are not aligned but further apart - eg, the difference between distributions of two variables with cardinality four [1,0,0,0] and [0,0,1,0] should be higher than between distributions [1,0,0,0] and [0,1,0,0]. The Jensen-Shannon divergence would be the , where JS is the same in both cases; howevercases. However, this does not seem to be true in the scipy implementation the Wasserstein distance is zero in both cases also. Is this incorrect or what am I misunderstanding? (I also asked on stackoverflow but realized that maybe crossvalidated is the better community for this question)

I want to use the Wasserstein distance from scipy.stats.wasserstein_distance to get a measure for the difference between two probability distribution. However, I do not understand how the support matters here.

For example, I would have expected stats.wasserstein_distance([0,1,0],[1,0,0]) to be 1 (as we need to move a mass of weight 1 by a distance of 1), however it is 0. Why is this?

I know this is related to this question: what does the Wasserstein distance between two distributions quantify but different as I am asking specifically about the support. In particular, I thought the advantage of the Wasserstein distance would be that it is able to show a further distance between distributions [1,0,0,0] and [0,0,1,0] than between distributions [1,0,0,0] and [0,1,0,0], where JS is the same in both cases; however, this does not seem to be true in the scipy implementation. (I also asked on stackoverflow but realized that maybe crossvalidated is the better community for this question)

I want to use the Wasserstein distance from scipy.stats.wasserstein_distance to get a measure for the difference between two probability distribution. However, I do not understand how the support matters here.

For example, I would have expected stats.wasserstein_distance([0,1,0],[1,0,0]) to be 1 (as we need to move a mass of weight 1 by a distance of 1), however it is 0. Why is this?

I know this is related to this question: what does the Wasserstein distance between two distributions quantify. My understanding is that the Wasserstein distance is the earth-movers distance; thus, it would be that it is able to show a further distance between delta-function like probability distributions where the peaks are not aligned but further apart - eg, the difference between distributions of two variables with cardinality four [1,0,0,0] and [0,0,1,0] should be higher than between distributions [1,0,0,0] and [0,1,0,0]. The Jensen-Shannon divergence would be the , where the same in both cases. However, in the scipy implementation the Wasserstein distance is zero in both cases also. Is this incorrect or what am I misunderstanding? (I also asked on stackoverflow but realized that maybe crossvalidated is the better community for this question)

Post Closed as "Needs details or clarity" by Xi'an, User1865345, Shawn Hemelstrand
Source Link
mzzx
  • 123
  • 5
Loading