<?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: Finding the optimal cut-off for each bucket in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/292060#M1432</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77035"&gt;@sai_ch﻿&lt;/a&gt;, please check whether changing the error formula as follows matches your new objective for a small instance:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;num error {&amp;lt;i,j&amp;gt; in CUSTOMER_PAIRS} = sum {k in i..j-1} abs(pd[k] - avg_def[i,j]);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then I'll look into making the code more scalable.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2016 03:41:45 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2016-08-17T03:41:45Z</dc:date>
    <item>
      <title>Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291543#M1413</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is&amp;nbsp;my first attempt&amp;nbsp;PROC OPTMODEL and would appreciate any help to solve the problem at hand. Through optimization, I am try to determine the optimal cut-off&amp;nbsp;for&amp;nbsp;each bucket such that the error is minmized between&amp;nbsp;avg. PD&amp;nbsp;and the avg. Def.&amp;nbsp;Below&amp;nbsp;are the datasets I have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Dataset 1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Dataset 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;PD&lt;/TD&gt;&lt;TD&gt;Def&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Bucket&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0001&lt;/TD&gt;&lt;TD&gt;0.24%&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0002&lt;/TD&gt;&lt;TD&gt;0.02%&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0003&lt;/TD&gt;&lt;TD&gt;0.89%&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0004&lt;/TD&gt;&lt;TD&gt;3.50%&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0005&lt;/TD&gt;&lt;TD&gt;6.80%&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0006&lt;/TD&gt;&lt;TD&gt;0.008%&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0007&lt;/TD&gt;&lt;TD&gt;15.20%&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0008&lt;/TD&gt;&lt;TD&gt;28.20%&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0009&lt;/TD&gt;&lt;TD&gt;2.23%&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0010&lt;/TD&gt;&lt;TD&gt;1.25%&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to determine the optimal PD value for each bucket such that 1. The error, difference between avg. PD and avg Def, is minimized for each bucket. 2. The sum of error across buckets is minimized.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2016 20:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291543#M1413</guid>
      <dc:creator>sai_ch</dc:creator>
      <dc:date>2016-08-13T20:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291548#M1414</link>
      <description>&lt;P&gt;I'd like to help, but I don't quite understand what you want to do. &amp;nbsp;Can you please provide a sample solution (not necessarily optimal), together with the calculation of the errors?&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2016 22:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291548#M1414</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-08-13T22:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291552#M1415</link>
      <description>&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;Sorry for not clearly explaining the problem. The below table shows a sample solution and error calculation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Bucket&lt;/TD&gt;&lt;TD&gt;Cut-off Val&lt;/TD&gt;&lt;TD&gt;Avg. PD&lt;/TD&gt;&lt;TD&gt;Avg Def&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0.24%&lt;/TD&gt;&lt;TD&gt;0.014%&lt;/TD&gt;&lt;TD&gt;0.00%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1.25%&lt;/TD&gt;&lt;TD&gt;0.57%&lt;/TD&gt;&lt;TD&gt;0.00%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;3.50%&lt;/TD&gt;&lt;TD&gt;1.74%&lt;/TD&gt;&lt;TD&gt;50%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;7.00%&lt;/TD&gt;&lt;TD&gt;5.15%&lt;/TD&gt;&lt;TD&gt;50%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;30.00%&lt;/TD&gt;&lt;TD&gt;21.70%&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;error=(0.014%-0.00%) + (0.57%-0.00%)+(1.74%-50%)+(5.15%-50%)+(21.70%-100%)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to optimally determine the cut-off&amp;nbsp;value for each bucket. All customers with PD less than a buckets'&amp;nbsp;cut-off will fall in that bucket. For example, customers 9 and 10 fall in bucket 3 and their average PD is 1.74%. Customer 10 defaulted in that bucket thereby giving it an average default rate of 50%. The cut-off value for each bucket should be determined such that the difference between avg PD and avg Default Rate for&amp;nbsp;each bucket&amp;nbsp;is minimized.&lt;/P&gt;&lt;P&gt;Please do let me know if things are not clear and thanks for taking a look the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 01:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291552#M1415</guid>
      <dc:creator>sai_ch</dc:creator>
      <dc:date>2016-08-14T01:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291565#M1416</link>
      <description>&lt;PRE&gt;
