7 votes
Accepted

Converting distance matrix back into original data

This is more generally known as the distance geometry problem where we are trying to reconstruct data points given distances between all or some of the points with respect to some distance metric. A ...
Tyberius's user avatar
  • 1,023
6 votes
Accepted

Minimize distance between curves

Let's assume you have a set of abscissas $x_i$ and two sets of function values on these grid points $f_i, g_i$ representing the functions $f$ and $g$. As mentioned in the comments, you'll need a model ...
davidhigh's user avatar
  • 3,127
5 votes

Approximating the boundary between two sets of points (in 2D): Fitting a region

Theory Clustering is unlikely to work in this case because your red points are separated from each other by the green points. You could use more clusters, but this will require a lot of manual ...
Richard's user avatar
  • 3,961
4 votes
Accepted

What are the Exact Rules for Significant Figures, Precision, and Uncertainty?

The rules of significant figures are rule-of-thumb way to communicate errors and should only be seen as a primite first step to talk about uncertainties and measurement errors. You gave the excellent ...
MPIchael's user avatar
  • 2,862
3 votes

Total distance between points on a grid

If I understand the questions correctly, you have the following situation. Be $S=\{x_1,\ldots,x_n\}$ the set of points. You need to calculate the total distance $d_t$of $S$, defined as$$d_t=\sum_{j=1}^...
Bort's user avatar
  • 1,285
3 votes

Approximating the boundary between two sets of points (in 2D): Fitting a region

I don't know if the following is a good idea. But it is an idea, and I hope that it helps. This problem can be recast to "find a function $f: \mathbb{R}^2\to \mathbb{R}$ and $z\in\mathbb{R}$ s.t. ...
Abdullah Ali Sivas's user avatar
3 votes
Accepted

Compute distances from a vector to a matrix of vectors

This is going to be an IO-bound operation, so there is little practical advantage in looking for alternative formulations. There are two things you can do to speed that up: choose the order of ...
Federico Poloni's user avatar
2 votes
Accepted

Fast and Numerically Stable Pairwise Distance Algorithms

I would strongly advise against using the method 2: $$\|A_i - B_j\|_2^2 = \langle A_i - B_j, A_i - B_j \rangle = \|A_i\|_2^2 + \|B_j\|_2^2 - 2 \langle A_i, B_j \rangle.$$ whether you are uing the ...
Anton Menshov's user avatar
  • 8,652
2 votes
Accepted

Calculate average distance between pairs of points without computing full distance matrix

You can do this in $\mathcal{O}(N)$ time (and memory) using a fast multipole algorithm that can handle nondecaying kernel functions such as the distance function $d(\mathbf{x},\mathbf{y})=|\mathbf{x}-\...
coolguy1000000's user avatar
2 votes
Accepted

Finding weighted average of curves

I promised you an answer in the other question, and was just about to edit it in. Now I see you spend another 100 points as a bounty ... seems quite a serious topic to you. I'll post my promised ...
davidhigh's user avatar
  • 3,127
2 votes

Fitting 2D mapping data from multiple measurements

If you know that you have $n$ points $X_1,...,X_n$ and the desired pairwise distances $d_{ij}$ between $X_i$ and $X_j$ you could try and optimize the functional $$ \sum_{i<j} (d_{ij}-|X_i-X_j|)^2$$ ...
Beni Bogosel's user avatar
  • 1,035
2 votes

Minimize distance between curves

Here is a simple solution. Find the curve $(x_m, y_m)$ with the largest domain $x$. In your case it is (x2, y2). Assign it to be the main curve and shift all other ...
Vladislav Gladkikh's user avatar
1 vote

Minimize distance between curves

Taking a function as reference $f_r$ the scale-translation transformations for each remaining functions can be handled by minimizing $$ E(a,b,r) = \sum_{k\ne r}^{m}\sum_{j=1}^n \left(f_k(j)a_k+b_k - ...
Cesareo's user avatar
  • 166
1 vote

Place points at maximum distance in a convex 2D set

Giving a region $\Omega(p)$ and a set of $n$ points $p_i,\ i = 1,\cdots, n$ the problem can be stated as a maximization one. $$ \max\left(\min_{i\ne j} \|p_i-p_j\|\right),\ \ \text{such that}\ \ \...
Cesareo's user avatar
  • 166
1 vote

Calculate average distance between pairs of points without computing full distance matrix

When calculating averages, you can iterate through all point connections and carry a counter, and the sum of the distances. You can overwrite any individual distance with the new ones. That way your ...
MPIchael's user avatar
  • 2,862
1 vote
Accepted

Using two reference values for a scalar variable: What's the name of this type of problem?

Have you thought of barycentric coordinates? There is a unique way to write $x=\alpha A + \beta B$ with $\alpha+\beta=1$. Barycentric coordinates are usually employer in larger dimensions, but seem ...
Joce's user avatar
  • 362
1 vote

Algorithm to construct all distances of a system described by $3N-6$ distances

Similar to Berth's suggestion, you could fix one atom and try to minimize the function $$g(f)=\sum_{(i,j)\in G}\left[d(f_i,f_j)^2 -d_{ij}^2\right]^2$$ where $f$ is a matrix of 3D coords. This function ...
deasmhumnha's user avatar
1 vote

Algorithm to construct all distances of a system described by $3N-6$ distances

Assuming you can live with an approximate solution: you can re-formulate the problem as a graph embedding (or metric embedding) problem. Your $N$ atoms $a_1,\dots,a_N$ are the vertices (nodes) of a ...
Matthias Berth's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible