<?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 a value by changing values in equation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674230#M203000</link>
    <description>&lt;P&gt;Well, that was certainly faster than going to the docs, and dismisses my thought the proc optmodel was by default constraining W&amp;gt;=0 - probably a good idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then I don't understand why w1 is not an unbounded estimate.&amp;nbsp; After all your constraint&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=2x&lt;/P&gt;
&lt;P&gt;means x=.5y&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then isn't the initial (unintended) objective function&amp;nbsp;&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;min&amp;nbsp;&amp;nbsp; w1x-y&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; equivalent to minimizing&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;w1*.5y-y&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; which in turn is&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; equivalent to minimizing &lt;EM&gt;&lt;STRONG&gt;(.5*w1-1)*y&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If w is unbounded, then why is the solution w=0?&amp;nbsp; Any negative value of w would produce a smaller objective function. In fact, the more negative w1 is, the more "minimal" the objective.&amp;nbsp; There is something about the syntax of proc optmodel that is not apparent to me in your simplified problem.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Aug 2020 00:55:24 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2020-08-04T00:55:24Z</dc:date>
    <item>
      <title>Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673828#M202778</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please guide me how to proceed with the below issue.&lt;/P&gt;&lt;P&gt;I want to minimize a value by changing coefficients of an equation.&lt;/P&gt;&lt;P&gt;The coefficients of equation are first assigned a random number but should change later after optimization.&lt;/P&gt;&lt;P&gt;Changing these coefficients should result in minimizing -- &lt;STRONG&gt;minimize_error&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I understand the values are already assigned as macro variables--w1-w8 &amp;amp; b1-b3 but I am fine with &lt;STRONG&gt;corresponding&lt;/STRONG&gt; new macro variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using solver in excel is just a few clicks. Want to explore equivalent of it in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro weight(neuron=,hidden_layer=2);

	%let nos_weight=%sysevalf(((&amp;amp;neuron./2)**2)+(&amp;amp;neuron.));
	%put &amp;amp;=nos_weight;

     data rand_data;
           call streaminit(0);
           do i = 1 to &amp;amp;nos_weight.;
                u=rand("Uniform");
                output;
           end;
     run;

     %do i = 1 %to &amp;amp;nos_weight.;
		 %global w&amp;amp;i.;
     %end;

     proc sql noprint;
           select u into :w1-:w&amp;amp;nos_weight.
                from rand_data
     ;quit;

     %do i = 1 %to &amp;amp;nos_weight.;
	 %global w&amp;amp;i.;
           %put w&amp;amp;i.=&amp;amp;&amp;amp;w&amp;amp;i.;
     %end;

     %let bias=%eval(&amp;amp;hidden_layer.+1);

     data rand_data;
           call streaminit(0);
           do i = 1 to &amp;amp;bias.;
                u=rand("Uniform");
                output;
           end;
     run;

     %do i = 1 %to &amp;amp;bias.;
		 %global b&amp;amp;i.;
     %end;


     proc sql noprint;
           select u into :b1-:b&amp;amp;bias.
                from rand_data
     ;quit;
     %do i = 1 %to &amp;amp;bias.;
           %put b&amp;amp;i.=&amp;amp;&amp;amp;b&amp;amp;i.;
     %end;

%mend weight;

%weight(neuron=4,hidden_layer=2);


data equation;
input y m x c;
datalines;
14 9 1 5
851 9 94 5
473 9 52 5
635 9 70 5
518 9 57 5
257 9 28 5
383 9 42 5
428 9 47 5
356 9 39 5
68 9 7 5
257 9 28 5
248 9 27 5
194 9 21 5
86 9 9 5
761 9 84 5
284 9 31 5
653 9 72 5
356 9 39 5
320 9 35 5
;run;

data equation2;
	set equation;
	n1h1=x*&amp;amp;w1.-&amp;amp;b1.;
	n2h1=x*&amp;amp;w2.-&amp;amp;b1.;
	n1h2=(n1h1*&amp;amp;w3.)+(n2h1*&amp;amp;w4.);
	n2h2=(n1h1*&amp;amp;w5.)+(n2h1*&amp;amp;w6.);
	output_network=(n1h2*&amp;amp;w7.)+(n2h2*&amp;amp;w8.);
	sq_diff=(y-output_network)**2;
run;

/*I want to minimize value of minimize_error by changing values w1-w8 and b1-b3*/
proc sql;
	select sum(sq_diff) format=best19.5
			into: &lt;STRONG&gt;minimize_error&lt;/STRONG&gt;
		from equation2