If I understand what you mean, You want divide that table into 5 groups
according to PD value(from min to  max ) ,and make that error minimize ?
Also assuming you want ABS(error) be min not error.
Here is my IML code:


data have;
call streaminit(1234);
 do customer=1 to 100;
  pd=rand('uniform');
  def=rand('bern',0.5);
  output;
 end;
 format pd percent8.2;
run;
proc sort data=have;by pd;run;

proc iml;
use have;
read all var {pd def} into have ;
close ;

start function(x) global(have);
 xx=t(x);
 n=nrow(xx);
 call sort(xx,1);
 start_end=t(loc(t(xx)^={.}||remove(xx,n))) ||
           t(loc(t(xx)^=remove(xx,1)||{.}));

 temp=j(nrow(start_end),2,.);
 do i=1 to nrow(start_end);
  idx=start_end[i,1]:start_end[i,2];
  temp[i,1]=mean(have[idx,1]);
  temp[i,2]=mean(have[idx,2]);
 end;
 obj=abs(sum(temp[,1]-temp[,2]));
return (obj);
finish;

nrow=nrow(have);
group=5;  /* &amp;lt;--Change it(divide into 5 groups)*/

encoding=j(2,nrow,1);
encoding[2,]=group;    

id=gasetup(2,nrow,123456789);
call gasetobj(id,0,"function");
call gasetsel(id,100,1,1);
call gainit(id,1000,encoding);


niter = 1000;
do i = 1 to niter;
 call garegen(id);
 call gagetval(value, id);
end;
call gagetmem(mem, value, id, 1);

groups=t(mem);
call sort(groups,1);
create groups var {groups};
append;
close;
print value[l = "Min Value:"] ;
call gaend(id);
quit;
 

data temp;
 merge groups have;
run;
proc summary data=temp;
 by groups;
 var pd def;
 output out=want(drop=_:) max(pd)=cut_off_value mean=avg_pd avg_def;
run;
proc print noobs;run;




OUTPUT:


Min Value:
5.5935E-6
GROUPS	cut_off_value	avg_pd	avg_def
1	14.64%	8.98%	0.68421
2	33.94%	24.93%	0.47619
3	61.37%	49.23%	0.36000
4	81.98%	72.48%	0.29412
5	99.59%	92.50%	0.66667
&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Aug 2016 09:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291565#M1416</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-14T09:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291586#M1417</link>
      <description>&lt;P&gt;Thanks for the reply Ksharp. It will take me some time to digest the PROC IML approach. You described the problem quite well. I am trying to form 5 groups based on PD cut-off values. The determination of the cut-off value is driven by the minimization of the difference between avgerage PD and average Def rate for each group and then the minmization of the sum of error for all groups.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 13:42:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291586#M1417</guid>
      <dc:creator>sai_ch</dc:creator>
      <dc:date>2016-08-14T13:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291588#M1418</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;, your objective value does not match the solution.&amp;nbsp; I think you need to change abs(sum( to sum(abs( in your calculation of obj.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 14:06:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291588#M1418</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-08-14T14:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291591#M1419</link>
      <description>&lt;P&gt;Yes, I understand what you want now.&amp;nbsp; You can model the problem as a shortest path problem and use the network solver in PROC OPTMODEL, as described in the "Bucket Optimization" section of this SAS/OR presentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/rnd/app/or/papers/INFORMS_2014_Spring.pdf" target="_blank"&gt;http://support.sas.com/rnd/app/or/papers/INFORMS_2014_Spring.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll modify the arc costs to implement your&amp;nbsp;absolute error&amp;nbsp;objective and provide the code soon.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 14:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291591#M1419</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-08-14T14:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291602#M1420</link>
      <description>&lt;P&gt;The following code implements the shortest path approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   input Customer $ PD percent. Def;
   datalines;
