Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We all know there are distance functions, like Kullback Leibler distance, Bhattacharyya measure, Euclidean distance, Wasserstein distance, and so on. Take a sample distance: $D=\sum\limits_n\left|P_n\left(\text{model}\right)-P_n\left(\text{sample}\right)\right|$. Specifically, if we have a model distribution (probability density function)$P\left(\text{model}\right)=[0.2,0.8]$, $n=2$, we want to calculate the distance between every sample distribution and this model distribution. If sample distribution is $P\left(\text{sample}1\right)=[0.3,0.7]$. Then $D=\left|0.3-0.2\right|+\left|0.7-0.8\right|=0.2$. But I do not think it is a good distance measure since I think $0.8$ and $0.7$ are more similar than $0.2$ and $0.3$. What I mean is in model distribution, one component is 0.8, another is 0.2, same difference $a$ has more influence in 0.2 since 0.8 is quite big than 0.2. So the weight of components are different. How should I incorporate weight into distance equation? I try to make a equation , like $D=\sum\limits_n\frac{\left|P_n\left(\text{model}\right)-P_n\left(\text{sample}\right)\right|}{P_n\left(\text{model}\right)}$, But it seems to be wrong.

share|cite|improve this question
I, personally, do not know there are distance functions like Kullback Leibler distance, Bhattacharyya distance, etc., etc. – Gerry Myerson Aug 2 '11 at 5:57
Somewhat related... but more of an interesting (imo) aside, "Psychological studies found that mathematically unsophisticated individuals tend to estimate quantities logarithmically" – Tyler Aug 2 '11 at 5:59
@ Gerry Myerson,hi, Thank you for your comment. I add two links about these two terms. – Heather Aug 2 '11 at 6:50
What the best distance is, will largely depend on the application you need it for. – Raskolnikov Aug 2 '11 at 6:52
I am pointing out that we don't all know these things, since I am a part of "we" and I never heard of any of them (except Euclidean distance). – Gerry Myerson Aug 2 '11 at 7:07
up vote 1 down vote accepted

Try with

$$D=\sum\limits_n \frac{\left(P_n \left(\text{model}\right)-P_n \left(\text{sample}\right)\right)^2}{P_n \left(\text{model}\right)} \; .$$

This is used in many statistical tests and is known to be approximately $\chi^2$-distributed.

share|cite|improve this answer
I tried this one. Get a one websit, I will check it. I hopt weight problem can be solved. – Heather Aug 2 '11 at 9:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.