Modeling history-dependent parameters in the SMPS

0 downloads 0 Views 128KB Size Report
For the purposes of this paper we assume that the history Y1−p,...,Y−1,Y0 is known ..... [9] Shapiro, A. and T. Homem-de-Mello, (1998), “A simulation-based ap-.
Modeling history-dependent parameters in the SMPS format for stochastic programming

H.I. Gassmann School of Business Administration Dalhousie University Halifax, Canada G. Infanger Management Science and Engineering Stanford University Stanford, CA

Abstract This paper proposes two extensions to the SMPS format for stochastic programs to permit modelling of ARMA processes. Sampling-based algorithms can thus proceed independently of any underlying modelling system, increasing efficiency. An illustrative example demonstrates the power of the new constructs.

1

Introduction

The recent past has seen a growing number of modelling systems [11] and stochastic programming solvers [4, 7] supporting the SMPS format [2, 5] for stochastic linear programs. If this development is any indication, the SMPS format is slowly gaining acceptance in the stochastic programming community. The original version of the format was updated recently to incorporate additional features of stochastic programs. One area still insufficiently supported is history-dependent parameters. By capturing the information about stochastic processes directly in the SMPS format, it is possible for sampling algorithms of various types (see, 1

1 Introduction

2

e.g., [6, 3, 9]) to solve stochastic programs without having to reenter an algebraic modelling system with all the attendant overhead, just to generate another sample. This should make such algorithms more efficient and extend the range of problems that can be solved within reasonable time limits. This paper presents two proposals for dealing with processes of the form Yt =

p X

Mi Yt−i +

i=1

q X

Nj vt−j

(1)

j=0

where Mi , i = 1, . . . , p and Nj , j = 0, . . . , q are given (fixed) matrices and the innovations vt , vt−1 , . . . , vt−q are serially uncorrelated and identically distributed random vectors. This process is known as the (multivariate) ARMA(p,q) process in the literature (see, e.g., [10]). One very special instance is the random walk Yt = Yt−1 + vt

(2)

where vt is +1 or −1 with probability 0.5. For the purposes of this paper we assume that the history Y1−p , . . . , Y−1 , Y0 is known along with historical data v1−q , . . . , v0 . We want to develop a way of describing the ARMA(p,q) process within the SMPS format. The SMPS format is an extensive system based on the MPS format [8] for linear programs. It uses similar record structure, which provides for the following: • a four-character code field, • up to three name fields, • up to two numeric fields. We review a key mechanism of SMPS, linear transformations, in section 2. Section 3 shows how to apply this idea to the ARMA(p,q) process. While the method works, it is cumbersome, and two proposed extensions would greatly increase the convenience for modellers and users alike. In section 4 we introduce two extensions to the format. The first is a way to capture historical values for stochastic elements, which permits modelling of purely autoregressive processes (ARMA(p,0)); the second models lagged variables, which are needed for the general ARMA(p,q) processes. Section 5 contains a complete example explaining the use of the new features. Some concluding remarks in section 6 complete the paper.

2 Review of SMPS: Linear transformations

2

3

Review of SMPS: Linear transformations

The SMPS format [5] is a widely used format for stochastic linear programs. It describes instances of such problems by the use of three files, a core file containing all the deterministc portions of the problem, a time file to describe the dynamic aspects, and a stoch file for the stochastic data items. The SMPS format already has a mechanism for the similar relationship Y = Dv + c,

(3)

which we will review quickly. Equation 3 makes a distinction between the random variables c and the stochastic elements Y and links them by use of the matrix D. The random variables are associated with the columns of D, the stochastic elements with the rows. The matrix may be sparse, and its nonzeroes are given column by column. Unlike the constraint matrix of a linear program, two name fields are necessary to identify a stochastic element (and hence a column of D). Hence the start of a new column is signalled explicitly by a record with a special code, as in the following example. DISTRIB UNIFORM * --------------------------------------------------------* set up a one-dimensional random variable (uniform on [0,1]) * to be referenced later U_1 0.0 1.0 ... BLOCKS LINTRAN * --------------------------------------------------------* the following records define the locations associated with * the components of Y along with the value of c BL NEWBLOCK stage_1 COL1 ROW1 c_1 COL2 ROW2 c_2 ... ... ... COLn ROWn c_n * --------------------------------------------------------* the next section defines the first column of the matrix D * by referencing the distribution of U_1 defined earlier RV U_1 COL1 ROW1 d_11 COL2 ROW2 d_21 ... ... ... COLn ROWn d_n1

3 Reformulating the ARMA(p,q) process as a linear transformation

4

