how to efficiently calculate matrix distances
up vote
0
down vote
favorite
given a number of Actors A (1..n)
and a number of Subjects S (1..m)
and a number of Positions P (1..o)
and each actor can have one position on one subject P (a,s)
and each position can be expressed as an integer,
so that with 5 Actors and 3 Subjects the 15 Positions may look like this:
$$X=left[begin{array}{ccccc}1&1&-1&0&0\2&-3&0&0&1\2&-3&0&0&-1end{array}right]$$
Now if the distance between 2 positions is defined as D (p1,p2)=abs (p1-p2)
I'm trying to rank the subjects (here: horizontal) based on the average distance between all actors' positions on that subject.
On software, I could simply loop all subjects, foreach subject, loop all actors, foreach actor, calc the distance to all other actors. Sum it up and average that.
But it doesnt feel efficient. for example, if actor X has a distance D to actor Y, then Y has a distance D to X too; and if actor Z has a distance 0 to actor Y, then X must have a distance D to Z, too. Just looping the whole set will make these redundant calculations.
Is there a more efficient way to rank the subjects based on the average distances between the actors ? I'm hoping for some matrix operators to do this.
matrix-rank
add a comment |
up vote
0
down vote
favorite
given a number of Actors A (1..n)
and a number of Subjects S (1..m)
and a number of Positions P (1..o)
and each actor can have one position on one subject P (a,s)
and each position can be expressed as an integer,
so that with 5 Actors and 3 Subjects the 15 Positions may look like this:
$$X=left[begin{array}{ccccc}1&1&-1&0&0\2&-3&0&0&1\2&-3&0&0&-1end{array}right]$$
Now if the distance between 2 positions is defined as D (p1,p2)=abs (p1-p2)
I'm trying to rank the subjects (here: horizontal) based on the average distance between all actors' positions on that subject.
On software, I could simply loop all subjects, foreach subject, loop all actors, foreach actor, calc the distance to all other actors. Sum it up and average that.
But it doesnt feel efficient. for example, if actor X has a distance D to actor Y, then Y has a distance D to X too; and if actor Z has a distance 0 to actor Y, then X must have a distance D to Z, too. Just looping the whole set will make these redundant calculations.
Is there a more efficient way to rank the subjects based on the average distances between the actors ? I'm hoping for some matrix operators to do this.
matrix-rank
Jahoo! I got the Tumbleweed badge on this !
– commonpike
Nov 25 at 14:13
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
given a number of Actors A (1..n)
and a number of Subjects S (1..m)
and a number of Positions P (1..o)
and each actor can have one position on one subject P (a,s)
and each position can be expressed as an integer,
so that with 5 Actors and 3 Subjects the 15 Positions may look like this:
$$X=left[begin{array}{ccccc}1&1&-1&0&0\2&-3&0&0&1\2&-3&0&0&-1end{array}right]$$
Now if the distance between 2 positions is defined as D (p1,p2)=abs (p1-p2)
I'm trying to rank the subjects (here: horizontal) based on the average distance between all actors' positions on that subject.
On software, I could simply loop all subjects, foreach subject, loop all actors, foreach actor, calc the distance to all other actors. Sum it up and average that.
But it doesnt feel efficient. for example, if actor X has a distance D to actor Y, then Y has a distance D to X too; and if actor Z has a distance 0 to actor Y, then X must have a distance D to Z, too. Just looping the whole set will make these redundant calculations.
Is there a more efficient way to rank the subjects based on the average distances between the actors ? I'm hoping for some matrix operators to do this.
matrix-rank
given a number of Actors A (1..n)
and a number of Subjects S (1..m)
and a number of Positions P (1..o)
and each actor can have one position on one subject P (a,s)
and each position can be expressed as an integer,
so that with 5 Actors and 3 Subjects the 15 Positions may look like this:
$$X=left[begin{array}{ccccc}1&1&-1&0&0\2&-3&0&0&1\2&-3&0&0&-1end{array}right]$$
Now if the distance between 2 positions is defined as D (p1,p2)=abs (p1-p2)
I'm trying to rank the subjects (here: horizontal) based on the average distance between all actors' positions on that subject.
On software, I could simply loop all subjects, foreach subject, loop all actors, foreach actor, calc the distance to all other actors. Sum it up and average that.
But it doesnt feel efficient. for example, if actor X has a distance D to actor Y, then Y has a distance D to X too; and if actor Z has a distance 0 to actor Y, then X must have a distance D to Z, too. Just looping the whole set will make these redundant calculations.
Is there a more efficient way to rank the subjects based on the average distances between the actors ? I'm hoping for some matrix operators to do this.
matrix-rank
matrix-rank
edited Nov 25 at 14:24
asked Nov 15 at 13:42
commonpike
1012
1012
Jahoo! I got the Tumbleweed badge on this !
– commonpike
Nov 25 at 14:13
add a comment |
Jahoo! I got the Tumbleweed badge on this !
– commonpike
Nov 25 at 14:13
Jahoo! I got the Tumbleweed badge on this !
– commonpike
Nov 25 at 14:13
Jahoo! I got the Tumbleweed badge on this !
– commonpike
Nov 25 at 14:13
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2999709%2fhow-to-efficiently-calculate-matrix-distances%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Jahoo! I got the Tumbleweed badge on this !
– commonpike
Nov 25 at 14:13