Distance between two functions

15 visualizaciones (últimos 30 días)
Tyler
Tyler el 28 de Mzo. de 2017
Comentada: Tyler el 29 de Mzo. de 2017
I'm creating multiple probability density functions (pdfs), comprised of x and y values, and would like to compare these to another given pdf (each one has the same number of points). Would something as simple as a dot product be sufficient? Or should I use a Euclidean distance, where I find the distance between each of the points and take the square root of the sum of their squares? This is mainly to compare them to see how similar they are. I need a standard metric to compare them all evenly against the same pdf to find which ones are similar and which aren't.
Thanks!

Respuesta aceptada

John D'Errico
John D'Errico el 28 de Mzo. de 2017
Editada: John D'Errico el 28 de Mzo. de 2017
Asking someone else to make a decision like this, if any metric is sufficient is a problem. After all, this is your work, your thesis, your paper you might decide to write. Only you can make the decision, because it is you who needs to defend the answer. At best, you might choose to ask your thesis advisor or your boss, whatever. And of course, their word would then control what you do. But to say that you made a decision because so-and-so online told you to do it, well, that would never fly.
Of course, there are some "standard" methods to compute the distance between two functions. However you do this, you would be creating a norm, a metric on the vector space of the functions involved.
You mention a dot product. A dot product does not directly measure the difference between elements of vector spaces. It can be used to define a norm. Thus if u and v are two vectors or two functions, then we can write
sqrt(dot(u-v,u-v))
as a standard Euclidean norm of the difference between them. In the guise of vectors, this is simply computed using dot products, but it is more simply computed with norm, thus norm(u-v). If u and v are truly functions, then the computation requires an integral in theory.
These are of course different things, because one is an integration. Simply taking the norm of the difference of two vectors if they represent functions (I.e., the sqrt of the sum of squares of differences between vectors) is equivalent to using rectangle rule to compute the integral in question. That may be sufficient for your purposes, or it may not. Again, the person to make the decision is you, along with your supervisor.
You might choose to use a more sophisticated measure. But then you might be just wasting your time and effort. TALK TO YOUR SUPERVISOR.
To me, an important question is, how accurately are these PDFs known? Can the simple norm of vector differences as described above adequately resolve any differences between PDFs? Note that if two PDFs are identical, measured on the same support, then the norm of the difference between vectors will be zero. Functions or not, then if your only measurement is the same set of numbers, then the norm must be zero. Were the support of your PDFs different, then you would need to use something more sophisticated to resolve the difference. This is clear.
A problem with computing a simple norm is that norm does not really deal with the difference in terms of PDFs. But here where PDFs are concerned, statistics may come to your aid, in the form of the Kolmogorov-Smirnov test . In the stats toolbox, this is implemented in kstest2, testing if you may reject the hypothesis that two PDFs are the same. A virtue of kstest2 is it tries to assign a p-value to the difference, instead of simply returning a number as a norm of a difference. Were it me, I would strongly consider this option, but I'm not doing your job, nor can I.
So, no matter what, you need to discuss this with whoever must help you make the decisions. If you are doing this work on your own, perhaps to write a paper or for whatever purpose, and therefore you have no supervisor, then it all comes down to your own judgment, NOT ours, not anyone online. Again, you will be the one who must defend your decision.
  1 comentario
Tyler
Tyler el 29 de Mzo. de 2017
Thanks John, it helps to know what some options are for this.

Iniciar sesión para comentar.

Más respuestas (1)

John BG
John BG el 28 de Mzo. de 2017
Hi Tyler
AGILENT now KEYSIGHT Vector Signal Analysis Application Note AN150
includes introductory explanation to VECTOR ERROR MEASUREMENTS on IQ (your x and y dimensions) modulated signals.
EVM is a robust way to measure errors in vector signals like the many probability density functions you are working with.
SIMULINK version R2017a already comes with an example to precisely measure EVM
EVM Measurement SIMULINK block reference
regards
John BG

Categorías

Más información sobre Test Execution en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by