0001 0.24% 0
0002 0.02% 0
0003 0.89% 0
0004 3.50% 0
0005 6.80% 1
0006 0.008% 0
0007 15.20% 1
0008 28.20% 1
0009 2.23% 0
0010 1.25% 1
; 

proc sort data=have;
   by pd;
run;

%let num_buckets = 5;
proc optmodel;
   set CUSTOMERS;
   str customer_id {CUSTOMERS};
   num pd {CUSTOMERS};
   num def {CUSTOMERS};
   read data have into CUSTOMERS=[_N_] customer_id=customer pd def;

   num dummy_customer init card(CUSTOMERS)+1;
   CUSTOMERS = CUSTOMERS union {dummy_customer};
   set CUSTOMER_PAIRS = {i in CUSTOMERS, j in CUSTOMERS: i &amp;lt; j};
   num avg_pd {&amp;lt;i,j&amp;gt; in CUSTOMER_PAIRS} = 
      (sum {k in i..j-1} pd[k]) / (j-i);
   num avg_def {&amp;lt;i,j&amp;gt; in CUSTOMER_PAIRS} = 
      (sum {k in i..j-1} def[k]) / (j-i);
   num error {&amp;lt;i,j&amp;gt; in CUSTOMER_PAIRS} = 
      abs(avg_pd[i,j] - avg_def[i,j]);
   set CUSTOMERS_BUCKETS = CUSTOMERS cross 1..&amp;amp;num_buckets+1;
   num node_id {CUSTOMERS_BUCKETS};
   set NODES = 0..card(CUSTOMERS_BUCKETS)-1;
   num node_to_customer {NODES};
   num id init 0;
   for {&amp;lt;i,b&amp;gt; in CUSTOMERS_BUCKETS} do;
      node_id[i,b] = id;
      node_to_customer[id] = i;
      id = id + 1;
   end;
   set &amp;lt;num,num&amp;gt; ARCS init {};
   num weight {ARCS};
   for {&amp;lt;i,j&amp;gt; in CUSTOMER_PAIRS} do;
      for {b in 1..&amp;amp;num_buckets} do;
         ARCS = ARCS union {&amp;lt;node_id[i,b],node_id[j,b+1]&amp;gt;};
         weight[node_id[i,b],node_id[j,b+1]] = error[i,j];
      end;
   end;

   set &amp;lt;num,num,num,num,num&amp;gt; PATHS; /* source, sink, order, from, to */
   set SOURCES = {node_id[1,1]};
   set SINKS   = {node_id[dummy_customer,&amp;amp;num_buckets+1]};

   solve with network /
      direction = directed
      links     = (weight=weight)
      shortpath = (source=SOURCES sink=SINKS)
      out       = (sppaths=PATHS)
   ;
   put _NETWORK_OBJECTIVE_=;
   put PATHS;

   /* highest pd value in each bucket */
   num cutoff    {1..&amp;amp;num_buckets};
   num avg_pd_b  {1..&amp;amp;num_buckets};
   num avg_def_b {1..&amp;amp;num_buckets};
   num error_b   {1..&amp;amp;num_buckets};
   num customer_from, customer_to;
   for {&amp;lt;source, sink, order, from, to&amp;gt; in PATHS} do;
      customer_from = node_to_customer[from];
      customer_to   = node_to_customer[to];
      cutoff[order] = pd[customer_to-1];
      avg_pd_b[order]  = avg_pd[customer_from,customer_to];
      avg_def_b[order] = avg_def[customer_from,customer_to];
      error_b[order]   = error[customer_from,customer_to];
   end;
   print cutoff avg_pd_b avg_def_b error_b;

   /* customers in each bucket */
   set &amp;lt;str&amp;gt; CUSTOMERS_b {1..&amp;amp;num_buckets};
   for {&amp;lt;source, sink, order, from, to&amp;gt; in PATHS}
      CUSTOMERS_b[order] = setof {k in node_to_customer[from]..node_to_customer[to]-1} customer_id[k];
   for {b in 1..&amp;amp;num_buckets} put CUSTOMERS_b[b]=;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="table" rules="all" frame="box" cellspacing="0" cellpadding="5" summary="Procedure Optmodel: PrintTable"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;[1]&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;cutoff&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;avg_pd_b&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;avg_def_b&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;error_b&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;0.00008&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00008&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00008&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;0.00020&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00020&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="r data"&gt;0.00240&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00240&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00240&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="r data"&gt;0.00890&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00890&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.00890&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="r data"&gt;0.28200&lt;/TD&gt;
