<?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: FCMP and OPTMODEL in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84954#M585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct that the NLP solver does not allow integer variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might be interested in the new OPTLSO procedure, available in SAS/OR 12.3:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/orlsoug/66102/HTML/default/viewer.htm#orlsoug_hplso_toc.htm"&gt;http://support.sas.com/documentation/cdl/en/orlsoug/66102/HTML/default/viewer.htm#orlsoug_hplso_toc.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a later release, this local search solver will also be accessible via OPTMODEL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't mind, would you please share the function you're trying to minimize?&amp;nbsp; Do you have any constraints besides integrality of variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Jul 2013 20:09:01 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2013-07-21T20:09:01Z</dc:date>
    <item>
      <title>FCMP and OPTMODEL</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84949#M580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can OPTMODEL be used to minimize a function created with PROC FCMP? The documentation for FCMP says functions can be called by PROC NLP and a number of other procedures, but doesn't mention OPTMODEL. Is this correct? If NLP is the legacy procedure I assumed FCMP would be available to the newer procedure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jul 2013 02:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84949#M580</guid>
      <dc:creator>stoffprof</dc:creator>
      <dc:date>2013-07-20T02:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP and OPTMODEL</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84950#M581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FCMP enablement in PROC OPTMODEL is not documented or supported but has been available as a hidden feature for several releases.&amp;nbsp; Official support for this functionality is on the roadmap for a coming release.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jul 2013 02:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84950#M581</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2013-07-20T02:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP and OPTMODEL</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84951#M582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Can you give some guidance on the syntax? My attempt isn't working (optmodel can't find the function):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc fcmp outlib=sasuser.funcs.tester;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; function rosenbrock(x[2]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f = 2 * (x[2] - x[1]**2)**2 + (1-x[1])**2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(f);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; endsub;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;options cmplib=sasuser.funcs;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc optmodel;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; var x {1..2};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; min rosenbrock;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; solve;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; print x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jul 2013 18:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84951#M582</guid>
      <dc:creator>stoffprof</dc:creator>
      <dc:date>2013-07-21T18:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP and OPTMODEL</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84952#M583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp; min z = rosenbrock(x);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jul 2013 18:20:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84952#M583</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2013-07-21T18:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP and OPTMODEL</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84953#M584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob, especially for the super-fast answer (on a Sunday!). I'm trying to minimize a function I created in FCMP that takes only integer values. As far as I can tell, the problem does not fit into a MILP or LP setup, and NLP doesn't seem to allow integers. Is there a way to solve an arbitrary function that takes integers? I thought about modifying my program so it converts real numbers to integers, but I thought that might pose problems for a solver that looks at derivatives because they'd all be quite flat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jul 2013 19:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84953#M584</guid>
      <dc:creator>stoffprof</dc:creator>
      <dc:date>2013-07-21T19:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP and OPTMODEL</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84954#M585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct that the NLP solver does not allow integer variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might be interested in the new OPTLSO procedure, available in SAS/OR 12.3:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/orlsoug/66102/HTML/default/viewer.htm#orlsoug_hplso_toc.htm"&gt;http://support.sas.com/documentation/cdl/en/orlsoug/66102/HTML/default/viewer.htm#orlsoug_hplso_toc.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a later release, this local search solver will also be accessible via OPTMODEL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't mind, would you please share the function you're trying to minimize?&amp;nbsp; Do you have any constraints besides integrality of variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jul 2013 20:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84954#M585</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2013-07-21T20:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP and OPTMODEL</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84955#M586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob. The only constraints are that the variables are integers bounded by 0 and some integer usually close to 60. (There are about 50-100 such variables.) I don't think there's a straightforward way to share my objective function completely; it's a complicated function of many variables in a dataset. In short, the function is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f(x) = sum over all t of&amp;nbsp; |a(t) - b(t)|&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where a(t) is observable and b(t) = g(x; many parameters), and g() is, as I said, pretty complicated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been minimizing this with a genetic algorithm in IML but am exploring other options with more flexibility. I recently heard about the GA procedure in SAS/OR, and wanted to try that as well. Are you aware of any sample code that shows how to use FCMP with PROC GA? In particular, I'm not clear on whether the functions have to be defined in exactly the same way as they are within GA (the first variable is an array). For example, suppose you wanted to write the function sumsq from &lt;A href="http://support.sas.com/documentation/cdl/en/orlsoug/63974/HTML/default/viewer.htm#orlsoug_ga_sect060.htm"&gt;this page&lt;/A&gt; within FCMP. How would that work, since I'm assuming you can't call ReadMember from FCMP?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 17:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84955#M586</guid>
      <dc:creator>stoffprof</dc:creator>
      <dc:date>2013-07-24T17:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP and OPTMODEL</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84956#M587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not a PROC GA expert, but I believe for the example you referenced you could define a sum-of-squares function in PROC FCMP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options cmplib=sasuser.funcs;&lt;/P&gt;&lt;P&gt;proc fcmp outlib=sasuser.funcs.temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; function mysum(x&lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n = dim(x);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to n;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum + x&lt;I&gt; * x&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(sum);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; endsub;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then call it from within the sumsq function in PROC GA:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* compute the sum of the squares */&lt;/P&gt;&lt;P&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum = 0;*/&lt;/P&gt;&lt;P&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to n;*/&lt;/P&gt;&lt;P&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sq = x&lt;I&gt; * x&lt;I&gt;;*/&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum = sum + sq;*/&lt;/P&gt;&lt;P&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum = mysum(x);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it be possible for you to share your objective function by posting your actual code and data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 20:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/FCMP-and-OPTMODEL/m-p/84956#M587</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2013-07-24T20:29:28Z</dc:date>
    </item>
  </channel>
</rss>