* --------------------------------------------------------* the next section defines the second column of D along with * the distribution of U_2 (standard normal) RV U_2 NORMAL 0.0 1.0 COL1 ROW1 d_12 COL2 ROW2 d_22 ... ... ... COLn ROWn d_n2 * --------------------------------------------------------* additional columns of D are handled similarly; * note the way in which random variable U_1 is reused. RV U_1 ...

Any records for which dij = 0 can be omitted in this formulation. Here the first set of records following the record marked ‘BL’ fixes the dimension of Y implicitly. The dimension of D is implicit in the number of ‘RV’ sections defined. Each ‘RV’ record can reference a previously defined distribution or can directly define a univariate distribution with up to two parameters. Random variables defined in the ‘DISTRIB’ section can be re-used; a copy is made for every new appearance in an ‘RV’ record, and it is assumed that these copies vary independently of each other.

3

Reformulating the ARMA(p,q) process as a linear transformation

We can exploit the idea of the previous section for the ARMA process. Note first that for t = 1 we can write Y1 =

p X

Mi Y1−i +

i=1

q X

Nj v1−j + N0 v1 = D11 v1 + c1 ,

(4)

j=1

P

P

where we have set D11 = N0 and c1 = pi=1 Mi Y1−i + qj=1 Nj v1−j Both quantities are computable in advance because the entire history up to Y0 is assumed known. For t = 2 we obtain Y2 = M1 Y1 +

p X

Mi Y2−i + N0 v2 + N1 v1 +

i=2

= M1 (D11 v1 + c1 ) +

q X

Nj v2−j

(5)

j=2 p X i=2

= D22 v2 + D21 v1 + c2 ,

Mi Y2−i + N0 v2 + N1 v1 +

q X

Nj v2−j (6)

j=2

(7)

3 Reformulating the ARMA(p,q) process as a linear transformation

5 P

where D22 = N0 , D21 = M1 N0 + N1 and c2 = M1 c1 + pi=2 Mi Y2−i + j=2 Nj v2−j . Similar expressions can be developed for Y3 , Y4 , etc. Setting

Pq

   Y =  

Y1 Y2 .. . YT





    , D =     

D11 D21 .. .



D22

DT 1 DT 2

..

. . . . DT T



    , v =     

v1 v2 .. . vT





    , c =     

c1 c2 .. .

   , (8)  

cT

we almost have the form required for the linear transformations in the previous section. The only difficulty is in the timing, since the different components of v become known at different points in time. However, it is possible to split the contributions of the different vt and render the process in SMPS as follows: BLOCKS LINTRAN * Set up the locations of all the elements in the vector Y * and record the contributions due to the constant term. BL NEWBLOCK stage_1 COL1(Y1) ROW1(Y1) c1_1 COL2(Y1) ROW2(Y1) c1_2 ... ... ... COLn(Y1) ROWn(Y1) c1_n COL1(Y2) ROW1(Y2) c2_1 COL2(Y2) ROW2(Y2) c2_2 ... ... ... COLm(YT) ROWm(YT) cT_m *------------------------------------* The elements of the random vector v_1 act on the first column * of blocks in the D-matrix (D_11...D_T1 in eq.(7)) RV V1_1 COL1 ROW1 d_11 COL2 ROW2 d_21 ... ... ... COLn ROWn d_n1 RV V1_2 COL1 ROW1 d_12 COL2 ROW2 d_22 ... ... ... COLn ROWn d_n2 RV V1_3 ... *-----------------------------------------BLOCKS LINTRAN ADD

4 Proposed extensions to the SMPS format

6

* The keyword ADD specifies that the realizations of this * random vector are to be added to previously defined values. * The components of Y_1 are not affected by this random vector. BL Y2 stage_2 COL1(Y2) ROW1(Y2) 0.0 COL2(Y2) ROW2(Y2) 0.0 ... ... ... COLm(YT) ROWm(YT) 0.0 * The elements of the second random vector v_2 act on the * second column of blocks in the D-matrix, etc. RV V2_1 ...

The advantage of this approach lies in the fact that it requires no extensions to the existing SMPS format. It also quite clearly shows how the realizations of v1 , v2 , etc., propagate through the data structure. Automatic systems, algebraic modelling languages in particular, can easily take advantage of this and readily prepare the necessary SMPS code. The disadvantage is that it is cumbersome to prepare such a scheme by hand, and readability for human eyes suffers. This makes maintenance of such a scheme very difficult. We propose an alternative method next.

4

Proposed extensions to the SMPS format

This section explains the two proposed extensions. The first extension allows the modelling of purely autoregressive processes (ARMA(p,0)); a second extension is necessary for the general ARMA(p,q) process.

