# Bayesian experimental design

Bayesian experimental design provides a general probability-theoretical framework from which other theories on experimental design can be derived. It is based on Bayesian inference to interpret the observations/data acquired during the experiment. This allows accounting for both any prior knowledge on the parameters to be determined as well as uncertainties in observations.
The theory of Bayesian experimental design is to a certain extent based on the theory for making optimal decisions under uncertainty. The aim when designing an experiment is to maximize the expected utility of the experiment outcome. The utility is most commonly defined in terms of a measure of the accuracy of the information provided by the experiment (e.g., the Shannon information or the negative of the variance) but may also involve factors such as the financial cost of performing the experiment. What will be the optimal experiment design depends on the particular utility criterion chosen.

## Relations to more specialized optimal design theory
### Linear theory

If the model is linear, the prior probability density function (PDF) is homogeneous and observational errors are normally distributed, the theory simplifies to the classical optimal experimental design theory.

### Approximate normality

In numerous publications on Bayesian experimental design, it is (often implicitly) assumed that all posterior probabilities will be approximately normal. This allows for the expected utility to be calculated using linear theory, averaging over the space of model parameters. Caution must however be taken when applying this method, since approximate normality of all possible posteriors is difficult to verify, even in cases of normal observational errors and uniform prior probability.

### Posterior distribution

In many cases, the posterior distribution is not available in closed form and has to be approximated using numerical methods. The most common approach is to use Markov chain Monte Carlo methods to generate samples from the posterior, which can then be used to approximate the expected utility.
Another approach is to use a variational Bayes approximation of the posterior, which can often be calculated in closed form. This approach has the advantage of being computationally more efficient than Monte Carlo methods, but the disadvantage that the approximation might not be very accurate.
Some authors proposed approaches that use the posterior predictive distribution to assess the effect of new measurements on prediction uncertainty, while others suggest maximizing the mutual information between parameters, predictions and potential new experiments.

## Mathematical formulation

Notation :
| $\theta \,$ | parameters to be determined |
| $y\,$ | observation or data |
| $\xi \,$ | design |
| $p(y\mid \theta ,\xi )\,$ | PDF for making observation $y$, given parameter values $\theta$ and design $\xi$ |
| $p(\theta )\,$ | prior PDF |
| $p(y\mid \xi )\,$ | marginal PDF in observation space |
| $p(\theta \mid y,\xi )\,$ | posterior PDF |
| $U(\xi )\,$ | utility of the design $\xi$ |
| $U(y,\xi )\,$ | utility of the experiment outcome after observation $y$ with design $\xi$ |
Given a vector $\theta$ of parameters to determine, a prior probability $p(\theta )$ over those parameters and a likelihood $p(y\mid \theta ,\xi )$ for making observation $y$, given parameter values $\theta$ and an experiment design $\xi$, the posterior probability can be calculated using Bayes' theorem
    $p(\theta \mid y,\xi )={\frac {p(y\mid \theta ,\xi )p(\theta )}{p(y\mid \xi )}}\,,$
where $p(y\mid \xi )$ is the marginal probability density in observation space
    $p(y\mid \xi )=\int p(\theta )p(y\mid \theta ,\xi )\,d\theta \,.$
The expected utility of an experiment with design $\xi$ can then be defined
    $U(\xi )=\int p(y\mid \xi )U(y,\xi )\,dy,$
where $U(y,\xi )$ is some real-valued functional of the posterior probability $p(\theta \mid y,\xi )$ after making observation $y$ using an experiment design $\xi$.

### Gain in Shannon information as utility

Utility may be defined as the prior-posterior gain in Shannon information
    $U(y,\xi )=\int \log(p(\theta \mid y,\xi ))\,p(\theta |y,\xi )\,d\theta -\int \log(p(\theta ))\,p(\theta )\,d\theta \,.$
Another possibility is to define the utility as
    $U(y,\xi )=D_{KL}(p(\theta \mid y,\xi )\|p(\theta ))\,,$
the Kullback–Leibler divergence of the prior from the posterior distribution. Lindley (1956) noted that the expected utility will then be coordinate-independent and can be written in two forms
    ${\begin{alignedat}{2}U(\xi )&=\int \int \log(p(\theta \mid y,\xi ))\,p(\theta ,y\mid \xi )\,d\theta \,dy-\int \log(p(\theta ))\,p(\theta )\,d\theta \\&=\int \int \log(p(y\mid \theta ,\xi ))\,p(\theta ,y\mid \xi )\,dy\,d\theta -\int \log(p(y\mid \xi ))\,p(y\mid \xi )\,dy,\end{alignedat}}\,$
of which the latter can be evaluated without the need for evaluating individual posterior probability $p(\theta \mid y,\xi )$ for all possible observations $y$. It is worth noting that the second term on the second equation line will not depend on the design $\xi$, as long as the observational uncertainty doesn't. On the other hand, the integral of $p(\theta )\log p(\theta )$ in the first form is constant for all $\xi$, so if the goal is to choose the design with the highest utility, the term need not be computed at all. Several authors have considered numerical techniques for evaluating and optimizing this criterion. Note that
    $U(\xi )=I(\theta ;y)\,,$
the expected information gain being exactly the mutual information between the parameter θ and the observation y. An example of Bayesian design for linear dynamical model discrimination is given in Bania (2019). Since $I(\theta ;y)\,,$ was difficult to calculate, its lower bound has been used as a utility function. The lower bound is then maximized under the signal energy constraint. Proposed Bayesian design has been also compared with classical average D-optimal design. It was shown that the Bayesian design is superior to D-optimal design.
The Kelly criterion also describes such a utility function for a gambler seeking to maximize profit, which is used in gambling and information theory; Kelly's situation is identical to the foregoing, with the side information, or "private wire" taking the place of the experiment.