119
120 proc iml worksize=60155645440;
NOTE: Worksize = 262128
NOTE: Symbol size = 262128
NOTE: IML Ready
121
122 /* Store the status-quo param0 as a vector */
123 use work.param0;
124 read all var {psq} into pre_param0;
125 param0 = exp(pre_param0);
126
127 /* Storing the number of employees */
128 dim = nrow(param0);
129
130 /* Retrieve the coefficient columns as vectors */
131 use work.olsmat;
132 read all var {g1} into g1;
133 read all var {g2} into g2;
134 read all var {g3} into g3;
135 read all var {g4} into g4;
136 read all var {g5} into g5;
137 read all var {g2_g1} into g2_g1;
138 read all var {g4_g1} into g4_g1;
139 read all var {g3_g1} into g3_g1;
140 read all var {g5_g1} into g5_g1;
141
142 /* Retrieve status quo tots */
143 tot0 = (g1` // g2` // g3` // g4` // g5` // g2_g1` // g4_g1` // g3_g1` // g5_g1`)*log(param0);
144 print tot0;
145
146 /* Declare initial guess */
147 z0 = j(1,dim,0);
148 r0 = j(1,dim,0.1);
149
150 /* Defining the objective function */
151 start rev(x);
152
152 ! S = sum(x);
153
153 ! return(S);
154 finish rev;
NOTE: Module REV defined.
5 The SAS System 11:56 Thursday, October 10, 2024
155
156 /* Declaring the gradient of the obj function */
157 start gradient(x) global(dim);
158
158 ! g = j(1,dim,1);
159
159 ! return(g);
160 finish gradient;
NOTE: Module GRADIENT defined.
161
162 /* Defining lower and upper bounds */
163 cap = 0.05;
164 upper = cap*param0;
165 noupper = j(dim,1,.);
166 lower = j(dim,1,0);
167 bounds = lower` // upper`;
168 bounds_noupper = lower` // noupper`;
169
170 /* Defining the nonlinear constraints */
171 start constr(x) global(param0, g1, g2, g3, g4, g5, g2_g1, g4_g1, g3_g1, g5_g1);
172
172 ! prov = log(param0`+x);
173
173 ! matc = j(9,1,.);
174
174 ! matc[1,1] = prov*g1;
175
175 ! matc[2,1] = prov*g2;
176
176 ! matc[3,1] = prov*g3;
177
177 ! matc[4,1] = prov*g4;
178
178 ! matc[5,1] = prov*g5;
179
179 ! matc[6,1] = prov*g2_g1;
180
180 ! matc[7,1] = prov*g3_g1;
181
181 ! matc[8,1] = prov*g4_g1;
182
182 ! matc[9,1] = prov*g5_g1;
183
183 ! return(matc);
184 finish constr;
NOTE: Module CONSTR defined.
185
186 /* Declaring the Jacobian of the constraint */
187 start jacobian(x) global(param0, g1, g2, g3, g4, g5, g2_g1, g4_g1, g3_g1, g5_g1);
188
188 ! prov = param00`+x;
189
189 ! jac1 = g1`/prov;
190
190 ! jac2 = g2`/prov;
191
191 ! jac3 = g3`/prov;
192
6 The SAS System 11:56 Thursday, October 10, 2024
192 ! jac4 = g4`/prov;
193
193 ! jac5 = g5`/prov;
194
194 ! jac6 = g2_g1`/prov;
195
195 ! jac7 = g3_g1`/prov;
196
196 ! jac8 = g4_g1`/prov;
197
197 ! jac9 = g5_g1`/prov;
198
198 ! return(jac1 // jac2 // jac3 // jac4 // jac5 // jac6 // jac7 // jac8 // jac9);
199 finish jacobian;
NOTE: Module JACOBIAN defined.
200
201 /* Defining Problem Options */
202 optn= j(1,11,.);
203 optn[2]=1;
203 ! /* output printing options */
204 optn[10]=9;
204 ! /* number of nonlinear constraints */
205 optn[11]=0;
205 ! /* number of equality constraints */
206
207 /* Define Termination Criteria */
208 terc = j(1,13,.);
209 terc[1] = 10000;
210 terc[2] = 25000;
211 terc[4] = 1E-5;
212 terc[6] = 1E-5;
213 terc[8] = 1E-5;
214
215 /* Call the optimization method */
216 call nlpqn(rc, xres, "rev", z0, optn, bounds_noupper) tc=terc nlc="constr" grd="gradient" jacnlc="jacobian";
ERROR: (execution) Unable to allocate sufficient memory.
operation : NLPQN at line 216 column 1
operands : *LIT1065, z0, optn, bounds_noupper, terc, , , *LIT1067, *LIT1066, *LIT1068
*LIT1065 1 row 1 col (character, size 3)
rev
z0 1 row 16591 cols (numeric)
optn 1 row 11 cols (numeric)
bounds_noupper 2 rows 16591 cols (numeric)
terc 1 row 13 cols (numeric)
*LIT1067 1 row 1 col (character, size 8)
gradient
*LIT1066 1 row 1 col (character, size 6)
constr
*LIT1068 1 row 1 col (character, size 8)
7 The SAS System 11:56 Thursday, October 10, 2024
jacobian
statement : CALL at line 216 column 1
217
218 print rc;
ERROR: Matrix rc has not been set to a value.
statement : PRINT at line 218 column 1
219 optimum = xres`;
ERROR: (execution) Matrix has not been set to a value.
operation : ` at line 219 column 15
operands : xres
xres 0 row 0 col (type ?, size 0)
statement : ASSIGN at line 219 column 1
220
221 tot1 = (g1` // g2` // g3` // g4` // g5` // g2_g1` // g4_g1` // g3_g1` // g5_g1`)*log(param0+optimum);
ERROR: (execution) Matrix has not been set to a value.
operation : + at line 221 column 92
operands : param0, optimum
param0 16591 rows 1 col (numeric)
optimum 0 row 0 col (type ?, size 0)
statement : ASSIGN at line 221 column 1
222 print tot1;
ERROR: Matrix tot1 has not been set to a value.
statement : PRINT at line 222 column 1
223
224 create optout from optimum[colname="rem"];
ERROR: Matrix optimum has not been set to a value.
statement : CREATE at line 224 column 1
225 append from optimum;
ERROR: No data set is currently open for output.
statement : APPEND at line 225 column 1
226 close optout;
NOTE: Cannot close WORK.OPTOUT; it is not open.
227
228 quit;
NOTE: Exiting IML.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IML used (Total process time):
real time 0.61 seconds
cpu time 0.57 seconds
... View more