;quit;
%put &amp;amp;=minimize_error;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jul 2020 20:35:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673828#M202778</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2020-07-31T20:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673833#M202783</link>
      <description>&lt;P&gt;SAS has a number of optimization routines. In most cases, you shouldn't have to write your own.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use your favorite internet search engine for "excel solver in SAS", you get a bunch of solutions.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 21:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673833#M202783</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-31T21:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673875#M202800</link>
      <description>&lt;P&gt;An example that actually solves the problem stated would be more useful I guess.&lt;/P&gt;&lt;P&gt;Thank You anyways for the suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 05:04:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673875#M202800</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2020-08-01T05:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673897#M202818</link>
      <description>&lt;P&gt;You could try PROC NLIN&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or If you have SAS/IML&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; wrote many blog about this kind of optimial problem.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 12:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673897#M202818</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-08-01T12:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673943#M202841</link>
      <description>&lt;P&gt;Do you have a license for SAS/OR or SAS/IML? Both offer built-in optimization routines.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 18:44:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/673943#M202841</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-08-01T18:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674186#M202972</link>
      <description>&lt;P&gt;Thank You everyone for chiming in here.&lt;/P&gt;&lt;P&gt;I read a little and came up with below example using OPTMODEL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Why am I getting the value of w1 as 0?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As you see the dataset&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;y=2*x &lt;/EM&gt;&lt;/STRONG&gt;so i am expecting w1 to be close to 2.&lt;/P&gt;&lt;P&gt;What am I missing here?&lt;/P&gt;&lt;P&gt;Please adivse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data equation;
	input y x;
	datalines;
10 5
20 10
30 15
40 20
50 25
60 30
70 35
80 40
;
run;
proc optmodel;
	var w1;
	number x ,y;
	read data equation into x y;
	min sq_diff=w1*x-y;
	con y=2*x;
	solve;
	print w1;
	expand / iis;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Aug 2020 17:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674186#M202972</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2020-08-03T17:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674189#M202973</link>
      <description>&lt;P&gt;You are choosing W to minimizing the expression&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; W*x-y&lt;/P&gt;
&lt;P&gt;where x and y are fixed values, always positive, and with constraint&amp;nbsp; y=2x.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming that proc optmodel is restricting its choices of W as a non-negative number, zero HAS to be the solution.&amp;nbsp; Given that x and y are always positive, and the constraint y=2x, the w=0 will always resolve the expression W*x-y to -y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you are naming your objective&amp;nbsp; sqdiff, so I suspect you actually want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; min sq_diff=(w*x-y)**2 ;&lt;/P&gt;
&lt;P&gt;I did this, and got w=2.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 18:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674189#M202973</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-08-03T18:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674191#M202974</link>
      <description>&lt;P&gt;Thank You&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You said-- "&lt;STRONG&gt;Assuming that proc optmodel is restricting its choices of W as a non-negative number...&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way we can validate this?&lt;/P&gt;&lt;P&gt;And yes squaring the difference did get me value of 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 18:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674191#M202974</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2020-08-03T18:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674194#M202977</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215179"&gt;@david27&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank You&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You said-- "&lt;STRONG&gt;Assuming that proc optmodel is restricting its choices of W as a non-negative number...&lt;/STRONG&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way we can validate this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank You&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes.&amp;nbsp;&amp;nbsp; "We" can look at the proc optmodel documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;editted note:&amp;nbsp; And if W were not restricted to non-negatives, then the more negative W is,the more minimization of&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wx-y.&amp;nbsp; It would be an unbounded solution.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 19:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674194#M202977</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-08-03T19:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674196#M202978</link>
      <description>&lt;P&gt;It goes negative.&lt;/P&gt;&lt;P&gt;I just validated it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data equation;
	input y x;
	datalines;
10 -5
-20 10
-30 15
40 -20
-50 25
-60 30
70 -35
80 40
;
run;
proc optmodel;
	var w1;
	number x ,y;
	read data equation into x y;
	min sq_diff =(w1*x-y)**2;
	con y=abs(2*x);
	solve;
	print w1;
	expand / iis;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Aug 2020 19:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674196#M202978</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2020-08-03T19:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674212#M202991</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;So I have this below example.&lt;/P&gt;&lt;P&gt;In the &lt;STRONG&gt;verification_dsn&lt;/STRONG&gt; I have populated the values for all weights==w1-w8 &amp;amp; b1-b3.&lt;/P&gt;&lt;P&gt;verification_dsn is the dataset i use to just validate the formulas.&lt;/P&gt;&lt;P&gt;I use these weights to populate &lt;STRONG&gt;minimize_function and constraints&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The values match or are very close.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the same formula in the OPTMODEL procedure but then get all weights(w1-w8) as 0.&lt;/P&gt;&lt;P&gt;Is there anything that I am missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the values for w1-w8 and b1-b3 using solver in excel. But not able to get similar values in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&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;data equation;