&lt;TD class="r data"&gt;0.09530&lt;/TD&gt;
&lt;TD class="r data"&gt;0.66667&lt;/TD&gt;
&lt;TD class="r data"&gt;0.57137&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 15 Aug 2016 01:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291602#M1420</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-08-15T01:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291603#M1421</link>
      <description>&lt;P&gt;Thanks for directing me to your&amp;nbsp;presentation on Bucket Optimization.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 17:52:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291603#M1421</guid>
      <dc:creator>sai_ch</dc:creator>
      <dc:date>2016-08-14T17:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291644#M1422</link>
      <description>&lt;PRE&gt;
Ha. I change OBJ value and got this :

data have;
call streaminit(1234);
 do customer=1 to 100;
  pd=rand('uniform');
  def=rand('bern',0.5);
  output;
 end;
 format pd percent8.2;
run;
proc sort data=have;by pd;run;

proc iml;
use have;
read all var {pd def} into have ;
close ;

start function(x) global(have,nrow,group,v);
 xx=t(x);
 if countunique(xx) ^= group then xx=t(sample(v,nrow));
 call sort(xx,1);
 start_end=t(loc(t(xx)^={.}||remove(xx,nrow))) ||
           t(loc(t(xx)^=remove(xx,1)||{.}));
 n=nrow(start_end);
 temp=j(n,2,.);
 do i=1 to n;
  idx=start_end[i,1]:start_end[i,2];
  temp[i,1]=mean(have[idx,1]);
  temp[i,2]=mean(have[idx,2]);
 end;
 obj=sum(abs(temp[,1]-temp[,2]));
return (obj);
finish;

nrow=nrow(have);
group=5;  /* &amp;lt;--Change it(divide into 5 groups)*/

v=1:group;
encoding=j(2,nrow,1);
encoding[2,]=group;    

id=gasetup(2,nrow,123456789);
call gasetobj(id,0,"function");
call gasetsel(id,100,1,1);
call gainit(id,10000,encoding);


niter = 1000;
do i = 1 to niter;
 call garegen(id);
 call gagetval(value, id);
end;
call gagetmem(mem, value, id, 1);

groups=t(mem);
call sort(groups,1);
create groups var {groups};
append;
close;
print value[l = "Min Value:"] ;
call gaend(id);
quit;
 

data temp;
 merge groups have;
run;
proc summary data=temp;
 by groups;
 var pd def;
 output out=want(drop=_:) max(pd)=cut_off_value mean=avg_pd avg_def;
run;
proc print noobs;run;




OUTPUT:

Min Value:
0.7636106
GROUPS	cut_off_value	avg_pd	avg_def
1	25.07%	13.59%	0.58065
2	48.27%	36.98%	0.35000
3	49.28%	48.96%	0.50000
4	52.11%	50.83%	0.50000
5	99.59%	76.93%	0.48889
&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Aug 2016 04:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291644#M1422</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-15T04:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291674#M1423</link>
      <description>&lt;P&gt;Thank you K_Sharp and Rob for providing the solution to the problem. Since this is my first attempt at optimization, I am still trying to fully comprehend the solutions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/61855"&gt;@rob&lt;/a&gt;: Out of curiosity, I ran the code on my actual dataset and got out of memory error. The dataset has ~200k observations. Would you expect to see an out of memory error with those many observations.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 13:14:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291674#M1423</guid>
      <dc:creator>sai_ch</dc:creator>
      <dc:date>2016-08-15T13:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291677#M1424</link>
      <description>&lt;P&gt;For &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;'s random data, the (exact) shortest path approach instantly yields an optimal objective value of 0.46356:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="table" rules="all" frame="box" cellspacing="0" cellpadding="5" summary="Procedure Optmodel: PrintTable"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;[1]&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;cutoff&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;avg_pd_b&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;avg_def_b&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;error_b&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;0.71595&lt;/TD&gt;
