Computing $E[\max(a^T x, 0)]$ where $x$ is uniformly random on the unit simplex For a given vector $a$, suppose $x$ is a random vector generated uniformly from the unit simplex (meaning that that $x$ is generated randomly from the set of vectors which are nonnegative and sum to $1$). My question is: what is $$E[\max(a^T x, 0)]?$$
That is, can I compute this quantity in some other way that generating a lot of samples?
When $a$ is a nonnegative vector, this is obviously the average of the entries in $a$. On the other hand, when $a$ has some negative entries there seems to be a lot of different ways for this quantity to be negative, and I'm not sure what the expectation is.
 A: Let $x$ be a random variable living on the d-dimensional unit simplex $\mathcal{S}^d$ (i.e. the set $\{x\in\mathbb{R}^d:x_i\geq 0,\,i=1,\dots,d \mbox{ and }\sum_{i=1}^dx_i=1\}$ 
\begin{eqnarray}
\mathbb{E}[\max(a^Tx,0)]&=&\vert a\vert\mathbb{E}\left[\max\left(\frac{a^T}{\vert a\vert}x, 0\right)\right]
\end{eqnarray}
from linear algebra we know that for a unit vector $n$ the quantity $n^Tx$ is equal to the minimal distance of a point $x$ to the Hyperplane, whose normal is given by $n$. This means the above expression is equal to the average (in the sense of the distribution of $x$) distance of points in the simplex $\mathcal{S}^d$ intersected with the halfspace $\mathcal{H}(a):=\{x\in\mathbb{R}^d :a^Tx\geq 0 \}$.
To compute this (we recap the proof in "the volume cut off a simplex by a half-space" by L. Gerber(1981)) first compute the integral of $a^Tx$ on the entire simplex:
\begin{eqnarray}
\mathbb{E}(a^Tx)&=&\frac{1}{v(\mathcal{S}^d)}\int_{\mathcal{S}^d}a^Txdx
\\
&=&\frac{1}{v(\mathcal{S}^d)}\int_0^{y_1}\int_0^{1-y_1}\cdots\int_0^{1-y_1-y_2-\cdots y_{d-1}}(a_1x_1+\cdots +a_dx_d)dx_d dx_{d-1}\cdots dx_d
\end{eqnarray}
where $v(\mathcal{S}^d)$ is the volume of the unit simplex. The above can be integrated (as a polynomial on a compact set) you will get an iterated difference
$$=\frac{1}{n!}D\{x,a_1,\dots,a_d\}$$
where D is defined iteratively as 
\begin{eqnarray}
&&D\{f(x);a_1,a_2\}=\frac{f(a_1)-f(a_2)}{a_1-a_2}
\\
&&D\{f(x);a_1,\dots,a_k\}=\frac{D\{f(x);a_1,a_{k-1}\}-D\{f(x);a_2,\cdots,a_{k}\}}{x_1-x_k}
\\
&&\mbox{and in the case }a_1=a_k
\\
&&D\{f(x);a_1,\dots,a_k\}=\frac{\partial}{\partial a_1}D\{f(x);a_1,a_{k-1}\}
\end{eqnarray}
Next, note that integrating $f(x)=\min(c+bx,0)$ or $g(x)=\max(c+bx,0)$ follows the same rules as integrating reular polynomials, i.e
$$\int f(x)^p dx=\frac{1}{p}f(x)^{p+1}+\mbox{const}.$$Therefore you get from the computation of the $\mathbb{E}(a^Tx)$ also $$\mathbb{E}(\max(a^Tx,0))=\frac{1}{n!}D\{\max(x,0);a_1,\dots,a_d\}.$$ 