input y m x c;
datalines;
14 9 1 5
851 9 94 5
473 9 52 5
635 9 70 5
518 9 57 5
257 9 28 5
383 9 42 5
428 9 47 5
356 9 39 5
68 9 7 5
257 9 28 5
248 9 27 5
194 9 21 5
86 9 9 5
761 9 84 5
284 9 31 5
653 9 72 5
356 9 39 5
320 9 35 5
;run;
%let w1=0.094961;
%let w2=0.008734;
%let w3=6.21478;
%let w4=7.002409;
%let w5=0.012339;
%let w6=0.396723;
%let w7=13.94726;
%let w8=1.045836;

%let b1=0;
%let b2=0;
%let b3=0;
data verification_dsn;
	set equation;
w1=0.094961;
w2=0.008734;
w3=6.21478;
w4=7.002409;
w5=0.012339;
w6=0.396723;
w7=13.94726;
w8=1.045836;

b1=0;
b2=0;
b3=0;
	n1h1=x*&amp;amp;w1.-&amp;amp;b1.;
	n2h1=x*&amp;amp;w2.-&amp;amp;b1.;
	n1h2=((x*&amp;amp;w1.-&amp;amp;b1.)*&amp;amp;w3.)+((x*&amp;amp;w2.-&amp;amp;b1.)*&amp;amp;w4.)-&amp;amp;b2.;
	n2h2=(n1h1*&amp;amp;w5.)+(n2h1*&amp;amp;w6.)-&amp;amp;b2.;
	output_network=(n1h2*&amp;amp;w7.)+(n2h2*&amp;amp;w8.)-&amp;amp;b3.;
	sq_diff=(y-output_network)**2;
	minimize_function=(y-(((((x*w1-b1)*w3)+((x*w2-b1)*w4)-b2)*w7)+((((x*w1-b1)*w5)+((x*w2-b1)*w6)-b2)*w8)-b3))**2;
	constraint=abs(((((x*w1-b1)*w3)+((x*w2-b1)*w4)-b2)*w7)+((((x*w1-b1)*w5)+((x*w2-b1)*w6)-b2)*w8)-b3);
run;

proc optmodel;
	var w1 ,w2 ,w3 ,w4 ,w5 ,w6 ,w7 ,w8 ,b1 ,b2 ,b3;
	number x ,y;
	read data equation into x y;
	min sq_diff=(y-(((((x*w1-b1)*w3)+((x*w2-b1)*w4)-b2)*w7)+((((x*w1-b1)*w5)+((x*w2-b1)*w6)-b2)*w8)-b3))**2;
	con y = abs(((((x*w1-b1)*w3)+((x*w2-b1)*w4)-b2)*w7)+((((x*w1-b1)*w5)+((x*w2-b1)*w6)-b2)*w8)-b3);
	solve;
	print w1 w2 w3 w4 w5 w6 w7 w8 b1 b2 b3;
	expand / iis;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Aug 2020 21:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674212#M202991</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2020-08-03T21:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674230#M203000</link>
      <description>&lt;P&gt;Well, that was certainly faster than going to the docs, and dismisses my thought the proc optmodel was by default constraining W&amp;gt;=0 - probably a good idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then I don't understand why w1 is not an unbounded estimate.&amp;nbsp; After all your constraint&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=2x&lt;/P&gt;
&lt;P&gt;means x=.5y&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then isn't the initial (unintended) objective function&amp;nbsp;&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;min&amp;nbsp;&amp;nbsp; w1x-y&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; equivalent to minimizing&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;w1*.5y-y&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; which in turn is&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; equivalent to minimizing &lt;EM&gt;&lt;STRONG&gt;(.5*w1-1)*y&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If w is unbounded, then why is the solution w=0?&amp;nbsp; Any negative value of w would produce a smaller objective function. In fact, the more negative w1 is, the more "minimal" the objective.&amp;nbsp; There is something about the syntax of proc optmodel that is not apparent to me in your simplified problem.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 00:55:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674230#M203000</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-08-04T00:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Minimize a value by changing values in equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674309#M203031</link>
      <description>&lt;P&gt;If you would like to use SAS/OR , better post it at OR forum&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1636"&gt;@RobPratt&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 11:29:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Minimize-a-value-by-changing-values-in-equation/m-p/674309#M203031</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-08-04T11:29:22Z</dc:date>
    </item>
  </channel>
</rss>

