Sorting data tables based on trends - With linear algebra

29 Views Asked by At

Assume that you have $y$ series of data. Each data set is $n$ length long. Example:

$$X_1 = x_{1,1}, x_{1,2}, x_{1,3}, x_{1,4}, x_{1,5}, x_{1,6}, x_{1,7}, \dots , x_{1, n}$$ $$X_2 = x_{2,1}, x_{2,2}, x_{2,3}, x_{2,4}, x_{2,5}, x_{2,6}, x_{2,7}, \dots , x_{2, n}$$ $$X_3 = x_{3,1}, x_{3,2}, x_{3,3}, x_{3,4}, x_{3,5}, x_{3,6}, x_{3,7}, \dots , x_{3, n}$$ $$X_4 = x_{4,1}, x_{4,2}, x_{4,3}, x_{4,4}, x_{4,5}, x_{4,6}, x_{4,7}, \dots , x_{4, n}$$ $$\vdots$$ $$X_y = x_{y,1}, x_{y,2}, x_{y,3}, x_{y,4}, x_{y,5}, x_{y,6}, x_{y,7}, \dots , x_{y, n}$$

And each $x$ is described with a number, negative or positive. My aim is to find a method that can find which serie has a trend that goes up, like the beginning of the data set. What kind of method can this be?

I have an idea. What if I sort all series by checking which serie has most positive numbers to the left. But I don't know if that works. To do so, then linear algebra must be applied.

Example:

If you had to sort this data table and you are only allowed to move the rows up and down. You goal is to sort this table so you have so many green squares to the left. How would you do that? Can you use linear algebra for this?

enter image description here