Some of the parameters used in the medium-term model are stochastic. As an example, we have the water inflows wih in hydro basin h, for which as a first approximation one can use its expected value. However, the stochastic programming [9] recommends the use of a scenario tree where every uncertainty at each period is represented and has an associated probability. The optimization over the scenario tree provides a solution for every scenario taking into account the non-anticipativity principle (one variable in a node cannot use in-formation of nodes that correspond to future periods).
Regarding the uncertainty of the load and the stochasticity of the unit outages, there is no need to create scenarios for the unit failures and for the load variation, whenever the probabilistic matching (see §2.2.1) is used.
2.9.1 Scenario Tree: characteristics and notation
A scenario tree is a discrete representation of the possible states that our random parame-ters could take at each period i over the time horizon. Therefore, a tree is a subset of nodes N that are linked together in a hierarchical way.
The main characteristics of a node ν are
• Random parameters take predetermined values at each node, which results in spe-cific values of the variables xνj that correspond to that node.
• It belongs to a certain time period, i(ν).
• It has a specific probability, πν.
• It has a single predecessor (or father) node, ν−.
Summarizing, one scenario tree consists of a set of nodes N connected to each other. Each node ν ∈ N has an associated time period i(ν), one predecessor node ν− and represents the probability of realization of that period. Each node also has a probability πν and it holds that:
X
∀ν|i(ν)=ei
πν = 1 ei = 1, 2, ..., ni
We define L := {ν ∈ N|i(ν) = ni} as the set of leaves (nodes at final period) and A(>) :=
{1, ..., λ−, λ} as the path from the root node to the node λ which is the scenario λ with the same probability as the node λ, πλ. For more information, see [36].
In our study, the root node represents the present (normally it will be of a length of one week). At each period, we will have optimistic realizations, normal realizations and pes-simistic ones, thus all possibilities will be taken into account. The scenario tree will be created using a mixture of a multidimensional vector auto regressive model and Quasi-Monte Carlo methods.
2.9.2 The Vector Auto-Regressive model
Vector Auto-Regressive (VAR) models are usually used for multivariate time series. Its essence is a system of equations, with as many equations as series to analyze or predict.
But in which there is no distinction between endogenous and exogenous variables. Thus,
lags of other variables.
We assume that renewable generations follow a nD dimensional modified VAR model of type:
Xi+1= κi+1(Xi+1− Xi) + Xi+ ξ, (26)
where Xi+1 is the stochastic variable vector at period i + 1, κi+1 is the diagonal matrix of the mean reverting coefficients, Xi+1 is the vector of the historical mean series and ξ is a normal vector with zero mean and covariance matrix Σ, i.e., ξ∼ N(0, Σ).
2.9.3 The Quasi-Monte Carlo technique for creating a scenario tree
There are many options that could be used for the scenario generation such as Monte Carlo (MC) sampling, optimal quantization of probability distributions, quadrature rules based on sparse grids or Quasi-Monte Carlo (QMC) methods. MC methods are normally used for generating uniformly distributed random variables and for transforming these variables to other distributions.
A pseudorandom number generator produces a finite sequence of numbers u1, u2, ..., us in the [0, 1] interval. A linear congruential generator is a recurrence of the following form:
gs+1 = ags mod q (27a)
us+1= gs+1/q. (27b)
Here, the multiplier a and the modulus q are integer constants that determine the values generated, given an initial value g0. This initial value, called seed, normally is defined by the user and must be an integer between 1 and m − 1. Due to its simplicity, this type of generator is the most used in practice.
Quasi-Monte Carlo or low-discrepancy methods are alternatives to MC methods (see [61, 78]).
They seek to increase accuracy specifically by generating points that are too evenly dis-tributed to be random. These methods have the potential to accelerate convergence from the O(1/√
n)rate associated with MC to nearly O(1/n) convergence. Niederreiter [62] pro-vides a thorough treatment of the theory.
The problem now is to approximate the integral of a function f as the average of the function evaluated at a set t1, ..., tN of points.
Z
[0,1]nD
f(u)du ' 1 nD
nD
X
i=1
f(ti). (28)
In a MC method, the set t1, ..., tnD is a subsequence of pseudorandom numbers obtained as in (27). In a QMC method, the set is a subsequence of a low-discrepancy sequence (or quasi-random sequences). These sequences are used to generate representative samples from the probability distributions simulated in these problems.
A low-discrepancy sequence is one with the property that for all values of nD, its subsequence t1, ..., tnD has a low discrepancy. The discrepancy will be low if the proportion of points in the subsequence falling into an arbitrary set is close to proportional to the measure (intu-itively interpreted as its size) of that set.
An example of a low-discrepancy sequence is the following one:
Qn,nD(f) = 1 n
n−1X
k=0
f {kτ
n + ∆} , (29)
where τ ∈ ZnD,{τ} means component-wise the fractional part of y, and the ’shift’ ∆ is a uni-formly distributed random variable in [0, 1)nD. This sequence is a quadrature rule invented for the integration of periodic functions over the nD-dimensional cube. A quadrature rule is an approximation of the definite integral of a function, usually stated as a weighted sum of function values at specified points within the domain. (see [44, 77])
Let’s now consider a stochastic program of the following form
min{
Z
Ξ
Υ(ξ, x)P(dξ) : x ∈ X} , (30)
where X ⊆ IRm is a constraint set, P a probability distribution on Ξ ⊆ IRnD, and f = Υ( ˚u, x) is a decision-dependent integrand.
The idea of QMC methods is to replace those random samples in MC methods by deter-ministic points that are uniformly distributed in [0, 1]nD. Having ni time periods and m stochastic variables, which are the natural water inflows, and WP and SPV generations, the total dimension will be nD = m× ni.
The main steps of the QMC procedure in order to generate n scenarios are:
• Determine QMC points by a component-by-component algorithm (see Nuyens and Cools [64] and Kuo [43]): ηj ∈ [0, 1]nD, j = 1, . . . , n with probability n1, where {ηj}nj=1 approximates the uniform distribution. In order to determine the QMC points, an algorithm is used that in each step minimizes the worst-case error for increasing dimensions while keeping all previous zj fixed.
In order to obtain these QMC points in this thesis, it has been used the
implementa-Algorithm 1 Component-by-component (CBC)
• Most simulation entails sampling random variables from distributions other than the uniform. A typical simulation uses methods for transforming samples from the uni-form distribution to samples from other distributions. The method employed in this thesis is the Inverse Transform Method (see Marsaglia [52]).
Generate n realizations ζji, i = 1, .., n, j = 1, .., nD of nD independent N(0,1) ran-dom variables using the inverse transform method with the QMC points ηj obtained before. This transform method computes the random number ζj such that F(ζj) = ηj.
• Compute the Cholesky decomposition of the covariance matrix Σ = LLT (LT being the transposed L matrix and L a lower triangular matrix of dimension nD× nD
• Compute the n realizations ξj = Lζj+ r, j = 1, .., n of the original N(r, Σ) random vector. Since in this model the value of the mean is r = 0, the formula to use is ξj = Lζj, j = 1, .., n.
Finally, the stages to generate a scenario tree are:
1. Generate n scenarios ξj, j = 1, . . . , n by quasi-Monte Carlo techniques with proba-bility n1, without tree structure, where n is taken to be a prime number that will represent the number of scenarios prior to reduction.
2. Generation of a scenario tree out of the n scenarios: a fan of data scenarios is created using the n realizations obtained with quasi-Monte Carlo procedures and using the stochastic model described before in §2.9.2
Xi+1(ν) = κi+1(Xi+1− Xi) + Xi+ ξ(ν), ∀ν ∈N
2.9.4 The reduction to a scenario tree of a given size
The generated scenario tree must be reduced because it is a dense tree and may be too big to be used in stochastic programming formulations. The software Scenred (Heitsch and W.
Römisch [32]), which uses an algorithm that deletes some of the nodes and redistributes their probability among the remaining ones using the Fortet-Mourier probability metric (see Dupa ˘cová et al. [22] and Heitsch and Römisch [31]) has been employed in this work.
2.9.5 Non-anticipativity constraints
When considering Stochastic Programming, it is necessary to introduce the concept of non-anticipativity. This implies that in, for example, a multi-period financial investment problem, no decision can be made at period t using any information that is revealed after period t. So mathematical models should include constraints that enforce that fact.
However, in this thesis the formulation of the stochastic problems is made with variables that are associated to nodes, and not to scenario paths, i.e., the variable associated to a specific node is common to all scenario paths that include the specific node. This avoids having to introduce non-anticipativity constraints in the formulation, because the decision variable in period i is the same no matter which decision follows in successive periods in different scenario paths.