# Active Data Selection and Information Seeking
## 4 Function Approximation
\begin{table}
\begin{tabular}{l l l} \hline
**Prior** & **Likelihood** & **Expected Information Gain** \\ \hline \(s\sim Cat(\mathbf{s})\) & \(o|s,\pi\) & \(l[\pi]^{s}=diag(\mathbf{A}(\pi)\cdot\ln\mathbf{A}(\pi))\cdot\mathbf{s}\) \\  & \(\sim Cat(\mathbf{A}(\pi)s)\) & \(-(\mathbf{A}(\pi)s)\cdot\ln(\Lambda(\pi)s)\) \\ \hline \(\mathbf{A}\sim Dir(\mathbf{a})\) & \(o|\mathbf{A},\pi\) & \(l[\pi]^{\mathbf{A}}\approx\frac{1}{2}\sum\
olimits_{i}(\psi(\mathbf{a}_{i\pi})- \psi(\sum_{i}\mathbf{a}_{i\pi}))\) \\  & \(\sim Cat(\mathbf{A}\pi)\) & \(\times\Big{(}\mathbf{a}_{i\pi}^{-1}-(\sum_{i}\mathbf{a}_{i\pi})^{-1}\Big{)}\) \\ \hline \(x\sim\mathcal{N}(\eta,\Sigma_{x})\) & \(y|x,\pi\) & \(l[\pi]^{x}=\frac{1}{2}\ln\Big{(}M(\pi)\Sigma_{x}M(\pi)^{T}+\Sigma_{y}(\pi) \Big{)}\) \\  & \(\sim\mathcal{N}(M(\pi)x,\Sigma_{y}(\pi))\) & \(-\frac{1}{2}\ln\Sigma_{y}(\pi)\) \\ \hline \end{tabular} \({}^{*}\)_Cat_ indicates a categorical distribution, \(Dir\) a Dirichlet distribution, and \(\psi\) indicates a digamma function. See Appendix B of [26] for details of the approximation used in the expected information gain in the second row.  
\end{table} 
Table 1: Expected information gain \({}^{*}\). one another (circled in red). Intuitively, we would expect that for any (smooth) function, it will almost always be preferable to sample locations far away from one another, as some uncertainty will have been resolved by samples nearby. This is where the information gain becomes relevant. Substituting Equation (7) into Equation (3), we have  
Figure 3: Function approximation with random sampling. The upper part of this figure illustrates the generative model schematically in terms of a Bayesian network. Here, a set of 16 parameters with zero-centred normally distributed priors weight the columns of a matrix of Gaussian basis functions (only three are shown in the schematic). The action we choose when generating our data selects which row of the matrix is used to generate that outcome. The middle-left panel shows the result of taking 200 or so samples from the underlying function that we seek to approximate. The middle-right panel shows the predictive distribution following the final (28 th) sequential sample—shown as a blue dot—in terms of mode and 90% credible intervals. The lower-left panel shows the posterior parameter modes and 90% credible intervals, while the lower-right panel shows the sequence of choices (from top to bottom) aligned with the \(x\)-axis of the plot above. The red circle samples illustrate redundant or inefficient sampling under this random scheme. \[I[\pi]^{\theta}=\frac{1}{2}\ln\Bigl{(}\phi_{\pi}\Sigma_{\theta}\phi_{\pi}^{T}+ \Sigma_{y}\Bigr{)}-\frac{1}{2}\ln\Sigma_{y} \tag{10}\]  
Figure 4 shows the same set-up as in Figure 3, but now samples are drawn from a distribution whose log is proportional to the information gain in Equation (10). During each iteration, a sample location is chosen from this distribution (a large proportionality constant makes this almost deterministic; i.e., the location with the highest information gain is almost always chosen). A datapoint is then sampled from the generative model under this choice. This is then used to update priors to posteriors using Equation (9). The process is then repeated up to 28 iterations. Figure 4: Function approximation with intelligent sampling. This figure uses the same format as Figure 3, but now each choice is sampled to maximise anticipated information gain. Note the more accurate approximation to the region between \(-100\) and \(-50\) in the middle-right panel. The \(\alpha\) (i.e., precision or inverse temperature) parameter here is set to 64 to ensure almost deterministic sampling of the most informative locations. Unlike the random sampling, it is not until late in the simulation that we revisit a previously sampled location. The implication is that we can achieve better inferences with the same, or perhaps even a smaller, number of samples when we select these samples in a smart way. This raises the question as to how many samples we should collect.