<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Minimize Correlation between Selected Observations in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/440163#M2195</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) You have declared ads as both a number and an impvar. You probably want to comment out the number statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I don't know if this has changed from the example you mention, but the 'org' and 's' are arrays so you need the suffix org[i] and s[i] for the impvar statement to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) All 'ads' and 'dep' references in the 'correlation' objective need to specify their array index too, i.e. ads[i] and dep[i]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That should help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2018 12:15:42 GMT</pubDate>
    <dc:creator>Berliner_Ørsted</dc:creator>
    <dc:date>2018-02-26T12:15:42Z</dc:date>
    <item>
      <title>Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/418851#M2104</link>
      <description>&lt;P&gt;I am trying to write a model that selects items for an assessment. We have a measure of lexical similarity between item pairs that we would like to minimize. The intent is to select a set of items that are as diverse as possible. The similarity index is essentially a correlation matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code below seems to do what I want for simple problems (e.g., selecting 15 items from a pool of 100), but it does not scale well when either the pool or the number of items selected increase. Are there any suggestions on how to make this model more efficient? A large percentage of the elements in the correlation matrix are 0, if that affects any suggestions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;
set QuestionIDs;
read data ItemData into QuestionIDs = [questionid];

num CSI {i in QuestionIDs,j in QuestionIDs} init 0;
read data tall into [Q1 Q2] CSI CSI[Q2,Q1]=CSI;

var x{QuestionIDs} BINARY;

constraint TotItems: sum{i in QuestionIDs}x[i]=15;

