如何从距离矩阵计算原始向量?
我有一个关于向量和矩阵的小问题。
假设向量 V = {v1, v2, ..., vn}。我生成一个 n×n 距离矩阵 M 定义为:
M_ij = | v_i - v_j |使得 i,j 属于 [1, n]。
也就是说,方阵中的每个元素M_ij是V中两个元素的绝对距离。
例如,我有一个向量V = {1,3,3,5},距离矩阵将是 米=[ 0 2 2 4; 2 0 0 2; 2 0 0 2; 4 2 2 0; ]
看起来很简单。现在到了问题所在。给定这样一个矩阵M,如何获得初始V?
谢谢。
根据这个问题的一些答案,似乎答案并不唯一。因此,现在假设所有初始向量已归一化为 0 均值和 1 方差。问题是:给定这样一个对称距离矩阵M,如何确定初始归一化向量?
I have a small question about vector and matrix.
Suppose a vector V = {v1, v2, ..., vn}. I generate a n-by-n distance matrix M defined as:
M_ij = | v_i - v_j | such that i,j belong to [1, n].
That is, each element M_ij in the square matrix is the absolute distance of two elements in V.
For example, I have a vector V = {1, 3, 3, 5}, the distance matrix will be
M=[
0 2 2 4;
2 0 0 2;
2 0 0 2;
4 2 2 0; ]
It seems pretty simple. Now comes to the question. Given such a matrix M, how to obtain the initial V?
Thank you.
Based on some answer for this question, it seems that the answer is not unique. So, now suppose that all the initial vector has been normalized to 0 mean and 1 variance. The question is: Given such a symmetric distance matrix M, how to decide the initial normalized vector?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你不能。为了让您了解原因,请考虑以下两种情况:
如您所见,单个 M 可能是多个 V 的结果。因此,您无法向后映射。
You can't. To give you an idea of why, consider these two cases:
As you can see, a single M could be the result of more than one V. Therefore, you can't map backwards.
没有办法唯一地确定答案,因为距离矩阵对于向所有元素添加一个常数以及将所有值乘以 -1 是不变的。但是,假设元素 1 等于 0,并且第一个非零元素为正,您可以找到答案。这是伪代码:
There is no way to determine the answer uniquely, since the distance matrix is invariant to adding a constant to all elements and to multiplying all the values by -1. Assuming that element 1 is equal to 0, and that the first nonzero element is positive, however, you can find an answer. Here is the pseudocode:
我认为不可能找到原始向量,但您可以通过获取矩阵的第一行来找到向量的翻译。
如果让 M_ij = | v_i - v_j |然后将所有 v_k 翻译为 k\in [1,n] 你会得到
M_ij = | vi + 1 - v_j + 1 |
= | v_i - v_j |
因此,只需将第一行作为向量并找到一个初始点将向量平移到其中。
更正:
按顺序对 k\in [2,n] 中的所有 v_k 执行此操作将显示每个 v_k 相对于其他 v_k 的奇偶性
然后您可以找到具有相同或相反方向更新的原始向量的平移
(对于标准化向量):
I don't think it is possible to find the original vector, but you can find a translation of the vector by taking the first row of the matrix.
If you let M_ij = | v_i - v_j | and you translate all v_k for k\in [1,n] you will get
M_ij = | v-i + 1 - v_j + 1 |
= | v_i - v_j |
Hence, just take the first row as the vector and find one initial point to translate the vector to.
Correction:
doing this for all v_k for k\in [2,n] in order will show the parity of each v_k in respect to the others
Then you can find a translation of the original vector with the same or opposite direction
Update (For Normalized vector):