<?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: Proc optmodel solving with likelihood maximum in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391970#M1981</link>
    <description>&lt;P&gt;It looks like you have some data issues (missing values and mixture of Z and VAR column names), but I think I see what you are trying to do. &amp;nbsp;You wanted 188 constraints, but you declared 188*8836*188*188 = 58.7 billion constraints instead. &amp;nbsp;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Con Bornes {i in C1}: sum {d in zone1} X[i, d] = sum {o in cont1} Y[i, o];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A&amp;nbsp;good way to make sure your model is correct is to use the &lt;A href="http://go.documentation.sas.com/?docsetId=ormpug&amp;amp;docsetVersion=14.2&amp;amp;docsetTarget=ormpug_optmodel_syntax11.htm&amp;amp;locale=en#ormpug.optmodel.npxexpandstmt" target="_self"&gt;EXPAND&lt;/A&gt; statement on a smaller instance.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Aug 2017 18:16:38 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2017-08-30T18:16:38Z</dc:date>
    <item>
      <title>Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391844#M1973</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Hi everyone, &lt;BR /&gt;&lt;BR /&gt;I am writing to you in hoping that someone would be able to help me. I am new in proc optmodel so i had really take time to learn the basic in &lt;BR /&gt;proc optmodel language before starting to solve my problem. &lt;BR /&gt;So, I am trying to solve a quadratic problem ( in 9.4 sas version ) with a minimizing function that is based of a&lt;BR /&gt;likelihood maximum formulation. In that way I have two tables :&lt;STRONG&gt;tableau 1&lt;/STRONG&gt; that contains my real X (&lt;EM&gt;188 rows and 8836 columns&lt;/EM&gt;) and  &lt;STRONG&gt;Marges&lt;/STRONG&gt; that contains my real Y (&lt;EM&gt;188 rows, 188 columns&lt;/EM&gt;).&lt;BR /&gt;            &lt;BR /&gt;What I want is that estimates X and Y that respond to this function like for each row (i) of the two tables (that means for X and Y ) we have &lt;BR /&gt;min f = &lt;STRONG&gt;&lt;EM&gt;[&lt;/EM&gt;(&lt;/STRONG&gt;X(&lt;EM&gt;to estimate&lt;/EM&gt;) - X( real &lt;EM&gt;in "tableau")&lt;STRONG&gt;)&lt;/STRONG&gt;**2&lt;/EM&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;&lt;EM&gt;X(real)&lt;/EM&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;EM&gt; + &lt;STRONG&gt;[(&lt;/STRONG&gt;Y(to estimate) - Y(real in "Marges")&lt;STRONG&gt;)&lt;/STRONG&gt;**2 &lt;STRONG&gt;/&lt;/STRONG&gt; Y(real)&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;BR /&gt;following to the constraint that the sum of X - Y = 0 ( for each rows of the two tables ). &lt;BR /&gt;&lt;BR /&gt;In my code the programm runs until the reading data step, there is no syntax error and it gives me the right format of my data but when i run the code with resolving part &lt;BR /&gt;I have the note : "out of memory" and it stopped. I've already changed my size of sas with (memsize 0) but when i re-run it is always in "out of memory". &lt;BR /&gt;Actually, my problem is that i really don't know if the problem is really the memory or if it's my syntax code wich that is not good.&lt;BR /&gt;So if you see the code below : do you think that the problem is that my code is not correct ? &lt;BR /&gt;Thanks for advance for the answer and hope that the question is clear (forgive about my english) &lt;BR /&gt;&lt;/EM&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;proc optmodel; 
		
	/* I Tableau des M reels 										 */ 
	/*************************************************************/
			/* declaration de paramètre */ 
			set zone1 = 1..8836; 
			set &amp;lt;num&amp;gt; C1; 
			number trafic1{C1, zone1};

			/* Lecture de la table */ 
			read data Tableau1 into 
				C1 = [_N_] 
				{r in zone1} &amp;lt; trafic1[_N_, r]=col("Z"||r) &amp;gt;;
			print trafic1; 

	/* II Tableau des contraintes réels ==&amp;gt; Y réels						*/
	/*********************************************************************/
			set Cont1 = 1..188; 
			set &amp;lt;num&amp;gt; N1; 
			number Marge1{N1, Cont1};

			/* Lecture de la table */
			read data Marges into 
				N1 = [_N_] 
				{m in Cont1} &amp;lt; Marge1[_N_, m]=col("O"||m) &amp;gt;;
			print Marge1; 

	/* V Resolution  												*/ 
	/*********************************************************************/
		/* V-1) Déclaration de variables */ 
		var  x{i in C1, d in zone1} &amp;gt;= 0 ;
		var  y{j in N1, o in cont1} &amp;gt;= 0 ;
	

		/* V-2) La fonction objective : minimisation de la variance */ 
		minimize f = sum{i in C1, d in zone1} ((X[i, d] - trafic1[i, d])**2/trafic1[i, d]) +
					 sum{j in N1 , o in cont1} (( Y[j, o]- Marge1[j, o])**2/Marge1[j, o]);


		/* V-3) subject to the following constraints */
		Con Bornes {i in C1, d in zone1, j in N1, o in cont1} :(X[i, d] - Y[j, o]) = 0;

	solve;

	print {i in C1, d in zone1: X[i, d] &amp;gt; 0} X ;
	
