1. ## Correlation problem

Hi all,
I'm struggling with a problem, I can't really think of any tool that could help me, or where to start.

I'm trying to find a function that will give a number by providing a vector. For the following vectors the results should be something like :

v1 (5,19,23) -> x
v2 (4,20,24) -> y
v3 (5,19,87685) -> x+ε1
v4 (5,19,236,820,109772,937) -> x+ε2

with ε1 << ε2

First, i thought about using norms but the problem with the euclidian norm or other classical norms is that v1 and v2 will have a similar result which i don't want.

The main idea is that each number in a vector is linked to an object. Similar objects can have completely different index. My final goal is to determine which objects are similar. For instance, by comparing v1 and v3, since the result is similar and since they both contain 5 and 19, I could state that 87685 and 23 are similar.

Thanks a lot for your help.

2. ## Re: Correlation problem

Hey justafinger.

If your values are integers, you might want to create a spiral function that winds itself around and around in a 2D or 3D way and then your final value will be the distance of the point in terms of how far along the spiral is.

3. ## Re: Correlation problem

Unfortunately, i'm not sure this really answered my issue or maybe i haven't really understood what you meant.
I found a solution but the problem was a bit more complex than i thought. I used cosine similarity as suggested on a french forum.

Since it is a programming issue, i generated random coordinates in a 2D map for each index.
Each vector now represents a polygon and i used cosine similarity to state which polygons are similar (based for instance on the position of the center and its size).

With another algorithm i gather the points that are linked with a vector, it helps me to state which index are similar.

4. ## Re: Correlation problem

What I mean by the spiral is that you start at some point and given a lattice (basically a set of points on a x/y graph that are equally space in terms of x and y co-ordinates), and then you draw a rectangular spiral.

Something like this: