Hello everyone,

How can I create N random subsets from my initial set of observations and run my Gams model for each of these subsets? To better explain what I want to do I provide the following example:

SETS i /1*100/

j ‘outputs and inputs’ /y, x1, x2/

outp(j) /y/

inp(j) /x1,x2/

$CALL GDXXRW.EXE firms.xlsx par=data rng=sheet1!A1:C101

Parameter data(i,j);

$GDXIN firms.gdx

$LOAD data

$GDXIN

display data;

PARAMETERS

…;

EQUATIONS

…;

MODEL SP1 /…/;

SOLVE SP1 USING NLP MAXIMIZING Z;

Using the code above I have loaded a data set in GAMS that contains 100 observations and 3 variables. I know how to specify parameters and variables, assign the data to specific variables, and generate equations to be used in the solve statement. My question is how can I make GAMS generate, for example, 10 random subsets of let’s say 50 observations each and run the model separately for each of these subsets.

Thank you in advance for your help.

Theo