Determine similarity of a sequence of [-1, 1] pairs?

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Let's say there are 5 questions, and the answer to each one can be between -1 and 1.
Two people are answering these questions, so they each have a vector of their answers. Example:
[ -.3, 0, .95, -.94, .4 ]
[ .3, .7, .9, 1, -.3 ]
How do I find how similar they are in total? Probably as a single number representing their total answer similarity (-1 being complete opposite and 1 being the same?)
Is it just the dot product? Or is there another/better way?
linear-algebra statistics vectors
add a comment |Â
up vote
1
down vote
favorite
Let's say there are 5 questions, and the answer to each one can be between -1 and 1.
Two people are answering these questions, so they each have a vector of their answers. Example:
[ -.3, 0, .95, -.94, .4 ]
[ .3, .7, .9, 1, -.3 ]
How do I find how similar they are in total? Probably as a single number representing their total answer similarity (-1 being complete opposite and 1 being the same?)
Is it just the dot product? Or is there another/better way?
linear-algebra statistics vectors
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Let's say there are 5 questions, and the answer to each one can be between -1 and 1.
Two people are answering these questions, so they each have a vector of their answers. Example:
[ -.3, 0, .95, -.94, .4 ]
[ .3, .7, .9, 1, -.3 ]
How do I find how similar they are in total? Probably as a single number representing their total answer similarity (-1 being complete opposite and 1 being the same?)
Is it just the dot product? Or is there another/better way?
linear-algebra statistics vectors
Let's say there are 5 questions, and the answer to each one can be between -1 and 1.
Two people are answering these questions, so they each have a vector of their answers. Example:
[ -.3, 0, .95, -.94, .4 ]
[ .3, .7, .9, 1, -.3 ]
How do I find how similar they are in total? Probably as a single number representing their total answer similarity (-1 being complete opposite and 1 being the same?)
Is it just the dot product? Or is there another/better way?
linear-algebra statistics vectors
asked Aug 23 at 2:25
Chron Bag
83
83
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
The most intuitive metric I can think of for this context is the Euclidean (i.e. sum of squares) distance between the vectors. That is, the distance between $(x_1,dots,x_5)$ and $(y_1,dots,y_5)$ is given by
$$
d = sqrtsum_k=1^5 (x_k - y_k)^2
$$
Notably, the least $d$ can be is $0$, and the most $d$ can be is $2 sqrt5$. If you'd like your measure to fall between $-1$ and $1$, you could define
$$
D = 1 - fracdsqrt5 = 1 - sqrtfracsum_k=1^5 (x_k - y_k)^25
$$
we will have $D = 1$ when the vectors are identical, and $D = -1$ when the vectors are "opposite".
Thanks this helps a lot! I think this is what I'm looking for.
â Chron Bag
Aug 23 at 2:40
The only other thing I am wondering is if there would be a way to make the equation more efficient (square roots are expensive!), although that might be another question. (It's going to be a bottleneck in a computer program most likely)
â Chron Bag
Aug 23 at 2:44
You could always just use $$ D = 1 - fracsum_k=1^5 (x_k - y_k)^25 $$ This quantity doesn't correspond to the literal distance between vectors anymore so we lose some nice properties, but it does what you need it to do.
â Omnomnomnom
Aug 23 at 2:55
Cool thanks! (chars)
â Chron Bag
Aug 23 at 3:02
You're welcome!
â Omnomnomnom
Aug 23 at 3:03
 |Â
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The most intuitive metric I can think of for this context is the Euclidean (i.e. sum of squares) distance between the vectors. That is, the distance between $(x_1,dots,x_5)$ and $(y_1,dots,y_5)$ is given by
$$
d = sqrtsum_k=1^5 (x_k - y_k)^2
$$
Notably, the least $d$ can be is $0$, and the most $d$ can be is $2 sqrt5$. If you'd like your measure to fall between $-1$ and $1$, you could define
$$
D = 1 - fracdsqrt5 = 1 - sqrtfracsum_k=1^5 (x_k - y_k)^25
$$
we will have $D = 1$ when the vectors are identical, and $D = -1$ when the vectors are "opposite".
Thanks this helps a lot! I think this is what I'm looking for.
â Chron Bag
Aug 23 at 2:40
The only other thing I am wondering is if there would be a way to make the equation more efficient (square roots are expensive!), although that might be another question. (It's going to be a bottleneck in a computer program most likely)
â Chron Bag
Aug 23 at 2:44
You could always just use $$ D = 1 - fracsum_k=1^5 (x_k - y_k)^25 $$ This quantity doesn't correspond to the literal distance between vectors anymore so we lose some nice properties, but it does what you need it to do.
â Omnomnomnom
Aug 23 at 2:55
Cool thanks! (chars)
â Chron Bag
Aug 23 at 3:02
You're welcome!
â Omnomnomnom
Aug 23 at 3:03
 |Â
show 1 more comment
up vote
1
down vote
accepted
The most intuitive metric I can think of for this context is the Euclidean (i.e. sum of squares) distance between the vectors. That is, the distance between $(x_1,dots,x_5)$ and $(y_1,dots,y_5)$ is given by
$$
d = sqrtsum_k=1^5 (x_k - y_k)^2
$$
Notably, the least $d$ can be is $0$, and the most $d$ can be is $2 sqrt5$. If you'd like your measure to fall between $-1$ and $1$, you could define
$$
D = 1 - fracdsqrt5 = 1 - sqrtfracsum_k=1^5 (x_k - y_k)^25
$$
we will have $D = 1$ when the vectors are identical, and $D = -1$ when the vectors are "opposite".
Thanks this helps a lot! I think this is what I'm looking for.
â Chron Bag
Aug 23 at 2:40
The only other thing I am wondering is if there would be a way to make the equation more efficient (square roots are expensive!), although that might be another question. (It's going to be a bottleneck in a computer program most likely)
â Chron Bag
Aug 23 at 2:44
You could always just use $$ D = 1 - fracsum_k=1^5 (x_k - y_k)^25 $$ This quantity doesn't correspond to the literal distance between vectors anymore so we lose some nice properties, but it does what you need it to do.
â Omnomnomnom
Aug 23 at 2:55
Cool thanks! (chars)
â Chron Bag
Aug 23 at 3:02
You're welcome!
â Omnomnomnom
Aug 23 at 3:03
 |Â
show 1 more comment
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The most intuitive metric I can think of for this context is the Euclidean (i.e. sum of squares) distance between the vectors. That is, the distance between $(x_1,dots,x_5)$ and $(y_1,dots,y_5)$ is given by
$$
d = sqrtsum_k=1^5 (x_k - y_k)^2
$$
Notably, the least $d$ can be is $0$, and the most $d$ can be is $2 sqrt5$. If you'd like your measure to fall between $-1$ and $1$, you could define
$$
D = 1 - fracdsqrt5 = 1 - sqrtfracsum_k=1^5 (x_k - y_k)^25
$$
we will have $D = 1$ when the vectors are identical, and $D = -1$ when the vectors are "opposite".
The most intuitive metric I can think of for this context is the Euclidean (i.e. sum of squares) distance between the vectors. That is, the distance between $(x_1,dots,x_5)$ and $(y_1,dots,y_5)$ is given by
$$
d = sqrtsum_k=1^5 (x_k - y_k)^2
$$
Notably, the least $d$ can be is $0$, and the most $d$ can be is $2 sqrt5$. If you'd like your measure to fall between $-1$ and $1$, you could define
$$
D = 1 - fracdsqrt5 = 1 - sqrtfracsum_k=1^5 (x_k - y_k)^25
$$
we will have $D = 1$ when the vectors are identical, and $D = -1$ when the vectors are "opposite".
answered Aug 23 at 2:34
Omnomnomnom
122k784170
122k784170
Thanks this helps a lot! I think this is what I'm looking for.
â Chron Bag
Aug 23 at 2:40
The only other thing I am wondering is if there would be a way to make the equation more efficient (square roots are expensive!), although that might be another question. (It's going to be a bottleneck in a computer program most likely)
â Chron Bag
Aug 23 at 2:44
You could always just use $$ D = 1 - fracsum_k=1^5 (x_k - y_k)^25 $$ This quantity doesn't correspond to the literal distance between vectors anymore so we lose some nice properties, but it does what you need it to do.
â Omnomnomnom
Aug 23 at 2:55
Cool thanks! (chars)
â Chron Bag
Aug 23 at 3:02
You're welcome!
â Omnomnomnom
Aug 23 at 3:03
 |Â
show 1 more comment
Thanks this helps a lot! I think this is what I'm looking for.
â Chron Bag
Aug 23 at 2:40
The only other thing I am wondering is if there would be a way to make the equation more efficient (square roots are expensive!), although that might be another question. (It's going to be a bottleneck in a computer program most likely)
â Chron Bag
Aug 23 at 2:44
You could always just use $$ D = 1 - fracsum_k=1^5 (x_k - y_k)^25 $$ This quantity doesn't correspond to the literal distance between vectors anymore so we lose some nice properties, but it does what you need it to do.
â Omnomnomnom
Aug 23 at 2:55
Cool thanks! (chars)
â Chron Bag
Aug 23 at 3:02
You're welcome!
â Omnomnomnom
Aug 23 at 3:03
Thanks this helps a lot! I think this is what I'm looking for.
â Chron Bag
Aug 23 at 2:40
Thanks this helps a lot! I think this is what I'm looking for.
â Chron Bag
Aug 23 at 2:40
The only other thing I am wondering is if there would be a way to make the equation more efficient (square roots are expensive!), although that might be another question. (It's going to be a bottleneck in a computer program most likely)
â Chron Bag
Aug 23 at 2:44
The only other thing I am wondering is if there would be a way to make the equation more efficient (square roots are expensive!), although that might be another question. (It's going to be a bottleneck in a computer program most likely)
â Chron Bag
Aug 23 at 2:44
You could always just use $$ D = 1 - fracsum_k=1^5 (x_k - y_k)^25 $$ This quantity doesn't correspond to the literal distance between vectors anymore so we lose some nice properties, but it does what you need it to do.
â Omnomnomnom
Aug 23 at 2:55
You could always just use $$ D = 1 - fracsum_k=1^5 (x_k - y_k)^25 $$ This quantity doesn't correspond to the literal distance between vectors anymore so we lose some nice properties, but it does what you need it to do.
â Omnomnomnom
Aug 23 at 2:55
Cool thanks! (chars)
â Chron Bag
Aug 23 at 3:02
Cool thanks! (chars)
â Chron Bag
Aug 23 at 3:02
You're welcome!
â Omnomnomnom
Aug 23 at 3:03
You're welcome!
â Omnomnomnom
Aug 23 at 3:03
 |Â
show 1 more comment
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2891629%2fdetermine-similarity-of-a-sequence-of-1-1-pairs%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password