Discretization To solve the two-stage stochastic problem numerically, one often needs to assume that the random vector \xi has a finite number of possible realizations, called
scenarios, say \xi_1,\dots,\xi_K, with respective probability masses p_1,\dots,p_K. Then the expectation in the first-stage problem's objective function can be written as the summation: E[Q(x,\xi)]=\sum\limits_{k=1}^{K} p_kQ(x,\xi_k) and, moreover, the two-stage problem can be formulated as one large linear programming problem (this is called the deterministic equivalent of the original problem, see section ). When \xi has an infinite (or very large) number of possible realizations the standard approach is then to represent this distribution by scenarios. This approach raises three questions, namely: • How to construct scenarios, see ; • How to solve the deterministic equivalent. Optimizers such as
CPLEX, and
GLPK can solve large linear/nonlinear problems. The NEOS Server, hosted at the
University of Wisconsin, Madison, allows free access to many modern solvers. The structure of a deterministic equivalent is particularly amenable to apply decomposition methods, such as
Benders' decomposition or scenario decomposition; • How to measure quality of the obtained solution with respect to the "true" optimum. These questions are not independent. For example, the number of scenarios constructed will affect both the tractability of the deterministic equivalent and the quality of the obtained solutions.
Stochastic linear programming A stochastic
linear program is a specific instance of the classical two-stage stochastic program. A stochastic LP is built from a collection of multi-period linear programs (LPs), each having the same structure but somewhat different data. The k^{th} two-period LP, representing the k^{th} scenario, may be regarded as having the following form: \begin{array}{lccccccc} \text{Minimize} & f^T x & + & g^T y & + & h_k^Tz_k & & \\ \text{subject to} & Tx & + & Uy & & & = & r \\ & & & V_k y & + & W_kz_k & = & s_k \\ & x & , & y & , & z_k & \geq & 0 \end{array} The vectors x and y contain the first-period variables, whose values must be chosen immediately. The vector z_k contains all of the variables for subsequent periods. The constraints Tx + Uy = r involve only first-period variables and are the same in every scenario. The other constraints involve variables of later periods and differ in some respects from scenario to scenario, reflecting uncertainty about the future. Note that solving the k^{th} two-period LP is equivalent to assuming the k^{th} scenario in the second period with no uncertainty. In order to incorporate uncertainties in the second stage, one should assign probabilities to different scenarios and solve the corresponding deterministic equivalent.
Deterministic equivalent of a stochastic problem With a finite number of scenarios, two-stage stochastic linear programs can be modelled as large linear programming problems. This formulation is often called the deterministic equivalent linear program, or abbreviated to deterministic equivalent. (Strictly speaking a deterministic equivalent is any mathematical program that can be used to compute the optimal first-stage decision, so these will exist for continuous probability distributions as well, when one can represent the second-stage cost in some closed form.) For example, to form the deterministic equivalent to the above stochastic linear program, we assign a probability p_k to each scenario k=1,\dots,K. Then we can minimize the expected value of the objective, subject to the constraints from all scenarios: \begin{array}{lccccccccccccc} \text{Minimize} & f^\top x & + & g^\top y & + & p_1h_1^\top z_1 & + & p_2h_2^Tz_2 & + & \cdots & + & p_Kh_K^\top z_K & & \\ \text{subject to} & Tx & + & Uy & & & & & & & & & = & r \\ & & & V_1 y & + & W_1z_1 & & & & & & & = & s_1 \\ & & & V_2 y & & & + & W_2z_2 & & & & & = & s_2 \\ & & & \vdots & & & & & & \ddots & & & & \vdots \\ & & & V_Ky & & & & & & & + & W_Kz_K & = & s_K \\ & x & , & y & , & z_1 & , & z_2 & , & \ldots & , & z_K & \geq & 0 \\ \end{array} We have a different vector z_k of later-period variables for each scenario k. The first-period variables x and y are the same in every scenario, however, because we must make a decision for the first period before we know which scenario will be realized. As a result, the constraints involving just x and y need only be specified once, while the remaining constraints must be given separately for each scenario.
Scenario construction In practice it might be possible to construct scenarios by eliciting experts' opinions on the future. The number of constructed scenarios should be relatively modest so that the obtained deterministic equivalent can be solved with reasonable computational effort. It is often claimed that a solution that is optimal using only a few scenarios provides more adaptable plans than one that assumes a single scenario only. In some cases such a claim could be verified by a simulation. In theory some measures of guarantee that an obtained solution solves the original problem with reasonable accuracy. Typically in applications only the
first stage optimal solution x^* has a practical value since almost always a "true" realization of the random data will be different from the set of constructed (generated) scenarios. Suppose \xi contains d independent random components, each of which has three possible realizations (for example, future realizations of each random parameters are classified as low, medium and high), then the total number of scenarios is K=3^d. Such
exponential growth of the number of scenarios makes model development using expert opinion very difficult even for reasonable size d. The situation becomes even worse if some random components of \xi have continuous distributions.
Monte Carlo sampling and sample average approximation (SAA) method A common approach to reduce the scenario set to a manageable size is by using Monte Carlo simulation. Suppose the total number of scenarios is very large or even infinite. Suppose further that we can generate a sample \xi^1,\xi^2,\dots,\xi^N of N realizations of the random vector \xi. Usually the sample is assumed to be
independent and identically distributed (i.i.d sample). Given a sample, the expectation function q(x)=E[Q(x,\xi)] is approximated by the sample average \hat{q}_N(x) = \frac{1}{N} \sum_{j=1}^N Q(x,\xi^j) and consequently the first-stage problem is given by \begin{array}{rlrrr} \hat{g}_N(x)=&\min\limits_{x\in \mathbb{R}^n} & c^T x + \frac{1}{N} \sum_{j=1}^N Q(x,\xi^j) & \\ &\text{subject to} & Ax &=& b \\ & & x &\geq& 0 \end{array} This formulation is known as the
sample average approximation method. The SAA problem is a function of the considered sample and in that sense is random. For a given sample \xi^1,\xi^2,\dots,\xi^N the SAA problem is of the same form as a two-stage stochastic linear programming problem with the scenarios \xi^j., j=1,\dots,N, each taken with the same probability p_j=\frac{1}{N}.
Statistical inference Consider the following stochastic programming problem \min\limits_{x\in X}\{ g(x) = f(x)+E[Q(x,\xi)] \} Here X is a nonempty closed subset of \mathbb{R}^n, \xi is a random vector whose probability distribution P is supported on a set \Xi \subset \mathbb{R}^d, and Q: X \times \Xi \rightarrow \mathbb{R}. In the framework of two-stage stochastic programming, Q(x,\xi) is given by the optimal value of the corresponding second-stage problem. Assume that g(x) is well defined and
finite valued for all x\in X. This implies that for every x\in X the value Q(x,\xi) is finite almost surely. Suppose that we have a sample \xi^1,\dots,\xi^N of Nrealizations of the random vector \xi. This random sample can be viewed as historical data of N observations of \xi, or it can be generated by Monte Carlo sampling techniques. Then we can formulate a corresponding
sample average approximation \min\limits_{x\in X}\{ \hat{g}_N(x) = f(x)+\frac{1}{N} \sum_{j=1}^N Q(x,\xi^j) \} By the
law of large numbers we have that, under some regularity conditions \frac{1}{N} \sum_{j=1}^N Q(x,\xi^j) converges pointwise with probability 1 to E[Q(x,\xi)] as N \rightarrow \infty. Moreover, under mild additional conditions the convergence is uniform. We also have E[\hat{g}_N(x)]=g(x), i.e., \hat{g}_N(x) is an
unbiased estimator of g(x). Therefore, it is natural to expect that the optimal value and optimal solutions of the SAA problem converge to their counterparts of the true problem as N \rightarrow \infty.
Consistency of SAA estimators Suppose the feasible set X of the SAA problem is fixed, i.e., it is independent of the sample. Let \vartheta^* and S^* be the optimal value and the set of optimal solutions, respectively, of the true problem and let \hat{\vartheta}_N and \hat{S}_N be the optimal value and the set of optimal solutions, respectively, of the SAA problem. • Let g: X \rightarrow \mathbb{R} and \hat{g}_N: X \rightarrow \mathbb{R} be a sequence of (deterministic) real valued functions. The following two properties are equivalent: • for any \overline{x}\in X and any sequence \{x_N\}\subset X converging to \overline{x} it follows that \hat{g}_N(x_N) converges to g(\overline{x}) • the function g(\cdot) is continuous on X and \hat{g}_N(\cdot) converges to g(\cdot) uniformly on any compact subset of X • If the objective of the SAA problem \hat{g}_N(x) converges to the true problem's objective g(x) with probability 1, as N \rightarrow \infty, uniformly on the feasible set X. Then \hat{\vartheta}_N converges to \vartheta^* with probability 1 as N \rightarrow \infty. • Suppose that there exists a compact set C \subset \mathbb{R}^n such that • the set S of optimal solutions of the true problem is nonempty and is contained in C • the function g(x) is finite valued and continuous on C • the sequence of functions \hat{g}_N(x) converges to g(x) with probability 1, as N \rightarrow \infty, uniformly in x\in C • for N large enough the set \hat{S}_N is nonempty and \hat{S}_N \subset C with probability 1 :: then \hat{\vartheta}_N \rightarrow \vartheta^* and \mathbb{D}(S^*,\hat{S}_N)\rightarrow 0 with probability 1 as N\rightarrow \infty . Note that \mathbb{D}(A,B) denotes the
deviation of set A from set B, defined as \mathbb{D}(A,B) := \sup_{x\in A} \{ \inf_{x' \in B} \|x-x'\| \} In some situations the feasible set X of the SAA problem is estimated, then the corresponding SAA problem takes the form \min_{x\in X_N} \hat{g}_N(x) where X_N is a subset of \mathbb{R}^n depending on the sample and therefore is random. Nevertheless, consistency results for SAA estimators can still be derived under some additional assumptions: • Suppose that there exists a compact set C \subset \mathbb{R}^n such that • the set S of optimal solutions of the true problem is nonempty and is contained in C • the function g(x) is finite valued and continuous on C • the sequence of functions \hat{g}_N(x) converges to g(x) with probability 1, as N \rightarrow \infty, uniformly in x\in C • for N large enough the set \hat{S}_N is nonempty and \hat{S}_N \subset C with probability 1 • if x_N \in X_N and x_N converges with probability 1 to a point x, then x \in X • for some point x \in S^* there exists a sequence x_N \in X_N such that x_N \rightarrow x with probability 1. :: then \hat{\vartheta}_N \rightarrow \vartheta^* and \mathbb{D}(S^*,\hat{S}_N)\rightarrow 0 with probability 1 as N\rightarrow \infty .
Asymptotics of the SAA optimal value Suppose the sample \xi^1,\dots,\xi^N is i.i.d. and fix a point x \in X. Then the sample average estimator \hat{g}_N(x), of g(x), is unbiased and has variance \frac{1}{N}\sigma^2(x), where \sigma^2(x):=Var[Q(x,\xi)] is supposed to be finite. Moreover, by the
central limit theorem we have that \sqrt{N} [\hat{g}_N- g(x)] \xrightarrow{\mathcal{D}} Y_x where \xrightarrow{\mathcal{D}} denotes convergence in
distribution and Y_x has a
normal distribution with mean 0 and variance \sigma^2(x), written as \mathcal{N}(0,\sigma^2(x)). In other words, \hat{g}_N(x) has
asymptotically normal distribution, i.e., for large N, \hat{g}_N(x) has approximately normal distribution with mean g(x) and variance \frac{1}{N}\sigma^2(x). This leads to the following (approximate) 100(1-\alpha)%
confidence interval for f(x): \left[ \hat{g}_N(x)-z_{\alpha/2} \frac{\hat{\sigma}(x)}{\sqrt{N}}, \hat{g}_N(x)+z_{\alpha/2} \frac{\hat{\sigma}(x)}{\sqrt{N}}\right] where z_{\alpha/2}:=\Phi^{-1}(1-\alpha/2) (here \Phi(\cdot) denotes the cdf of the standard normal distribution) and \hat{\sigma}^2(x) := \frac{1}{N-1}\sum_{j=1}^{N} \left[ Q(x,\xi^j)-\frac{1}{N} \sum_{j=1}^N Q(x,\xi^j) \right]^2 is the sample variance estimate of \sigma^2(x). That is, the error of estimation of g(x) is (stochastically) of order O(\sqrt{N}). == Applications and examples==