&lt;TD class="r data"&gt;0.34215&lt;/TD&gt;
&lt;TD class="r data"&gt;0.44595&lt;/TD&gt;
&lt;TD class="r data"&gt;0.1037958&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;0.77749&lt;/TD&gt;
&lt;TD class="r data"&gt;0.75554&lt;/TD&gt;
&lt;TD class="r data"&gt;0.75000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.0055448&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="r data"&gt;0.98974&lt;/TD&gt;
&lt;TD class="r data"&gt;0.89445&lt;/TD&gt;
&lt;TD class="r data"&gt;0.55000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.3444495&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="r data"&gt;0.99431&lt;/TD&gt;
&lt;TD class="r data"&gt;0.99431&lt;/TD&gt;
&lt;TD class="r data"&gt;1.00000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.0056878&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="r data"&gt;0.99592&lt;/TD&gt;
&lt;TD class="r data"&gt;0.99592&lt;/TD&gt;
&lt;TD class="r data"&gt;1.00000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.0040805&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 15 Aug 2016 13:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291677#M1424</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-08-15T13:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291684#M1425</link>
      <description>&lt;P&gt;Yes, 200k observations would&amp;nbsp;yield about 120 billion arcs, so I am not surprised you ran out of memory.&amp;nbsp; But there are ways to reduce the size of the network.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are there limits (lower and/or upper) on the number of customers&amp;nbsp;in each bucket?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might consider pre-binning the customers with the same def value and whose pd values are very close to each other.&amp;nbsp; That is, replace a set of similar customers with a single observation.&amp;nbsp; To correctly compute the averages, you would need to include a new column that indicates the number of customers associated with each observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you able to share the 200k data set?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 13:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291684#M1425</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-08-15T13:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291717#M1426</link>
      <description>&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Infact limits should be imposed on the number of customers in each bucket, lower bound is 1% and the upper bound is 25%. I am working on reducing the size of the dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 16:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291717#M1426</guid>
      <dc:creator>sai_ch</dc:creator>
      <dc:date>2016-08-15T16:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291877#M1427</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&amp;nbsp;By spending a considerable part of yesterday, I think, I understand what the code is doing. Thank you for initiating me into the world of optimization, it is fascinating. One thought, is it possible to tweak the objective function a little bit. Instead of minmizing the difference between the average PD and average Def for a bucket, is it possible to first minimize the distance between each customer and the average Def for a bucket and then to minimize the sum of errors for all the buckets. Essentially, it becomes a double minimization problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1636"&gt;@RobPratt﻿&lt;/a&gt;&amp;nbsp;I was able to reduce the dataset from ~200k to ~16k and will try to implement the Network solution. Thanks for the suggestion.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 12:52:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291877#M1427</guid>
      <dc:creator>sai_ch</dc:creator>
      <dc:date>2016-08-16T12:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291930#M1428</link>
      <description>Can you please supply the 16k observation data set?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Aug 2016 15:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/291930#M1428</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-08-16T15:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/292019#M1429</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1636"&gt;@RobPratt﻿&lt;/a&gt;&amp;nbsp;If it was upto me, I would have happily supplied the data. Since this data contains sensitive information,&amp;nbsp;its difficult for me to share&amp;nbsp;it.&amp;nbsp;Sorry about that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&amp;nbsp;I was able to modify the objective function to&amp;nbsp;first minimize the error for&amp;nbsp;each observation in the bucket and then for all the buckets together.&amp;nbsp;Is it possible to appy&amp;nbsp;couple&amp;nbsp;of constraints to the optimization. No&amp;nbsp;bucket should have more than&amp;nbsp;25% of&amp;nbsp;observations or less than 1%. Have been trying to use the repair strategy but with no success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 22:14:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/292019#M1429</guid>
      <dc:creator>sai_ch</dc:creator>
      <dc:date>2016-08-16T22:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/292043#M1430</link>
      <description>&lt;P&gt;To impose bounds on the percentage of customers in each bucket, you can introduce macro variables:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let pct_lb = 0.01;
