A minimzation problem in L^2 involving Poisson random variables

Let us assume that gi:V→R,i=1,…,Kg_i: V \rightarrow \mathbb{R}, i=1,\dots,K (VV is subspace of L2L^2), g:ˉV→Rg: \bar{V} \rightarrow \mathbb{R}, where ˉV⊂V\bar{V} \subset V and Pi\mathcal{P}_i are Poisson random variables. I want to to solve this minimization problem
mingi∈VE[∣∣K∑i=1Pi(ai)(gi−g)∣∣2L2],\begin{align}
\underset{g_i \in V}{min} \: E\left[\mid \mid \sum_{i=1}^{K} \mathcal{P}_i(a_i) (g_i-g)\mid \mid_{L^{2}}^2\right],
\end{align}

One way I thought about it is that I may show that it sufficient to solve
mingi∈V∣∣K∑i=1(gi−g)∣∣2L2,\begin{align}
\underset{g_i \in V}{min} \: \mid \mid \sum_{i=1}^{K} (g_i-g)\mid \mid_{L^{2}}^2,
\end{align}
if I assume that ai≈a_i\approx constante, ∀i=1,…,K\forall i=1,\dots,K. But I am not able yet to prove it formally, any hint?

=================

=================

=================