4.1

History vectors

We begin by looking again at the purely autoregressive process ARMA(p,0). Since q = 0 we can rewrite equation (5) for Y2 in the form Y2 = M1 Y1 +

p X

Mi Y2−i + N0 v2

(9)

i=2

= M1 Y1 + N0 v2 + c2 , Pp

(10)

where c2 = i=2 Mi Y2−i , which is a deterministic vector. The only extension to the SMPS format that needs to be made is a way to specify the columns of the matrix M1 . This requires two things: A marker to separate the columns, and a device for identifying where the historical values are to come from. Both can be accomplished by special records using ‘HV’ in the code

4 Proposed extensions to the SMPS format

7

field and the location in the first two name fields. For clarity we also set the block header identifier from ‘LINTRAN’ to ‘ARMA’, although this is not really needed. The purpose is to alert the system to future occurrences of ‘HV’ codes later on. Consistency checks and problem verification might be enhanced if the presence of ‘HV’ code is permitted in ‘ARMA’ sections and prohibited in ordinary ‘LINTRAN’ sections. This same idea also works for t = 3, 4, etc. The historical values associated with the columns of matrices M2 , M3 , etc., can be referenced via ‘HV’-type records in the same fashion as M1 . The timing information is implicit in the reference, since it is known from the core file to which stage each stochastic element belongs. A one-dimensional random walk affecting one of the right-hand sides of a stochastic LP could thus be set up in SMPS as follows: DISTRIB V V BLOCKS BL Y_1 RHS HV RHS RHS RV V RHS BL Y_2 RHS HV RHS RHS RV V RHS ...

DISCRETE -1.0 1.0 ARMA STAGE_1 DEMD_1 DEMD_0 DEMD_1

0.5 0.5

0.0 1.0

DEMD_1 STAGE_2 DEMD_1 DEMD_1 DEMD_2

1.0

DEMD_2

1.0

0.0 1.0

The right-hand side value DEMD_0 in stage 0 is deterministic, hence it will have been defined in the core file. The random variable V needs to be set up only once; all blocks of Yt make reference to the same random variable, and copies are made as needed. When the random variables are accessed later, in the construction of a deterministic equivalent problem, for example, the timing information can be recovered from the column information of the D-matrix. As explained in more detail in section 5, the second innovation (i.e., the random variable v2 ) does not have to have the same distribution as v1 , nor is it necessary that the coefficients in the block Y_2 be the same as those of Y_1.

5 A financial planning example

4.2

8

Lagged variables

A second extension is needed to deal with the general ARMA(p,q) process for q > 0. The nonzero coefficients of the columns of the matrices Nj must be provided for j = 1, . . . , q. A record with the code ‘LV’ can be used to signal the start of each lagged random variable, but the timing information is no longer recoverable because it is not possible to determine which particular instance of a generic distribution is being referenced. A specific name must be associated with each such random variable on its first use, which is on an ‘RV’ record within a previous block. This specific name can be put in the third name field, which is not used otherwise. Additionally the second name field in such an ‘RV’ record is empty. To remove possible ambiguities if the SMPS file is written in free format (see [5]), the special key ‘LAGGED’ must be placed in the second name field whenever the ‘RV’ record refers back to a previous distribution section. These rules are illustrated with a complete example in the next section.

5

A financial planning example

The simple financial planning problem in this section is taken from the textbook by Birge and Louveaux [1]. The problem concerns a decision maker who, having available a fixed sum of money B, must choose among several investment opportunities in an attempt to increase his wealth to a target R by the end of the planning horizon. The performance of each investment is random, but the distribution is assumed to be known, based on historic performance. The final wealth is to be maximized, and a penalty is charged whenever the final wealth falls short of the target. At prespecified times the decision maker is allowed to observe the performance of the portfolio and to re-balance it by buying and selling investment instruments. (There are no transaction costs.) If all the distributions of the random variables are finite, this problem can be written mathematically as follows.

5 A financial planning example

min s.t.

S X s=0 I X i=1 I X

9

ps (βys − ws ) x0i

=B

α1is x0i −

i=1

I X i=1

I X

x1is

i=1

αt,i,s xt−1,i,a(s) − I X

= 0, s ∈ S1 I X

xtis

= 0, s ∈ St , t = 2, . . . , T − 1

i=1

αT,i,s xT −1,i,a(s) + ys − ws = R, s ∈ ST

i=1