%let pct_ub = 0.25;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;And then in the PROC OPTMODEL code, replace the declaration of CUSTOMER_PAIRS with these three lines:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;num numcust_lb = ceil( &amp;amp;pct_lb*(card(CUSTOMERS)-1));
num numcust_ub = floor(&amp;amp;pct_ub*(card(CUSTOMERS)-1));
set CUSTOMER_PAIRS = {i in CUSTOMERS, j in i+numcust_lb..min(i+numcust_ub,dummy_customer)};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;'s random data, the resulting optimal solution has objective value 1.1086:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Optmodel: PrintTable" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;[1]&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;cutoff&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;avg_pd_b&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;avg_def_b&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;error_b&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;num_cust_b&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;pct_cust_b&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;0.21685&lt;/TD&gt;
&lt;TD class="r data"&gt;0.11294&lt;/TD&gt;
&lt;TD class="r data"&gt;0.68000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.5670646&lt;/TD&gt;
&lt;TD class="r data"&gt;25&lt;/TD&gt;
&lt;TD class="r data"&gt;0.25&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;0.45716&lt;/TD&gt;
&lt;TD class="r data"&gt;0.32589&lt;/TD&gt;
&lt;TD class="r data"&gt;0.29167&lt;/TD&gt;
&lt;TD class="r data"&gt;0.0342267&lt;/TD&gt;
&lt;TD class="r data"&gt;24&lt;/TD&gt;
&lt;TD class="r data"&gt;0.24&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="r data"&gt;0.71595&lt;/TD&gt;
&lt;TD class="r data"&gt;0.58697&lt;/TD&gt;
&lt;TD class="r data"&gt;0.36000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.2269716&lt;/TD&gt;
&lt;TD class="r data"&gt;25&lt;/TD&gt;
&lt;TD class="r data"&gt;0.25&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="r data"&gt;0.99431&lt;/TD&gt;
&lt;TD class="r data"&gt;0.87622&lt;/TD&gt;
&lt;TD class="r data"&gt;0.60000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.2762192&lt;/TD&gt;
&lt;TD class="r data"&gt;25&lt;/TD&gt;
&lt;TD class="r data"&gt;0.25&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="r data"&gt;0.99592&lt;/TD&gt;
&lt;TD class="r data"&gt;0.99592&lt;/TD&gt;
&lt;TD class="r data"&gt;1.00000&lt;/TD&gt;
&lt;TD class="r data"&gt;0.0040805&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;0.01&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 Aug 2016 02:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/292043#M1430</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-08-17T02:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/292052#M1431</link>
      <description>&lt;PRE&gt;
Technically , I can do that for you, if you really need it.
I suggest you run Rob's code firstly. 
If that is still not working, I am going to post IML code for your request.

&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Aug 2016 03:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/292052#M1431</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-17T03:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the optimal cut-off for each bucket</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/292060#M1432</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77035"&gt;@sai_ch﻿&lt;/a&gt;, please check whether changing the error formula as follows matches your new objective for a small instance:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;num error {&amp;lt;i,j&amp;gt; in CUSTOMER_PAIRS} = sum {k in i..j-1} abs(pd[k] - avg_def[i,j]);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then I'll look into making the code more scalable.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 03:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Finding-the-optimal-cut-off-for-each-bucket/m-p/292060#M1432</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-08-17T03:41:45Z</dc:date>
    </item>
  </channel>
</rss>