quit;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 14:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391844#M1973</guid>
      <dc:creator>Vane07</dc:creator>
      <dc:date>2017-08-30T14:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391889#M1974</link>
      <description>&lt;P&gt;Can you please share the data?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 15:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391889#M1974</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-08-30T15:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391906#M1975</link>
      <description>&lt;P&gt;Thanks for replying . I have attached two files ("tableau" ( "marges").&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 15:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391906#M1975</guid>
      <dc:creator>Vane07</dc:creator>
      <dc:date>2017-08-30T15:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391909#M1976</link>
      <description>&lt;P&gt;I see only one attachment (marges.csv).&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 15:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391909#M1976</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-08-30T15:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391912#M1977</link>
      <description>&lt;P&gt;I have attached two reduced files because the orginals are too bigs. So instead of having (188 row, 8836 colums for tableau1&amp;nbsp;) and (188 rows, 188 for marges), i send you (12 rows, 12 colums for tableau1&amp;nbsp;) and (12 rows, 12 colums for marges).&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 15:48:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391912#M1977</guid>
      <dc:creator>Vane07</dc:creator>
      <dc:date>2017-08-30T15:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391925#M1978</link>
      <description>&lt;P&gt;Here are the dataset compressed. I think it would be more accorded to my code posted before for understanding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 16:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391925#M1978</guid>
      <dc:creator>Vane07</dc:creator>
      <dc:date>2017-08-30T16:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391927#M1979</link>
      <description>&lt;P&gt;This smaller instance solves instantly but yields a constant optimal solution with all variables equal to 0.010473. &amp;nbsp;I suspect that your Bornes constraint is not really what you want. &amp;nbsp;Your text description mentioned a sum, but that constraint does not contain any sum.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 16:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391927#M1979</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-08-30T16:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391938#M1980</link>
      <description>&lt;P&gt;First&amp;nbsp;I think i gave you a wrong reduced dataset for tableau1_set because &amp;nbsp;for C1 = 1..12, I&amp;nbsp;should give you a dataset with 12 rows and 144 columns (+C1). &amp;nbsp;I don't know if there is a consequences for the resolution&amp;nbsp;. Anyway I compressed the originals dataset ( that is attached with this mail ), i think it is better because of my error is about the note : "out of memory" that we would not see with the smaller contains.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;About the constraint, in the orginal dataset, what i want for contraints is&amp;nbsp;that&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if&lt;STRONG&gt; tableau1&lt;/STRONG&gt; have 188 rows and 8836 columns&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if &lt;STRONG&gt;marges&lt;/STRONG&gt; have 188 rows and 188 columns&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Constraint 1&amp;nbsp;: &amp;nbsp;(X1+....+X8836) - ( Y1+....+Y188) &amp;nbsp; =0; (row 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt; C&lt;/SPAN&gt;&lt;SPAN&gt;onstraint 2&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;: &amp;nbsp;(X1+....+X8836) - ( Y1+....+Y188) &amp;nbsp; =0; (row1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Constraint 188 :&amp;nbsp;&lt;SPAN&gt;(X1+....+X8836) - ( Y1+....+Y188) &amp;nbsp; =0; (row188)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So i write the code like that&amp;nbsp;&lt;STRONG&gt;Bornes {i in C1, d in zone1, j in N1, o in cont1} :(X[i, d] - Y[j, o]) = 0; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;because i&amp;nbsp;just want him to make sum operation for each row from row 1 to row 188. I don't know what exactly he does with this code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 17:05:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391938#M1980</guid>
      <dc:creator>Vane07</dc:creator>
      <dc:date>2017-08-30T17:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391970#M1981</link>
      <description>&lt;P&gt;It looks like you have some data issues (missing values and mixture of Z and VAR column names), but I think I see what you are trying to do. &amp;nbsp;You wanted 188 constraints, but you declared 188*8836*188*188 = 58.7 billion constraints instead. &amp;nbsp;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Con Bornes {i in C1}: sum {d in zone1} X[i, d] = sum {o in cont1} Y[i, o];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A&amp;nbsp;good way to make sure your model is correct is to use the &lt;A href="http://go.documentation.sas.com/?docsetId=ormpug&amp;amp;docsetVersion=14.2&amp;amp;docsetTarget=ormpug_optmodel_syntax11.htm&amp;amp;locale=en#ormpug.optmodel.npxexpandstmt" target="_self"&gt;EXPAND&lt;/A&gt; statement on a smaller instance.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 18:16:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/391970#M1981</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-08-30T18:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc optmodel solving with likelihood maximum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/392133#M1982</link>
      <description>&lt;P&gt;Thank you for your answer !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You understood very well what i wanted to do with the constraint. It was exactly what I wanted, i didn't know about the expand statement and I see it is &amp;nbsp;a very good way to look after the code. So this morning i tried with your correction of the syntax (with expand) and I see that it write exactly the model and it solves very quickly so thank you very much beacause it helped me very well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I see that the solutions is not very good but I think it is more in my model than in the code sas. Also , I see a note that sas changed the solver to NLP instead of QP so I'm gonna take a look at my model if it very optimal.&lt;/P&gt;&lt;P&gt;I also want to tell you that with the originals dataset, when I run the program I still needed to change the memsize to 0 then it solves in 19 second ( better with 188 constraint of course &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ) .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again and I'll come back to you this evening if I find that it is my model wich us not goog or the QP solver is not adapted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 10:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-optmodel-solving-with-likelihood-maximum/m-p/392133#M1982</guid>
      <dc:creator>Vane07</dc:creator>
      <dc:date>2017-08-31T10:02:34Z</dc:date>
    </item>
  </channel>
</rss>

