<p>I believe the problem is likely NP-hard and thus the complexity is likely super-polynomial.</p>
<p>The problem is roughly equivalent to finding a linear classifier with maximum accuracy, i.e., minimizing the 0-1 loss.  (The difference is the latter chooses a threshold for prediction and counts the number of correct predictions, examining each single sample in isolation, whereas your objective function looks at correct relationships between pairs of samples.)  Finding a linear classifier that minimizes the 0-1 loss is known to be NP-hard.</p>
<p>An ILP is a reasonable approach if you need the exact global optimum.  In the worst case you can expect its asymptotic running time to be exponential.  In practice, asymptotic worst-case complexity is not likely to be a useful measure, if you want to use that in practice; instead, it is probably more effective to empirically measure performance on typical problem instances.</p>
<p>In classification, a standard trick is to substitute some other loss (e.g., the hinge loss) in place of the 0-1 loss and then optimize that.  That isn't necessarily the optimal solution for your original objective function, but it often leads to a &quot;pretty good&quot; solution.  You could also try that, assuming it's not critical to have the exact optimum, and instead you want a more efficient algorithm.</p>
<p>I couldn't find the papers you are referring to that discuss a <span class="math-container">$O(n^2 \log n)$</span> time algorithm (links are broken or the papers are paywalled) but I presume the approaches you cite don't give a global optimal solution to the problem.  That seems consistent with the discussion of related work in the 2020 paper, e.g., with prior methods, &quot;we are not sure whether the current solution is the global optimum&quot;, &quot;the fundamental local solution issue still remains&quot;, etc.</p>

CC BY-SA 4.0
2023-07-24T18:46:41.730Z
On your last sentence, for the 2020 paper (giving the global solution using MIP) I linked to arxiv
kara890
CC BY-SA 4.0
2023-07-24T18:58:53.653Z
@kara890, see revised answer.  I wasn't referring to that paper.
D.W.
CC BY-SA 4.0
2023-07-24T18:37:56.703Z
2023-07-24T18:58:45.803Z
2023-07-24T18:58:45.803Z
D.W.
<p>Given two sets of vectors of dimension <span class="math-container">$p$</span>, <span class="math-container">$x_1,\ldots,x_m$</span> and <span class="math-container">$y_1,\ldots,y_n$</span>, The Maximum Rank Correlation estimator is the vector <span class="math-container">$\beta$</span> given by <span class="math-container">$$\arg\max_{b\in\mathbb{R}^p}\sum_{i=1}^m\sum_{j=1}^n 1(b^t x &lt; b^t y).$$</span> According to <a href="https://stats.stackexchange.com/a/9527/138422">this old post</a>, the fastest algorithms to compute <span class="math-container">$\beta$</span> run in <span class="math-container">$n^2\log(n)$</span> time. However, a <a href="https://arxiv.org/pdf/2009.03844.pdf" rel="nofollow noreferrer">2020 paper</a> uses mixed integer programming to compute beta, noting that &quot;MIP is still an NP(non-deterministic polynomial-time)-hard problem&quot;. Perhaps in saying that the fastest algorithms run in  <span class="math-container">$n^2\log(n)$</span> time the old stackexchange post was referring to an algorithm for an approximate, not necessarily global solution. For example, the paper cited in the answer to the old stackexchange post, Wang 2007, does not necessarily compute the argmax: &quot;the [Nelder-Mead] algorithm and the proposed IMO algorithm share one common limitation. That is there exists no solid theory, which can guarantee the maximizer identified by either of them is indeed the global maximizer. In fact, they are very likely to be just a local maximizer.&quot;</p>
<p>What is in fact the complexity in the numbers <span class="math-container">$m,n$</span> of the input vectors, of computing <span class="math-container">$\beta$</span>, and is it related to some other better studied problem? I posted a <a href="https://stats.stackexchange.com/questions/621983/routines-for-mrc-estimator">related question</a> on the statistics Stackexchange a few day ago but didn't get any replies.</p>

CC BY-SA 4.0
2023-07-24T17:40:23.093Z
What exactly is the problem statement?  Please [edit] your post to state precisely what problem you want solved.  Do you want the global optimum for $\beta$?  If so talking about estimators is confusing.  Or do you want an estimate/approximation to the global optimum?  Or do you want a local optimum?  Or an algorithm that will often be good-enough in practice?  Each of those alternatives (other than the global optimum) has follow-up questions to define what precisely that means.
D.W.
CC BY-SA 4.0
2023-07-24T17:40:59.350Z
The "old post" you link to has citations to two papers -- have you read them?  Can you summarize them and their relevance?  We expect you to do that kind of research before asking and to provide that background for readers.
D.W.
CC BY-SA 4.0
2023-07-24T18:24:54.257Z
@D.W. I made some clarifications and added the relevant information from the (relevant) cited paper in the old stackexchange post.
kara890
<cc.complexity-theory>
complexity of the maximum rank correlation
kara890
# complexity of the maximum rank correlation

