Risk averse Bayesian optimization with environmental variables
This notebook considers risk averse Bayesian optimization of objectives , where denotes the design variable and denotes the environmental variable. The design variable is fully controlled by the practitioner, however, the environmental variable is only controllable at the experimentation phase and is determined by the environment once the decision is implemented, according to some probability distribution. In this setting, with the denoting the random environmental variable, the objective we want to optimize becomes a random function, written as , whose value is determined only once the environmental variable is realized. This formulation is relevant whenever we need to make a decision to be implemented in an unknown future environment, and we can simulate the environment during the optimization phase.
For this problem setting, [1] proposes to optimize a risk measure of the random function, written as , where denotes a risk measure, which is a functional that maps a random variable (in this case induced by ) to a real number. They propose the KG acquisition function, which extends the well-known knowledge-gradient acquisition function, and requires access to posterior mean of the objective, i.e., , where the expectation is taken over the sample paths of the GP model. Unlike the posterior mean of the function , the posterior mean of the risk measure is not available in closed-form and needs to be estimated via sampling. The procedure for estimating for a given is as follows:
- Draw a set of
n_w
samples of according to the probability distribution. Let's call thisw_set
. - Append each in
w_set
to the given to get pairs. Note that for a single , we now haven_w
pairs of . - Draw samples from the joint posterior distribution of these
n_w
pairs of . Note that the joint distribution here is ann_w
-dimensional Gaussian distribution. - Calculate the empirical risk measure corresponding to each sample, converting each
n_w
-dimensional posterior sample to a scalar sample of the risk measure. - Take the average of these risk measure samples to get the Monte-Carlo estimate of the posterior mean of the risk measure.
Now that the background is established, we are ready to implement a one-shot version of the