Data-Driven Conditional Robust Optimization
Abstract
In this paper, we study a novel approach for data-driven decision-making under uncertainty in the presence of contextual information.
Speciﬁcally, we address this problem using a new Conditional Robust Optimization (CRO) paradigm that seeks the solution of a robust optimization problem where the uncertainty set accounts for the most recent side information provided by a set of covariates.
We propose an integrated framework that designs the conditional uncertainty set by jointly learning a partition in the covariate data space and simultaneously constructing region speciﬁc deep uncertainty sets for the random vector that perturbs the CRO problem.
We also provide theoretical guarantees for the coverage provided by conditional uncertainty sets and for the value at risk performances obtained using the proposed CRO model.
Finally, we use simulated and real world data to illustrate the implementation of our approach and compare it against two non-contextual robust optimization benchmark approaches to demonstrate the value of exploiting contextual information in robust optimization.
Introduction
In most real world decision problems, the decision maker (DM) faces uncertainty either in the objective function that he aims to optimize or some of the constraints that he needs to satisfy.
Stochastic Programming and Robust Optimization (RO) are the most popular methods for addressing this type of issue.
With the growing availability of data, there has recently been a surge of interest in modeling optimization under uncertainty as contextual optimization problems that seek to leverage rich feature observations to make better decisions [Ban and Rudin, 2019, Bertsimas and Kallus, 2020].
In a simple cost minimization problem, where X ⊆ R n and c ( x, ξ ) respectively capture the feasible set of actions and a cost that depends on both the action x and a random perturbation vector ξ ∈ R m , the “contextual” DM has access to a vector of covariates ψ ∈ R m assumed to be correlated to ξ .
This
DM therefore traditionally wishes to identify an optimal policy, i.e. a functional x : R m → X that suggests an action in X adapted to the observed realization of ψ , with respect to his expected cost over the joint distribution of ( ψ, ξ ) :
[Equation]
From a theoretical point of view, one can exploit the interchangeability property (see Theorem 14.60, [Rockafellar and Wets, 2009]) to identify an optimal policy for Problem (1) using the following conditional stochastic optimization (CSO) problem:
[Equation]
While the literature that treats contextual optimization through the CSO problem is rich, much less attention has been given to contextual optimization in the risk averse setting.
Namely, one can easily think about replacing the risk neutral expected value operator in problem (2) with a risk measure such as value-at-risk or conditional value-at-risk in order to prevent the DM from being exposed to the possibility of large costs.
Moreover, while robust optimization is being used pervasively in disciplines that employ decision models, including chemical, civil, electrical engineering, medecine, and physics (see respectively [Bernardo and Saraiva, 1998, Bendsøe et al., 1994, Mani et al., 2006,
Chu et al., 2005, Bertsimas et al., 2007]) to name a few, the question of how to systematically integrate contextual information in this important class of decision models remains to this day unexplored.
In this work, we therefore tackle for the ﬁrst time the contextual optimization problem from the point of view of robust optimization.
Namely, we will consider a contextual DM that wishes to exploit the side information in the design and solution of a robust optimization problem.
This naturally gives rise to the following conditional robust optimization (CRO) problem
[Equation]
where U ( ψ ) is an uncertainty set designed to contain with high probability the realization of ξ conditionally on observing ψ .
Our proposed approach will be data-driven in the sense that the design of the CRO problem will make use of historical observations of joint realizations of ψ and ξ .
Our contribution can be summarized as follows.
• We propose for the ﬁrst time a framework for learning from data an uncertainty set for RO that adapts to side information.
The “training” of this conditional uncertainty set is done by jointly learning a partition in the covariate data space using deep clustering methods, and simultaneously constructing region speciﬁc deep uncertainty sets, using techniques from one-class classiﬁcation, for the random vector that perturbs the CRO problem.
• We establish theoretical connections between CRO and Contextual Value-at-Risk Optimization (CVO [Equation]
[Equation]
where VaR 1 − ε ( Z ) :
= inf { t | P ( Z ≤ t ) ≥ 1 − ε } refers to the value-at-risk of 1 − ε conﬁdence level of Z .
We demonstrate empirically that contextual robust optimization can improve the performance of robust optimization models in a data-driven portfolio optimization problem that employs real world data from the US stock market.
In particular, we ﬁnd that in conditions where side information carries a strong signal about future returns, the risk of the portfolio can be reduced by up to 15%.
The paper is organized as follows.
Section 2 surveys related work.
Section 3 summarizes the approach discussed in [Goerigk and Kurtz, 2020].
Section 4 presents a Deep Cluster then Classify (DCC) scheme and our Integrated Deep Cluster then Classify (IDCC) scheme to generate conditional uncertainty sets.
It also establishes the connections to CVO.
Our case study based on real world portfolio optimization is presented in section 5 followed by conclusions in section 6.
Related work
Conditional Stochastic Optimization [Hannah et al., 2010] was possibly the earliest work on CSO, where a kernel density estimation approach is exploited to formulate and solve a CSO problem. [Ban and Rudin, 2019] apply CSO to a newsvendor optimization problem where the performance of linear policies and kernel density estimation is explored and where generalization error can be controlled using regularization.
[Kallus and Mao, 2020] studied methods to train forest decision policies for CSO in a way that directly targets the optimization costs.
[Ban et al., 2019] use residual tree methods to solve general multi-stage stochastic programs where information about the underlying uncertainty is available through covariate information.
[Kannan et al., 2020a] propose data-driven
SAA frameworks for approximating the solution to two-stage stochastic programs with access to a ﬁnite number of samples of random variables and concurrently observed covariates.
Recently, Lin et al.
[2022] has applied a conditional VaR constrained CSO formulation to the newsvendor problem.
While most of the related work focuses on an “estimate-then-optimize” approach (see also [Srivastava et al., 2021b] and [Hu et al., 2022]), there has also been recent efforts in designing CSO models using an end-to-end paradigm (see [Elmachtoub and Grigas, 2022] and [Donti et al., 2017]).
Distributionally robust CSO One common challenge with the applications of CSO is due to the fact that often there is only a few sample (if any at all) drawn from the conditional distribution of ξ given ψ for each realization of ψ [Hu et al., 2020].
This in turns causes a poor approximation of the true conditional distribution resulting in poor out-of-sample performance.
Most proposed solutions to this issue have relied on distributionally robust optimization (DRO).
For example, [Bertsimas and
Van Parys, 2021], [Bertsimas et al., 2022, Nguyen et al., 2021], and [Srivastava et al., 2021a] all propose DRO approaches that employ a distribution sets that are centered at either the estimated conditional distribution or joint joint empirical distribution of ( ψ, ξ ) .
[Kannan et al., 2020b] applies distributionally robust optimization to the residual-based CSO model proposed in [Kannan et al., 2020a].
We ﬁnally note that none of these works have considered the problem of conditional
DRO where the distributional ambiguity set itself, namely its support or size, depend on contextual information.
Data-driven Robust Optimization and One-class Classiﬁcation There has been a growing set of papers (see [Ohmori, 2021, McCord, 2019, Wang and Jacquillat, 2020]) proposing various frameworks that use both supervised and unsupervised one-class classiﬁcation techniques in designing the uncertainty sets which are further integrated in the RO problems.
Some approaches make use of variance and covariance of historical data [Natarajan et al., 2008] while others [Goerigk and Kurtz, 2020, Wang et al., 2021] have exploited the representative power of deep neural networks to construct compact uncertainty sets Up to this day, none of the data-driven robust optimization approaches have considered accounting for contextual information.
Deep Clustering Methods Traditional clustering methods like Gaussian Mixture Models (GMM) and k -means clustering rely on the original data representations and suffer from the curse of dimensionality.
Recent developments in DNNs led to learning of high quality representations, especially auto-encoder(AE) and decoder systems are particularly appealing as they are able to learn the representations in a fully unsupervised fashion.
Several works like [Chang et al., 2017, Guo et al., 2017, Ji et al., 2017] combine variational AEs and GMMs to perform clustering and non-linearly map the input data into a latent space.
Few works like [Fard et al., 2020] try to jointly learn the representations and jointly cluster with k -means and learning representations.
We modify these algorithms to introducing a probability simplex which interact with the centroids and also the center of the uncertainty sets.
The Deep Data-Driven Robust Optimization (DDDRO) Approach
Focusing on a classical robust optimization model, i.e. min x ∈X max ξ ∈U c ( x, ξ ) , the authors of [Goerigk and Kurtz, 2020] propose to employ deep learning to characterize the uncertainty set U in a data-driven environment.
In particular, they consider describing the uncertainty set U in the form:
[Equation]
where f W : R m → R d is a deep neural network, parametrized using W , that projects the perturbation vector ξ to a new vector space where the uncertainty set can be more simply deﬁned as a sphere of radius R centered at some ¯ f 0 .
Given a dataset D ξ = { ξ 1 , ξ 2 . . .
ξ N } , they propose discovering the underlying structure of U by training the NN using a method found in the one-class classiﬁcation literature, namely minimizing the empirical centered total variation of the projected data points:
[Equation]
where ¯ f 0 :=
(1 /N )
(cid:80) i ∈
[ N ] f W 0 ( ξ i ) is the center of the projected points under some initial random choice of f W 0 .
Once the network is trained, they calibrate the radius R of U in order to reach a targeted coverage 1 − (cid:15) of the data set.
In terms of NN architecture, they favor a special class of fully connected neural network of depth L :
[Equation]
where each W (cid:96) captures a linear projection while each σ (cid:96) captures a term-wise piecewise linear activation function (e.g. ReLU, Hardtanh, or hard sigmoid):
[Equation]
with { a (cid:96)k , b (cid:96)k , α (cid:96)k , α (cid:96)k } Kk =1 as the parameters that identiﬁes each of the K afﬁne pieces.
The motivation for such an architecture comes from the proposed solution scheme for the RO problem, which relies on a constraint generation approach (See Algorithm 3, 4 in Appendix).
This scheme relies on progressively adding scenarios to a reduced set U (cid:48) ⊆
U until the worst-case cost of the solution under U (cid:48) is the same as under U .
Numerically, a critical step consists in identifying the worst-case realization in U , which is shown to reduce to a mixed-integer linear program when c ( x, ξ ) is linear in ξ under the selected NN architecture due to the following representation of U ( W, R ) :
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
   ,
[Equation]
7) where we assume for simplicity that each layer of the deep neural network has d neurons and φ (cid:96) is the output at l -th layer of the neural network.
We refer interested readers to [Goerigk and Kurtz, 2020] for more details.
Deep Data-driven Conditional Robust Optimization
Let ( ψ, ξ ) be a pair of random vectors deﬁning respectively the side-information and random perturbation vectors of a contextual optimization problem.
We can call our dataset D ψξ := { ( ψ 1 , ξ 1 ) , . . .
, ( ψ N , ξ N ) } .
Our objective is to train a data-driven conditional uncertainty set U ( ψ ) that will lead to robust solutions that are adapted to the type of perturbance that are experienced when ψ is observed.
In this section, we propose two algorithms, namely Deep cluster then classify (DCC) and the Integrated Deep cluster then classify (IDCC), to do so, and propose a calibration procedure that offers some guaranties with respect to a contextual value-at-risk problem.
4.1 The Deep “Cluster then Classify” (DCC) Approach
A direct extension of G&K’s DDDRO approach in section 3 consists in reducing the side-information ψ to a set of K different clusters, which provides states of the environment in which one wishes to design customized data-driven uncertainty sets.
Mathematically, U ( ψ ) :=
U a ( ψ ) , where a : R m → [ K ] , is a trained K -class cluster assignment function for ψ , and each U k , for k = 1 , . .
, K , is an uncertainty sets for ξ that is trained and sized using the procedure described in section 3 with the dataset D kξ := ∪ ( ψ,ξ ) ∈D ψξ : a ( ψ )=
k { ξ } .
This process implicitly involves multiple sequential steps of training of deep neural networks.
Following [Moradi Fard et al., 2020], when performing deep
K -mean clustering to obtain a ( ψ ) , training can take the form of Algorithm 5, where the deep Kmeans algorithm trains simultaneously a representation g V E : R m → R d , using an encoder and g V D : R d → R m , using a decoder network, and a K-mean classiﬁer ¯ a θ ( φ ) :
= argmin k ∈ [ K ] (cid:107) φ − θ k (cid:107)by minimizing, using stochastic gradient descent in a coordinate descent scheme, a trade-off (using α K ) between reconstruction error and the within cluster centered total variation in the encoded space:
[Equation]
where a ( ψ ) :
= ¯ a θ ( g V E ( ψ )) .
To solve this problem, we iterate between improving V :=
( V E , V D ) while keeping θ ﬁxed, and improving θ while preserving V ﬁxed.
Once the K -mean and one-class classiﬁers are trained, we correct for a deﬁciency of DDDRO approach, who assume wrongfully that the projected f W k ( ξ ) are normalized for each D kξ .
Namely, we replace U ( W, R ) with a set that employs an ellipsoid in the projected space according to the statistics of D kξ :
[Equation]
where S k is short for ( µ kf , Σ kf ) with
[Equation]
The calibration of each R k can ﬁnally be done using the same procedure as in [Goerigk and Kurtz, 2020]but using the reduced dataset D kξ .
4.2 The Integrated Deep Cluster-Classify (IDCC) Approach
While the simplicity of the approach presented in section 4.1 makes it appealing, we identify two important weaknesses.
First, by separating the training in multiple step, it omits to tackle the conditional uncertainty set learning problem as a whole.
Namely, that low total variation in the ψ space (or a projection of it) does not necessarily imply that low total variation can easily be achieved in a projection of the ξ space.
Second, it is unclear how to adapt the approach to a context where a clear separation of the clusters is impossible and where the notion of partial membership to a cluster is more appropriate.
To address the ﬁrst problem, we propose an integrated framework for performing deep clustering and deep uncertainty set design jointly.
Namely, we propose to optimize all of V , θ , and { W k } Kk = jointly using a loss function that trades-off between the objectives used for clustering and each of the K versions of one-class classiﬁers.
We also tackle the issue of hard assignments by training a parameterized random assignment policy π : R m → ∆ K , where ∆ K is the probability simplex in R K , and θ the parameters that deﬁne the policy space.
In the context of employing a soft version of deep
K -means [Fard et al., 2020]; this random assignment policy takes the form of π ( ψ ) :
= ¯ π θ ( g V ( ψ )) , where
[Equation]
With these adjustments, our proposed loss function takes the form of:
[Equation]
where ˜ a ( ψ ) ∼ ¯ π θ ( g V E ( ψ )) is the randomized assignment based on ψ , TotalVar π D ( φ, θ | ˜ a ( ψ )) :
= (cid:80) dj
=1 E π D [( φ j − θ j ) 2 | ˜ a ( ψ )] is the conditional centered total variation of given ˜ a ( ψ ) .
In fact, all statistics are measured using the empirical distribution expressed in D ψξ and the conditional distribution produced by the randomized assignment policy ¯ π θ ( g V ( ψ )) , i.e. P π D (( ψ, ξ, ˜ a ) ∈ E ) =
(1 /N ) (cid:80) Ni =1 (cid:80)
Kk =1 1 { ( ψ i , ξ i , k ) ∈
E} ¯ π θk ( g V ( ψ i )) .
The explicit form of equation (11) can be found in Appendix B.1.
Overall, L 3 α trades off (using α S ) between the reconstruction error of the encoder-decoder networks on ξ , the expected recognizability of the K clusters, i.e. the fact that the observed features g V E ( ψ ) form distinct clusters of points, and the average compactness of the produced conditional uncertainty sets.
In particular, as α S → 1 , we can expect the minimizer of L 3 α to converge to the minimizer of the cluster then classify approach.
At the other end of the spectrum, when α S → 0 , the model will produce more self contained conditional uncertainty sets but at the price of less distinguishable clusters (in terms of ψ ) that might poorly exploit the side-information.
Algorithm 1 presents our proposed training scheme for the IDCC approach.
Given that we employ a random assignment policy, we propose replacing the deterministic CRO problem with its randomized version:
[Equation]
where ˜ U ( ψ ) :
=
U ( W ˜ a ( ψ ) , R ˜ a ( ψ ) , S ˜ a ( ψ ) ) 1 is a random uncertainty set, and where we express the fact that, conditionally on ψ , ˜ x ( ψ ) is a random policy that depends on the realization of ˜ a .
Given the randomness of ˜ U ( ψ ) , one needs to be more careful in deﬁning a calibration scheme for each R k .
Our proposed scheme is motivated by the following Lemma, which proof can be found in appendix A.
Lemma 4.1.
Let the random uncertainty set ˜ U ( ψ ) satisfy:
[Equation]
then it satisﬁes:
[Equation]
In particular, this lemma suggests calibrating each R k using the bisection to solve:
[Equation]
given that the resulting R k are the smallest that satisfy (12).
Algorithm
Input: Data-set D ψξ , Number of clusters K , hyper-parameters α K , α S , β
Randomly initialize θ 0 , V 0 , and W
Let π 0 :
=
¯ π θ
( g V E 0 ( ψ )) and W k 0 :
= W 0 for all k ’s
Set t :=repeat
Set t :=
t + 1 .
gradient descent
(11) with θ t
Get π t := ¯
π θ t ( g V Et ( ψ ))
until t ≥ T or convergence
Let π ( · ) :
= π t ( · ) and W k :=
W kt for all k ’s for k = 1 , . . .
K do
Calibrate R k using (14)
Let U k :
= U ( W k , R k , S k ) end for
Return π ( · ) and {U k } K k =
4.3 Connections to Contextual Value-at-Risk Optimization
In the previous subsections, we proposed two different schemes to produce a possibly randomized uncertainty set ˜ U ( ψ ) that can be employed in a randomized CRO problem.
We also proposed a scheme for radii calibration so that they would satisfy the coverage property in (13).
Hence, one can derive the following connection between conditional robust optimization and the CVO problem (1).
The proof is pushed to Appendix A. [Equation]
[Equation]
[Equation]
Lemma 4.2.
When ˜ U satisﬁes (13) , the random policy ˜ x ( · ) to the randomized CRO problem together with
[Equation]
provide a conservative approximate solution to the CVO problem under the empirical measure P π D .
Namely,
[Equation]
In particular, in the case of the proposed DCC and IDCC approaches we have that
[Equation]
As the robust optimization paradigm traditionally aims at offering statistical guarantees on the out-ofsample performance of the prescribed solutions, we describe below how a bootstrap method can be used to estimate the radii R k ’s.
Remark 4.1.
Using bootstrapping methods, we can get a conservative approximation of each R k as:
[Equation]
where P ˜ D measures the probabibility when resampling a new dataset of size N with replacement from D ψξ .
When N is large enough and assuming that each data point is drawn i.i.d.
according to some unknown probability measure P , we asymptotically get the guarantee that P ( ξ ∈ ˜
U
( ψ )) ≥ 1 − (cid:15) with probability higher than approximately 1 − Kδ .
Experiments
In this section, we illustrate the coverage aspect of the IDCC approach using simulated data.
We will further demonstrate the advantage of the CRO problem using a standard risk minimizing portfolio optimization problem.
We compare the performance of IDCC with that of DCC, DDDRO (with ellipsoidal correction in (9)), and the classical ellipsoidal uncertainty approach (i.e. DCC with K =and f W 1 ( ξ ) := ξ ).
The IDCC and DCC methods incorporate the covariate information whereas
DDDRO and ellipsoid approach ignore this information.
The neural network architecture and other modeling information is available in the Appendix B.
The code can be found on github 3 .
Our code uses the Pytorch implementation from [Goerigk and Kurtz, 2020], which is available online 4 .
5.1 Conditional uncertainty set illustration using simulated data
For the ease of illustration, we consider a simulation environment where [ ψ T ξ T ] ∈ R 4 is a random vector which distribution is an equal weighted mixture of two 4 -d multi-variate normal distributions.
We consider N = 500 and train IDCC (with K = 2 ), DDDRO, and the ellipsoid and calibrate the uncertainty sets for a probability coverage of 90%, 99% (i.e. (cid:15) ∈ { 1% , 10% } ).
As a result, DDDRO and IDCC, which use deep neural networks, identify non-convex uncertainty sets, whose convex hulls are presented in Figure 1 together with the calibrated ellipsoid.
The ﬁgure also presents the conditional distribution of ξ according to P π D ( ·| ˜ a ( ψ ) = k ) , using IDCC’s randomized assignment, and the training dataset.
One can remark that the conditional sets produced by IDCC exploit the side information by concentrating the uncertainty set on the region that has the most mass according to P π D ( ·| ˜ a ( ψ ) = k ) thus leading to a less conservative RO problem then DDDRO and the ellipsoid, which are oblivious to ψ .
In fact, it appears to have successfully learned to at least partially recognize the mixture membership using ψ and exploit this information to adapt the uncertainty set.
5.2 Robust portfolio optimization
We further investigate the empirical out of sample performance of the proposed uncertainty sets on a classical robust portfolio optimization problem.
Namely, we consider a situation where an [Figure] investor is trying to minimize the worst-case return based on an uncertainty set that provides 1 − (cid:15) probabilistic coverage of the uncertain future return vector.
In particula, given that x captures a vector of investment in n = m different assets which return are captured using ξ , we let c ( x, ξ ) := − ξ (cid:124) x to capture the return on investment, and let X := { x ∈ R n | (cid:80) ni
=1 x i = 1 , x ≥ 0 } to capture the need to invest one unit of wealth among the available assets.
Following Lemma 4.2, this model can in turn be interpreted as conservatively approximating a min x ∈X VaR 1 − (cid:15) ( ξ (cid:124) x ) , where the objective is a risk averse value-at-risk metric.
Dataset
Our experiments make use of historical data from the US stock market.
We collect the adjusted daily closing prices for 70 stocks (as used in [Xu and Cohen, 2018]) coming from 8 different sectors from January 1, 2012 to December 31, 2020 using the Y!Finance’s API.
Each year hasdata points and we compute the percentage gain/loss w.r.t the previous day to create our dataset for ξ .
As for side information, we use trading volume of individual stocks, and other market indicesover the same period as covariates.
Our algorithm gives the ﬂexibility to use any number of such metrics as contextual information.
Given the time series nature of the data, at a given instance, we use 3 years of data to train and the following year as validation to pick the hyper parameters of our model such as learning rate, weight decay, optimal number of clusters.
We then retrain the model using the 4 years of data to build the ﬁnal model.
Upon calibrating the uncertainty set, we use it to solve the robust portfolio optimization problem.
We then apply this policy on the next 1 year data and compute the performance metric, namely Value at risk (VaR) for different conﬁdence levels to compare the performances.
VaR quantiﬁes the level of risk of a portfolio over a speciﬁed time frame.
Here, it gives an estimate of the maximum % loss the decision maker can incur over a period of 1 year when he uses the policy from the RO model.
Intuitively, lower the VaR, less riskier is the generated policy.
Many ﬁnancial institutions use VaR to determine the amount of collateral needed when trading ﬁnancial products so lowering VaR for high conﬁdence levels is crucial.
Experiment Design To test for robustness of the IDCC algorithm, we experiment on various randomly sampled stock combinations across different time periods.
We randomly sampled a subset of 15 stocks in a time window and repeated the experiment for 10 runs on 3 moving time frames.
We used learning rate = 0.01, α K = 0 .
5 , α S = 0 .
5 , β = 0 .
1 for all the experiments.
We use a cold start
K-means approach to determine K for each run.
We do this across all these experiments as it will be computationally expensive to tune the parameters through grid search for each run and also our intention is to show the learning capability of our algorithm even with minimal tuning.
The parameter tuning and implementation details can be found in appendix B.3.
Results Fig.
2 shows the avg.
VaR across the runs at different conﬁdence levels.
It is evident that
IDCC generally performs better than the baseline models.
This difference is especially noticeable at higher conﬁdence level, and vanishes as we move to lower conﬁdence levels.
Table 1 provides more details by comparing the overall and conditional cluster level VaR with the baseline models.
Speciﬁcally, in each run we identify each cluster as either the “majority” or “minority” cluster
[Figure]
[Figure]
A v g .
V a
R (a)0.
0.99 Confidence level 0.
A v g .
V a
R (b) [Figure]
[Figure]
A v g .
V
[Figure]
depending on its frequency and report averages of VaR (among the 10 runs) for each of these labels. The average frequencies for each label is also reported in the table. In particular, one can observe that the improvement on average overall VaR can reach up to ∼ 15% (see in 2019 at a 0.99 conﬁdence level).
This advantage is even more clearly visible when we look at the individual cluster level conditional VaR. For instance, in the year 2018 for the 0.99 conﬁdence level, the majority cluster ( ∼ 68% data) provides an improvement of 19% and an overall improvement of 9% compared to the second best baseline model.
A similar pattern is observed for the year 2019 as well.
In year 2017, the overall performance of IDCC is close and for some conﬁdence levels slightly above the baseline models.
However, we see that the majority cluster ( ∼ 80% data) is performing better than the baseline models while the minority cluster has slightly higher risk.
We attribute this loss in performance to the fact that the minority clusters is much less frequent ( ∼ 20% data) and therefore has less data available to properly learn its conditional uncertainty set.
This large difference in frequencies might also indicate that the side information does not have a strong signal for the behavior of the returns during this period of time.
[Figure]
[Table]
Both the overall VaR and conditional VaR given the membership to the majority/minority clusters are presented.
Conclusion and Future Work
In this work, we introduced a new approach, Conditional Robust Optimization, for solving contextual optimization problems in a risk averse setting.
We proposed a novel integrated approach to design uncertainty sets that adapts to revealed covariate information.
We identiﬁed connections to contextual value-at-risk optimization and showed empirically that our method reduces the out-of-sample VaR considerably compared to non-contextual RO schemes when the level of protection needed is high.
As future work, we ﬁnd that it should be interesting to integrate data-driven conditional uncertainty sets in the context of multi-stage robust optimization models.
Given that clustering techniques are often prone to learning correlations from the data that do not reﬂect true causal relation, there might be a need to integrate causal inference methods to our approach.
One might also be concerned regarding fairness considerations in contexts where side information might allow to treat certain class of individuals differently from others.
This last issue might be addressed by adding fairness consideration in our integrated loss function. Acknowledgement
The authors gratefully acknowledge support from the Institut de Valorisation des Données (IVADO) and from the Canadian Natural Sciences and Engineering Research Council [Grant RGPIN-201605208 and 492997-2016].
A Proofs
As mentioned in section 3 and 4, our dataset D contains the random perturbation vectors ξ and side information ψ . ˜ U ( ψ ) represents the conditional uncertainty set which satisﬁes the following properties. Lemma 4.1.
Let the random uncertainty set ˜ U ( ψ ) satisfy:
[Equation]
then it satisﬁes:
[Equation]
Proof.
The claim follows from:
[Equation]
Lemma 4.2.
When ˜ U satisﬁes (13) , the random policy ˜ x ( · ) to the randomized CRO problem together with
[Equation]
provide a conservative approximate solution to the CVO problem under the empirical measure P π D .
Namely,
[Equation]
In particular, in the case of the DCC and IDCC approaches we have that
[Equation]
Proof.
First, by deﬁnition of ˜ x ( · ) and v ∗ , we have that when ξ ∈ ˜ U ( ψ ) : [Equation] Hence, we must have that:
[Equation] We thus obtain our result based on the following argument: [Equation] In the case of the DCC and IDCC approaches we have that
[Equation]
since ˜ U ( ψ ) is supported on {U ( W k , R k , D πk ) } Kk =1 .
B Deep learning implementation of IDCC approach B.1 Loss function
Mathematically
[Equation]
the conditional total variation loss function (11) can be explicitly written as:
[Equation]
where
[Equation]
B.2 Architecture
The joint loss minimization task is performed using the following network architecture which has 2 parallel networks training simultaneously.
The ﬁrst network( g V :=
( g V E , g V D ) ) takes the side information ( ψ ) as the input and generates a randomized assignment ˜ a ( ψ ) ∼ ¯ π θ ( g V E ( ψ )) .
The second network( { f W k } Kk =1 ) takes the random perturbation vector ( ξ ) and ˜ a ( ψ ) as the input to generate W ˜ a ( ψ ) , S ˜ a ( ψ ) 6 which are subsequently used to design the uncertainty set ˜ U ( ψ ) :
=
U ( W ˜ a ( ψ ) , R ˜ a ( ψ ) , S ˜ a ( ψ ) ) .
g V is an auto-encoder(AE) network which generates the assignment vector ˜ a ( ψ ) .
They are trained to learn lower dimension data representations at the bottleneck of the network.
They have the capability to learn representations in a fully unsupervised way which makes them suitable for the task at hand.
The encoder( g V E ( . ) ) consists of the input(dim= m ), hidden and the output layers(dim= d ).
The decoder( g V D ( . ) ) uses this low dimension representation to reconstruct the original input data.
The decoder is a mirrored version of the encoder.
The input layer is fully connected to the output layers with an intermediate ReLU activation layers in both the encoder and the decoder.
We initialize the network weights using kaiming normal initialization.
The output from the encoder is passed through a softmax layer to generate a soft version of deep K -means [Fard et al., 2020] which gives the assignment simplex ˜ a ( ψ ) ∼ ¯ π θ ( g V E ( ψ ))
where
[Equation]
The parallel network( { f W k } Kk =1 ) designs the K customized data-driven uncertainty sets using a slightly modiﬁed deep SVDD method from [Goerigk and Kurtz, 2020].
The input to these networks is the perturbations ξ and the assignment policy( ¯ π θ ( g V E ( ψ )) ).
Each f W k has an input layer(dim=15), hidden layer and an output layer(dim=5).
All layers are fully connected with a ReLU activation function.
All the networks are initialized with a uniform distribution in [0 , 1] .
Our approach constructs a weighted center, ¯ f θ,VW k | ˜ a ( ψ i )=
k which uses ¯ π θ ( g V E ( ψ )) to compute the loss (17).
B.3 Suggested extensive parameter tuning procedure
In this section, we discuss the parameter tuning strategy that can be used to train the network proposed in section B.2 using the portfolio optimization example discussed in section 5.2.
Here, given the time series nature of the data, we follow the rolling window approach for network training.
Our architecture uses a set of hyperparameters, hp =
( lr, α K , α S , β, K ) where lr represents the learning rate, α K regulates the trade-off between seeking good representations for ψ that are faithful to the original data and representations that are useful for clustering purposes.
α S plays a similar trade-off between the recognizability and compactness of uncertainty sets. Finally, β is a softmax temperature parameter and K represents the number of clusters. We split the data into training and validation periods and search for the optimal combination through grid search method. For each combination, we train the network and generate the optimal policy using training data which is applied on the unseen validation data.
The optimal combination is the one that give the lowest V aR 1 − (cid:15) on validation dataset as this is a worst case return minimization problem.
This is shown in algorithm 2.
Once the hyperparameters are selected, we re-train the network using the complete data.
It is important to note that the results reported section 5 did not use the parameter tuning to reduce computations
[Equation]
[Equation]
[Equation] Input: hp = ( lr, α K , α S , β, K ) for year = y, . . , y + M do
Obtain {U k } Kk =1 from Algorithm
Get optimal portfolio using: min x ∈X VaR 1 − (cid:15) ( ξ (cid:124) x ) 5.
end for
Choose hp which minimizes out of sample V aR 1 − (cid:15) for M periods B.4 Simulated data generation process In this section, we discuss the data generation process for the simulated data used in section 5.1. For easy visualization, we consider a simulation environment where [ ψ T ξ T ] T ∈ R 4 is a random vector which distribution is an equal weighted mixture of two 4 -d multivariate normal distributions.
Namely, [ ψ T ξ T ] T ∼ 0 . 5 N ( µ 1 , Σ 1 ) + 0 . 5 N ( µ 2 , Σ 2 ) where: [Equation]
[Equation]
[Equation]
[Equation]
[Equation]
[Equation]
[Equation] [Equation] [Equation] [Equation]
.1 . [Equation] [Equation] [Equation]
[Equation]
[Equation]
[Equation]
[Equation]
[Equation] The distribution marginalized over the random vectors ψ ∈ R 2 and ξ ∈ R 2 can respectively be visualized in ﬁgure 3(a) and (b). [Figure] analysis for parameters
Here, we show the sensitivity analysis for the parameters α S and K . For each of these analysis, we keep all the other parameters constant and train the model by varying the considered parameters. For α S , we consider the range of values between 0 and 1. For the sensitivity analysis of K , we considered 1 to 9 clusters.
We conducted 10 such runs in the year 2019 and observe the average validation VaR. The results can be seen in the plots below. The analysis in 4b shows that 2 clusters result in similar or improved performance compared to using more clusters. Regarding the inﬂuence of α S on out-of-sample performance, we did not observe any insightful behavior.
We believe this hyper parameter can play a role in problem settings where the convergence of TV losses in contextual and perturbed spaces is different and needs moderation. However, in this case, we don’t notice any such issues and the choice of α S as 0.5 seemed to work generally well across all experiments as seen in 4a. The sensitivity analysis also highlights the same, which points to 0.5 as being a legitimate choice for α S .
[Figure]
In this section, we provide the pseudo code for the Iterative constraint generation and the Deep Cluster then Classify 4.1 techniques. C.1 Iterative constraint generation
We present the iterative constraint generation algorithm for both the robust objective problem: [Equation] and a robust constraint problem of the form: [Equation]
We note that when X is convex and c ( x, ξ ) is convex in x and linear in ξ , then arg min x ∈X max ξ ∈U (cid:48) c ( x, ξ ) can be obtained using convex optimization algorithms, while ξ ∗ ∈ argmax ξ ∈U c ( x ∗ , ξ ) can be obtained using mixed-integer linear programming solvers such as MOSEK (see MOSEK ApS [2022]). In more general setting, one might need to employ more general non-linear programming software.
Input: Max number of iteration M Set U (cid:48) : = { ξ 0 } ⊆ U for iter = 1 , . . .
, M do
Set x ∗ ∈ arg min x ∈X max ξ ∈U (cid:48) c
( x, ξ )
Set ξ ∗ ∈ argmax ξ ∈U c ( x ∗ , ξ ) if c ( x ∗ , ξ ∗ ) > max ξ ∈U (cid:48) c
( x ∗ , ξ ) then Add ξ ∗ to U (cid:48) else Break end if end for
Return x ∗
Input: Max number of iteration M Set U (cid:48) :
= { ξ 0 } ⊆
U for iter = 1 , . . .
, M do
Set x ∗ ∈ arg min x ∈X : c ( x,ξ ) ≤ 0 , ∀ ξ ∈U (cid:48)
f ( x, ξ )
Set ξ ∗ ∈ argmax ξ ∈U c ( x ∗ , ξ ) if c ( x ∗ , ξ ∗ ) > 0 then Add ξ ∗ to U (cid:48) else
Break end if end for
Return x ∗
C.2 Deep Cluster then Classify with deep K -means
{+Algorithm 
+}
Deep Cluster then Classify with deep K -means Input: Data-set D ψξ , number of clusters K , maximum number of iterations T , coverage error (cid:15) Randomly initialize θ 0 , V 0 and all W k 0 ’s
Let a 0 ( ψ ) :
{+= ¯ a θ 
+}
( g V E 0 ( ψ ))
Set t :=repeat
Set t :=
t + 1 . Update θ kt := (cid:80) i ∈I k g V Et − 1 ( ψ i ) / |I k | where I k :
= { i : a t − 1 ( ψ i ) =
k }
Let a t ( ψ ) : = ¯ a θ t ( g V Et − 1 ( ψ )) Update V t using SGD on (8) with a t ( ψ i ) until t ≥ T
Let a ( ψ ) :
= a t ( ψ ) for k = 1 , . . .
K do
Train the parameters W k using (5) with D kξ
Calibrate R k on D kξ using coverage target 1 − (cid:15)
Let U k : = U ( W k , R k , S k ) end for Return a ( · ) and {U k } Kk =