(Asked by: username_0 on 2023-07-24)

Given two sets of vectors of dimension $p$, $x\_1,\ldots,x\_m$ and $y\_1,\ldots,y\_n$, The Maximum Rank Correlation estimator is the vector $\beta$ given by $$\arg\max\_{b\in\mathbb{R}^p}\sum\_{i=1}^m\sum\_{j=1}^n 1(b^t x < b^t y).$$ According to [this old post](https://stats.stackexchange.com/a/9527/138422), the fastest algorithms to compute $\beta$ run in $n^2\log(n)$ time. However, a [2020 paper](https://arxiv.org/pdf/2009.03844.pdf) uses mixed integer programming to compute beta, noting that "MIP is still an NP(non-deterministic polynomial-time)-hard problem". Perhaps in saying that the fastest algorithms run in $n^2\log(n)$ time the old stackexchange post was referring to an algorithm for an approximate, not necessarily global solution. For example, the paper cited in the answer to the old stackexchange post, Wang 2007, does not necessarily compute the argmax: "the [Nelder-Mead] algorithm and the proposed IMO algorithm share one common limitation. That is there exists no solid theory, which can guarantee the maximizer identified by either of them is indeed the global maximizer. In fact, they are very likely to be just a local maximizer."

What is in fact the complexity in the numbers $m,n$ of the input vectors, of computing $\beta$, and is it related to some other better studied problem? I posted a [related question](https://stats.stackexchange.com/questions/621983/routines-for-mrc-estimator) on the statistics Stackexchange a few day ago but didn't get any replies.

**Tags:** cc.complexity-theory

> **Comments:**
> **username_1**: What exactly is the problem statement?  Please [edit] your post to state precisely what problem you want solved.  Do you want the global optimum for $\beta$?  If so talking about estimators is confusing.  Or do you want an estimate/approximation to the global optimum?  Or do you want a local optimum?  Or an algorithm that will often be good-enough in practice?  Each of those alternatives (other than the global optimum) has follow-up questions to define what precisely that means.  
> **username_1**: The "old post" you link to has citations to two papers -- have you read them?  Can you summarize them and their relevance?  We expect you to do that kind of research before asking and to provide that background for readers.  
> **username_0**: @username_1 I made some clarifications and added the relevant information from the (relevant) cited paper in the old stackexchange post.  

---

## 1 answers

### Answer by username_1 on 2023-07-24. Score: -1

I believe the problem is likely NP-hard and thus the complexity is likely super-polynomial.

The problem is roughly equivalent to finding a linear classifier with maximum accuracy, i.e., minimizing the 0-1 loss. (The difference is the latter chooses a threshold for prediction and counts the number of correct predictions, examining each single sample in isolation, whereas your objective function looks at correct relationships between pairs of samples.) Finding a linear classifier that minimizes the 0-1 loss is known to be NP-hard.

An ILP is a reasonable approach if you need the exact global optimum. In the worst case you can expect its asymptotic running time to be exponential. In practice, asymptotic worst-case complexity is not likely to be a useful measure, if you want to use that in practice; instead, it is probably more effective to empirically measure performance on typical problem instances.

In classification, a standard trick is to substitute some other loss (e.g., the hinge loss) in place of the 0-1 loss and then optimize that. That isn't necessarily the optimal solution for your original objective function, but it often leads to a "pretty good" solution. You could also try that, assuming it's not critical to have the exact optimum, and instead you want a more efficient algorithm.

I couldn't find the papers you are referring to that discuss a $O(n^2 \log n)$ time algorithm (links are broken or the papers are paywalled) but I presume the approaches you cite don't give a global optimal solution to the problem. That seems consistent with the discussion of related work in the 2020 paper, e.g., with prior methods, "we are not sure whether the current solution is the global optimum", "the fundamental local solution issue still remains", etc.

> **Comments:**
> **username_0**: On your last sentence, for the 2020 paper (giving the global solution using MIP) I linked to arxiv  
> **username_1**: @username_0, see revised answer.  I wasn't referring to that paper.  

---

