= 1, 2, \ldots,$ then $U_g(w)$ can be rewritten as, $$U_g(w) = \int \left[\int_{(x,y)} u(\hat Y_w(x), y)dP(x,y)\right]dQ.$$ Changing the order of integration, $$U_g(w) = \int_{(x,y)} u(\hat Y_w(x), y) dP_0(x,y),$$ where $P_0$ is the mean of $Q$, i.e. $P_0(\cdot) = \int P(\cdot)dQ$.

When $\pi = P_0$, we can use $\nu_k = 1/K$ for $k = 1,\ldots, K$ in expression (\[eq:U-est\]) to approximate $U_g(w)$. Note that in several applications the sequence $P_1,P_2\ldots$ may not be exchangeable. For example, it can be better modeled by a Markov Chain [@shumway2017time] i.e. $P_k|P_1,\ldots,P_{k-1} = P_k|P_{k-1}$. Throughout this manuscript we will not need to specify the model $Q$, but we will assume the exchangeability of the sequence $P_1,P_2,\ldots$.

Specialist prediction
---------------------

In this case, the target population distribution $\pi$ coincides with $P_k$, for a single $k \in \{1, 2, \ldots , K\}$. The expected utility of a specialist prediction function is $$U_s(w;k) = U(w; P_k) = \int_{(x,y)} u(\hat Y_w(x), y)dP_k(x,y).$$ We can use the empirical distribution of study $k$ to estimate $P_k$, and the implied specification of $\nu$ in (\[eq:U-est\]) is $\nu_i = 1$ for $i = k$ and 0 otherwise.

Generalist and specialist stacking
==================================

We use stacking for generalist and specialist predictions in multi-study 