# Online Experiment Design¶

## Fully Adaptive Optimization¶

The information gathered by updates of a posterior distribution, such as the
updates generated by the SMC approximation, can be used to inform the choice
of future experiments. The `ExperimentDesigner`

encapsulates and
automates this process by designing experiments that minimize an objective
function

where \(r(\vec{e})\) is the Bayes risk (see [GFWC12]), \(C(\vec{e})\)
is a cost function describing the cost associated with each experiment and where
\(k\) is a parameter describing how much we are willing to pay for
reductions in risk. In QInfer, the cost function is specified as the
`experiment_cost()`

method of
the `Simulatable`

class under study.

## Heuristics¶

As opposed to fully optimizing the utility of an experiment, it can be
substantially less expensive to use a *heuristic* function of prior information
to select experiments without explicit simulation. As an example, in [WGFC13a],
the *particle guess heuristic* (PGH) was used to design quantum Hamiltonian
learning experiments without incurring additional simulation costs.

**QInfer** exposes these heuristics though subclasses of `Heuristic`

,
such as `PGH`

, which create experiment parameter arrays given the
prior information exposed by an `SMCUpdater`

instance.