x0i , xtis ≥ 0, i = 1, . . . , I, t = 2, . . . , T − 1, s ∈ St−1 ws , ys ≥ 0, s ∈ ST (11) where xtis is the amount of money invested in investment i during period t under scenario s, B is the original budget, R is the target wealth at the horizon, αtis is the return of investment i in period t under scenario s, β is the penalty (per dollar) of falling short of the target, ps is the probability of scenario s, ys and ws are the amount below and above the target, respectively, under scenario s, and St is the set of scenarios that are active in period t, with ST = {0, 1, 2, . . . , S}. The notation a(s) is used to designate the ancestor scenario of s in the preceding period. In the book by Birge and Louveaux, I = 2, T = 3, B = 55, R = 80, β = 4, and the returns αtis can take two possible values in each period, depending on whether the economy is good or bad. In a good economy, the returns are {1.25, 1.14} for the two investments, and in a bad economy the returns are {1.06, 1.12}. This leads to the event tree depicted in figure 1. In this section we will use a slightly more sophisticated model for the returns of the two instruments, namely the ARMA(2,2) model "

αt =

0.9 −0.1 0 0.9 "

+

#

0.06 0.02

"

αt−1 + #

"

vt +

0.1 0 0 0.1 0.02 0.01

#

αt−2

#

"

vt−1 +

−0.01 0

#

"

vt−2 +

0.1 0

#

,

where each random variable vt has a two-point discrete distribution with values {+1,−1}, which are each realized with probability 0.5. (More complicated distributions, even continuous ones, could be handled easily. For

5 A financial planning example

S0

10

S1

S2

S3 1 2 3 4 5 6 7 8

Fig. 1: Event tree for the four-stage investment problem.

more detail on how to specify distributions in SMPS, consult [5].) In order to give a complete specification of the problem we postulate historic values α0 = (1.20, 1.06), α−1 = (1.07, 1.10), v0 = +1, v−1 = −1. The structure of the event tree is the same as before, but the returns in the eight scenarios now are correlated between periods. The core file for this problem is given by the following: NAME ROWS N OBJECT E BALANCE0 E BALANCE1 E BALANCE2 E BALANCE3 COLS STOCKS0 BONDS0 STOCKS1 BONDS1 STOCKS2 BONDS2 SHORT OVER RHS RHS RHS ENDATA

FINPLAN

BALANCE0 BALANCE0 BALANCE1 BALANCE1 BALANCE2 BALANCE2 BALANCE3 BALANCE3

1.0 1.0 -1.0 -1.0 -1.0 -1.0 1.0 -1.0

BALANCE0 BALANCE3

55. 80.

BALANCE1 BALANCE1 BALANCE2 BALANCE2 BALANCE3 BALANCE3 OBJECT OBJECT

1.10 1.10 1.10 1.10 1.10 1.10 4.0 -1.0

(The entries with value 1.10 in the right-most column are placeholders

5 A financial planning example

11

for the stochastic returns whose values will be supplied in the stoch file.) The time file for this problem is TIME PERIODS STOCKS0 STOCKS1 STOCKS2 STOCKS3 ENDATA

FINPLAN OBJECT BALANCE1 BALANCE2 BALANCE3

STAGE0 STAGE1 STAGE2 STAGE3

The stoch file for this problem could look as follows. STOCH FINPLAN DISTRIB DISCRETE V 1.0 0.5 V -1.0 0.5 BLOCKS ARMA * * The first section sets up the distribution for the returns in STAGE1. * The historic contribution M1 Y_0 + M2 Y_{-1} + N1 V_0 + N2 V_{-1} * is known and is therefore given directly in the definition of the block, * added to the constant drift term (0.1, 0)’. * ----------------------------------------------------------------BL Y_1 STAGE1 STOCKS0 BALANCE1 1.211 BONDS0 BALANCE1 1.074 RV V ’LAGGED’ V_1 * Note specific name STOCKS0 BALANCE1 0.06 BONDS0 BALANCE1 0.02 * * The next section sets up the distribution for the returns in STAGE2. * The block definition contains the historic contribution M2 Y_0 + N2 V_0, * which is known, along with the drift term. * ----------------------------------------------------------------BL Y_2 STAGE2 STOCKS1 BALANCE2 0.110 BONDS1 BALANCE2 0.106 RV V ’LAGGED’ V_2 * Note specific name STOCKS1 BALANCE2 0.06 BONDS1 BALANCE2 0.02 * * Here we set up the matrix M1 ... * ----------------------------------------------------------------HV STOCKS0 BALANCE1 STOCKS1 BALANCE2 0.9

5 A financial planning example

HV BONDS0 STOCKS1 BONDS1

BALANCE1 BALANCE2 BALANCE2