var Ynew{i in questionIDs, j in questionIDs: j&amp;gt;i} BINARY;
	constraint lin1{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;lt;= x[i];
	constraint lin2{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;lt;= x[j];
	constraint lin3{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;gt;= x[i]+x[j]-1;

min totCSI = sum{i in questionIDs, j in questionIDs: j&amp;gt;i}Ynew[i,j]*CSI[i,j];

solve with milp;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:22:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/418851#M2104</guid>
      <dc:creator>CaseyCodd</dc:creator>
      <dc:date>2017-12-06T16:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/418898#M2106</link>
      <description>&lt;P&gt;Assuming CSI[i,j] &amp;gt;= 0, your constraints lin1 and lin2 will naturally be satisfied because of the objective, so you could reduce the problem size by omitting them.&amp;nbsp; If that doesn't help, please share the data.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 17:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/418898#M2106</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-12-06T17:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/418923#M2107</link>
      <description>&lt;P&gt;The selection variable X determines whether an individual item will appear on the test. Because CSI is about correlations (i.e., relationships between&lt;EM&gt; item pairs&lt;/EM&gt;), I created Ynew to determine whether the pair X[i] and X[j] were both selected. Logically,&amp;nbsp;Ynew[i,j] = X[i]*X[j]. In words, if both i and j are selected, then the item pair comprised of i and j is also selected. If either i or j is not selected, then the pair [i,j] is also not selected. The problem with Ynew[i,j]=X[i]*X[j] is that it is nonlinear. Therefore, I used the constraints lin1, lin2, and lin3 to linearize that relationship. Is there a better way to do this part?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added some data to the code below. I reduced the example to just 5 items for simplicity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Itemdata;
input questionid;
datalines;
227447
227450
227451
227452
227481
;

data CSI;
input Q1 Q2 CSI;
datalines;
227447	227447	1
227450	227450	1
227451	227447	0.084515426
227451	227451	1
227452	227447	0.07100716
227452	227450	0.019418391
227452	227452	1
227481	227447	0.135526185
227481	227481	1
;

proc optmodel;
set QuestionIDs;
read data ItemData into QuestionIDs = [questionid];

num CSI {i in QuestionIDs,j in QuestionIDs} init 0;
read data tall into [Q1 Q2] CSI CSI[Q2,Q1]=CSI;

var x{QuestionIDs} BINARY;

constraint TotItems: sum{i in QuestionIDs}x[i]=3;

var Ynew{i in questionIDs, j in questionIDs: j&amp;gt;i} BINARY;
	constraint lin1{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;lt;= x[i];
	constraint lin2{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;lt;= x[j];
	constraint lin3{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;gt;= x[i]+x[j]-1;

min totCSI = sum{i in questionIDs, j in questionIDs: j&amp;gt;i}Ynew[i,j]*CSI[i,j];

solve with milp;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2017 19:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/418923#M2107</guid>
      <dc:creator>CaseyCodd</dc:creator>
      <dc:date>2017-12-06T19:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/418926#M2108</link>
      <description>&lt;P&gt;Yes, that is the standard way to model the product of two binary variables.&amp;nbsp; But because of your minimization objective, the solver naturally "wants" to make Ynew[i,j] small, so without loss of optimality you can omit constraints lin1 and lin2 and enforce the nonlinear relationship Ynew[i,j] &amp;gt;= x[i]*x[j] via the linear constraint lin3.&amp;nbsp; You will get the same optimal objective value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If CSI[i,j] = 0,&amp;nbsp;the solver might return Ynew[i,j] = 1 when x[i] = 0 and x[j] = 0.&amp;nbsp; If it is important that Ynew[i,j] = x[i]*x[j], you can postprocess as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;
   set QuestionIDs;
   read data ItemData into QuestionIDs = [questionid];

   num CSI {i in QuestionIDs,j in QuestionIDs} init 0;
   read data CSI into [Q1 Q2] CSI CSI[Q2,Q1]=CSI;

   var x{QuestionIDs} BINARY;

   constraint TotItems: sum{i in QuestionIDs}x[i]=3;

   var Ynew{i in questionIDs, j in questionIDs: j&amp;gt;i} BINARY;
/*	constraint lin1{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;lt;= x[i];*/
/*	constraint lin2{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;lt;= x[j];*/
   constraint lin3{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;gt;= x[i]+x[j]-1;

   min totCSI = sum{i in questionIDs, j in questionIDs: j&amp;gt;i}Ynew[i,j]*CSI[i,j];

   solve with milp;
   print X Ynew;

   /* postprocess */
   for {i in QuestionIDs, j in QuestionIDs: j&amp;gt;i} Ynew[i,j] = x[i]*x[j];
   print X Ynew;
   print totCSI;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Omitting constraints lin1 and lin2 reduces the problem size&amp;nbsp;and will likely speed up the solver.&amp;nbsp; Please try it on your larger instance and see if it helps.&amp;nbsp; If it is still too slow, I have a couple of further ideas.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 19:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/418926#M2108</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-12-06T19:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/419184#M2110</link>
      <description>&lt;P&gt;Thank you for that suggestion. I was previously getting out of memory errors almost instantly, and with this modification it ran for more than an hour before giving an out of memory error. If you have other suggestions, I would appreciate them. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 14:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/419184#M2110</guid>
      <dc:creator>CaseyCodd</dc:creator>
      <dc:date>2017-12-07T14:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/419229#M2111</link>
      <description>&lt;P&gt;Please share your data, and I'll take a look.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 16:09:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/419229#M2111</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-12-07T16:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/419252#M2112</link>
      <description>&lt;P&gt;The attached data files are more representative of the larger problem. Change the selection in the previous code to 150 instead of 3.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 17:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/419252#M2112</guid>
      <dc:creator>CaseyCodd</dc:creator>
      <dc:date>2017-12-07T17:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/419702#M2114</link>
      <description>&lt;P&gt;Here are three additional ideas you can try individually or in combination:&lt;/P&gt;
&lt;P&gt;1. Relax the Ynew variables to &amp;gt;= 0 instead of binary.&amp;nbsp; They will automatically take {0,1} values at optimality.&lt;/P&gt;
&lt;P&gt;2. Add the following valid constraint, which can be derived by multiplying both sides of TotItems by x[j]:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;constraint Cut {j in QuestionIDs}: 
      sum {i in QuestionIDs: j&amp;gt;i} Ynew[i,j] 
    + sum {i in QuestionIDs: j&amp;lt;i} Ynew[j,i] 
    = (150-1)*x[j];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;3. Solve the (nonconvex) NLP relaxation of the original quadratic problem and round the resulting solution to get an integer feasible solution, which you can use as a warm start for the MILP solver:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;
   set QuestionIDs;
   read data ItemData into QuestionIDs = [questionid];

   num CSI {i in QuestionIDs,j in QuestionIDs} init 0;
   read data tall into [Q1 Q2] CSI CSI[Q2,Q1]=CSI;

   var x{QuestionIDs} BINARY;

   constraint TotItems: sum{i in QuestionIDs}x[i]=150;

   min totCSI_quadratic = sum{i in questionIDs, j in questionIDs: j&amp;gt;i} CSI[i,j]*x[i]*x[j];

   solve with nlp relaxint / ms;
   print {i in QuestionIDs: x[i].sol &amp;gt; 1e-6} x;

/*   var Ynew{i in questionIDs, j in questionIDs: j&amp;gt;i} BINARY;*/
   var Ynew{i in questionIDs, j in questionIDs: j&amp;gt;i} &amp;gt;= 0;
/* constraint lin1{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;lt;= x[i];*/
/* constraint lin2{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;lt;= x[j];*/
   constraint lin3{i in QuestionIDs, j in QuestionIDs: j&amp;gt;i}: Ynew[i,j] &amp;gt;= x[i]+x[j]-1;

   for {i in QuestionIDs} x[i] = round(x[i]);
   for {i in QuestionIDs, j in QuestionIDs: j&amp;gt;i} Ynew[i,j] = x[i]*x[j];
   min totCSI = sum{i in questionIDs, j in questionIDs: j&amp;gt;i}Ynew[i,j]*CSI[i,j];

   /* optional */
*   constraint Cut {j in QuestionIDs}: 
      sum {i in QuestionIDs: j&amp;gt;i} Ynew[i,j] 
    + sum {i in QuestionIDs: j&amp;lt;i} Ynew[j,i] 
    = (150-1)*x[j];

   solve with milp / primalin;

   create data outdata from [i]={i in QuestionIDs: x[i].sol &amp;gt; 0.5} x;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 20:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/419702#M2114</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-12-09T20:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/420466#M2122</link>
      <description>&lt;P&gt;Thank you for your help, Rob.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 14:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/420466#M2122</guid>
      <dc:creator>CaseyCodd</dc:creator>
      <dc:date>2017-12-12T14:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/420498#M2123</link>
      <description>&lt;P&gt;Glad to help.&amp;nbsp; In case you want to do a literature search, your problem is equivalent to the maximum edge-weight clique problem (MEWCP), which is NP-hard.&amp;nbsp; To see the correspondence, just negate your objective coefficients and change min to max.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 15:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/420498#M2123</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-12-12T15:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/440159#M2194</link>
      <description>&lt;P&gt;Hi Robpratt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is on maximizing the correlation with PROC OPTMODEL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to Proc optmodel.&lt;/P&gt;&lt;P&gt;In your one of the previous post in the year 2012 subject line is&amp;nbsp;&lt;SPAN&gt;Proc OptModel Help on Maximize Correlation)&lt;/SPAN&gt;, you had provided the solution.&lt;/P&gt;&lt;P&gt;When&amp;nbsp;i tried&amp;nbsp;running the same&amp;nbsp;code in SAS 9.4, I am getting&amp;nbsp;an error message. could you please help on the same&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;following are&amp;nbsp; the data and code&lt;/P&gt;&lt;P&gt;data cor;&lt;/P&gt;&lt;P&gt;input org dep;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;11785895 7.42&lt;/P&gt;&lt;P&gt;2335492 7.58&lt;/P&gt;&lt;P&gt;2345245 7.58&lt;/P&gt;&lt;P&gt;2392912 7.53&lt;/P&gt;&lt;P&gt;12755890 7.63&lt;/P&gt;&lt;P&gt;2918402 7.67&lt;/P&gt;&lt;P&gt;2773183 7.68&lt;/P&gt;&lt;P&gt;2824198 7.65&lt;/P&gt;&lt;P&gt;12263433 7.53&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;BR /&gt;set w;&lt;BR /&gt;number org{w};&lt;BR /&gt;number ads{w};&lt;BR /&gt;number dep{w};&lt;BR /&gt;var s{w} &amp;gt;= 0 &amp;lt;= .8 init 1;&lt;BR /&gt;read data cor into w = [_n_] org dep;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; impvar&amp;nbsp;ads {i in w} = org&amp;nbsp;&lt;I&gt;* s;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;max correlation = (10*sum{i in w}(ads&lt;I&gt;*dep) - (sum{i in w}(ads)) * (sum{i in w}(dep)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; / (sqrt(10*sum{i in w}(ads^2) - (sum{i in w}(ads))^2) * sqrt(10*sum{i in w}(dep^2) - (sum{i in w}(dep))^2));&lt;BR /&gt;solve;&lt;BR /&gt;print s correlation;&lt;BR /&gt;quit;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;Log message after running the code&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;96 proc optmodel;&lt;BR /&gt;NOTE: Writing HTML Body file: sashtml20.htm&lt;BR /&gt;597 set w;&lt;BR /&gt;598 number org{w};&lt;BR /&gt;599 number ads{w};&lt;BR /&gt;600 number dep{w};&lt;BR /&gt;601 var s{w} &amp;gt;= 0 &amp;lt;= .8 init 1;&lt;BR /&gt;602 read data cor into w = [_n_] org dep;&lt;BR /&gt;NOTE: There were 9 observations read from the data set WORK.COR.&lt;BR /&gt;603&lt;BR /&gt;604 impvar ads {i in w} = org * s;&lt;BR /&gt;--- ---&lt;BR /&gt;517 614&lt;BR /&gt;ERROR 517-782: The name 'ads' is already declared.&lt;/P&gt;&lt;P&gt;ERROR 614-782: The name 'org' is an array.&lt;/P&gt;&lt;P&gt;604! impvar ads {i in w} = org * s;&lt;BR /&gt;-&lt;BR /&gt;614&lt;BR /&gt;ERROR 614-782: The name 's' is an array.&lt;/P&gt;&lt;P&gt;605&lt;BR /&gt;606 max correlation = (10*sum{i in w}(ads*dep) - (sum{i in w}(ads)) * (sum{i in w}(dep)))&lt;BR /&gt;--- ---&lt;BR /&gt;614 614&lt;BR /&gt;ERROR 614-782: The name 'ads' is an array.&lt;/P&gt;&lt;P&gt;606! max correlation = (10*sum{i in w}(ads*dep) - (sum{i in w}(ads)) * (sum{i in w}(dep)))&lt;BR /&gt;--- ---&lt;BR /&gt;614 614&lt;BR /&gt;ERROR 614-782: The name 'dep' is an array.&lt;BR /&gt;607 / (sqrt(10*sum{i in w}(ads^2) - (sum{i in w}(ads))^2) * sqrt(10*sum{i in w}(dep^2) -&lt;BR /&gt;--- ---&lt;BR /&gt;614 614&lt;BR /&gt;ERROR 614-782: The name 'ads' is an array.&lt;/P&gt;&lt;P&gt;607! / (sqrt(10*sum{i in w}(ads^2) - (sum{i in w}(ads))^2) * sqrt(10*sum{i in w}(dep^2) -&lt;BR /&gt;---&lt;BR /&gt;---&lt;BR /&gt;614&lt;BR /&gt;614&lt;BR /&gt;607! (sum{i in w}(dep))^2));&lt;BR /&gt;ERROR 614-782: The name 'dep' is an array.&lt;/P&gt;&lt;P&gt;608 solve;&lt;BR /&gt;NOTE: Problem generation will use 4 threads.&lt;BR /&gt;NOTE: Previous errors might cause the problem to be resolved incorrectly.&lt;BR /&gt;NOTE: The problem has 9 variables (0 free, 0 fixed).&lt;BR /&gt;NOTE: The problem has 0 linear constraints (0 LE, 0 EQ, 0 GE, 0 range).&lt;BR /&gt;NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).&lt;BR /&gt;NOTE: The OPTMODEL presolver is disabled for linear problems.&lt;BR /&gt;WARNING: No objective has been specified. A constant zero objective will be used.&lt;BR /&gt;NOTE: The problem is a pure network instance. The ALGORITHM=NETWORK option is recommended for&lt;BR /&gt;solving problems with this structure.&lt;BR /&gt;NOTE: The LP presolver value AUTOMATIC is applied.&lt;BR /&gt;NOTE: The LP presolver removed all variables and constraints.&lt;BR /&gt;NOTE: Optimal.&lt;BR /&gt;NOTE: Objective = 0.&lt;BR /&gt;609 print s correlation;&lt;BR /&gt;ERROR: The symbol 'correlation' has no value at line 609 column 9.&lt;BR /&gt;610 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE OPTMODEL used (Total process time):&lt;BR /&gt;real time 1.71 seconds&lt;BR /&gt;cpu time 0.79 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please look into that. thanks Ajit&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 12:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/440159#M2194</guid>
      <dc:creator>deadsea</dc:creator>
      <dc:date>2018-02-26T12:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/440163#M2195</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) You have declared ads as both a number and an impvar. You probably want to comment out the number statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I don't know if this has changed from the example you mention, but the 'org' and 's' are arrays so you need the suffix org[i] and s[i] for the impvar statement to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) All 'ads' and 'dep' references in the 'correlation' objective need to specify their array index too, i.e. ads[i] and dep[i]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That should help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 12:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/440163#M2195</guid>
      <dc:creator>Berliner_Ørsted</dc:creator>
      <dc:date>2018-02-26T12:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize Correlation between Selected Observations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/440165#M2196</link>
      <description>&lt;P&gt;Thank you so much for the quick solution.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 12:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Minimize-Correlation-between-Selected-Observations/m-p/440165#M2196</guid>
      <dc:creator>deadsea</dc:creator>
      <dc:date>2018-02-26T12:36:55Z</dc:date>
    </item>
  </channel>
</rss>

