I am doing research on problems of location of a public facility on a network which lead me to the following question.
Is there an interesting way to characterize the class of functions $f : \mathbb{R}^{n+1} \rightarrow \mathbb{R}$ such that for every $p_n \in \mathbb{R}^n$, the median of the coordinates of $p_n$, $m(p_n) \in {\arg\min}_{c\in \mathbb{R}} ~~f(|p^n - c|)$, where $|p_n -c| = (|p_1 - c|, \dots, |p_n - c|)$.
To avoid technical complications in the definition of the median, let's assume that $n$ is odd so that the median is naturally defined as the coordinate $p_i$ of $p_n$ ($i\in \{1,\dots,n\}$) such that $\#\{ p_j $ with $ j\in \{1,\dots,n\} : p_j \leq p_i\} = \frac{n +1 }{2}$ and $\#\{ p_j $ with $ j\in \{1,\dots,n\} : p_j \geq p_i\} = \frac{n +1 }{2}$, where $\#$ denotes the cardinality of the following set.
If a characterization is too hard to obtain, a list of salient properties such $f$'s must satisfy would also be of great interest to me.
What I have got so far
Some examples
- As is known in the literature on public facility location (and not hard to obtain), the function $S(|p^n - c|) = \sum_{i=1}^{n} |p_i - c|$ satisfies the above property.
- So does any affine
affine transformationmonotonic transformation of $S$. - Another class of functions trivially satisfy the property : those functions which are always equal to zero when $|p_i - c|=0$ for some $i$, hence when $c = m(p_n)$. Examples are $P(|p^n - c|) = \Pi_{i=1}^{n} |p_i - c|$ and $M(|p^n - c|) = \min_{p_i} |p_i - c|$.
Clarification follow the answer from user96614
The approach proposed in user96614's answer is the one I had been investigating. I prevented myself from thinking in differentiable terms, but I was also considering small variation around the median. I should have added it my original post, sorry. My actual question (maybe hard to guess from my post, I admit) revolved around finding an alternative characterization of such functions. So I was looking for a (ideally exhaustive) set of easy to check properties which would be necessary for the function to satisfy the property (e.g. convexity, subbaditivity,...)
An intermediary question
- I have tried to determined whether it is possible for a function which is not an affine
affine transformationmonotonic transformation of $S$ or a "trivial" function which equals zero as soon as $|p_i - c|=0$ for some $i\in \{1,\dots,n\}$ to satisfy the above property. My intuition is that it is (close to be?) the case. But neither have I been able to find an example, nor to prove it was not possible to find such example.