12

-0.1 0.9

* * ... and the matrix N1. * ----------------------------------------------------------------LV V_1 * Note specific reference STOCKS1 BALANCE2 0.02 BONDS1 BALANCE2 0.01 * * Finally we set up the distribution for the returns in STAGE3. * The deterministic contribution consists only of the drift term. * ----------------------------------------------------------------BL Y_3 STAGE3 STOCKS2 BALANCE3 0.1 BONDS2 BALANCE3 0.0 * * This random variable is not used again, so no specific name is needed. * ----------------------------------------------------------------RV V STOCKS1 BALANCE2 0.06 BONDS1 BALANCE2 0.02 * * Here we have M1 again... * ----------------------------------------------------------------HV STOCKS1 BALANCE2 STOCKS2 BALANCE3 0.9 HV BONDS1 BALANCE2 STOCKS2 BALANCE3 -0.1 BONDS2 BALANCE3 0.9 * * ...then M2... * ----------------------------------------------------------------HV STOCKS0 BALANCE1 STOCKS2 BALANCE3 0.1 HV BONDS0 BALANCE1 BONDS2 BALANCE3 0.1 * * ...followed by N1 and N2. * ----------------------------------------------------------------LV V_2 STOCKS2 BALANCE3 0.02 BONDS2 BALANCE3 0.01 LV V_1 STOCKS2 BALANCE3 -0.01

6 Concluding remarks

13

ENDATA

A wide variety of distributions could be accommodated by simply changing the ‘DISTRIB’ section. There is further nothing to prevent the user from referencing different distributions on the ‘RV’ records in different time periods. In other words, the SMPS format does not require that the innovations vt be identically distributed. All that is required is that each vt be independent of the past. It is equally permissible for the matrices Mi and Nj to be functions of time.

6

Concluding remarks

SMPS is a powerful tool to record instances of stochastic linear programs. With two very simple extensions it can be made to express complicated correlation structures. This allows easy sampling of scenarios during the execution of adaptive or nonadaptive sampling procedures without the need to reenter an underlying algebraic modelling system. The efficiency thus gained should greatly increase the range of problems that can be solved in reasonable time.

Acknowledgements The first author was supported by a research from the Natural Sciences and Engineering Research Council of Canada (NSERC). We thank two anonymous referees for their thoughtful comments, which greatly improved the readability of this paper.

References [1] Birge, J.R., and F. Louveaux, (1997), Introduction to Stochastic Programming, Springer Verlag, New York. [2] Birge, J.R., M.A.H. Dempster, H.I. Gassmann, E.A. Gunn, A.J. King and S.W. Wallace, (1987), “A standard input format for multiperiod stochastic linear programs”, COAL Newsletter 17 1–19. [3] Chiralaksanakul, A. and D. Morton, (2004), “Assessing policy quality in multi-stage stochastic programming”, available on-line from Stochastic Progamming Electronic Preprint Series, http://edoc.huberlin.de/browsing/speps/.

6 Concluding remarks

14

[4] Dash Optimization, (undated), “Release notes for XPRESS MP 2006a”, world-wide web document http://www.dashoptimization.com/home/products/development/release notes 2006.html, accessed 5 November 2006. [5] Gassmann, H.I., and E. Schweitzer, (2001), “A comprehensive input format for stochastic linear programs”, Annals of Operations Research 104 89–125. [6] Higle, J. and S. Sen, (1996), Stochastic Decomposition: A Statistical Method for Large-Scale Stochastic Linear Programming, Kluwer Academic Publishers, Norwell, MA. [7] Infanger, G. (1997), “GAMS/DECIS User’s Guide”, Stanford University. [8] International Business Machines, Inc. (undated), “Passing your model to OSL using Mathematical Programming System (MPS) format”, world-wide web document, http://www306.ibm.com/software/data/bi/osl/pubs/Library/featur11.htm, accessed 1 February 2005. [9] Shapiro, A. and T. Homem-de-Mello, (1998), “A simulation-based appoach to two-stage stochastic programming with recourse”, Mathematical Programming 81 301–325. [10] Wolfram Research, Inc. (2005), “Multivariate ARMA Models”, world-wide web document, http://documents.wolfram.com/applications/ timeseries/UsersGuidetoTimeSeries/1.2.5.html, accessed 1 February 2005. [11] Valente, P., G. Mitra and C.A. Poojari, (2005), “A stochastic programming integrated environment (SPInE)”, in: S.W. Wallace and W.T. Ziemba (eds), Applications of Stochastic Programming, SIAM Series on Optimization, pp. 115–136.

Suggest Documents