Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mathematical Optimization in Stata: LP and MILP

    Here's a 2013 presentation, posted on https://ideas.repec.org, describing two user-developed commands that do mathematical optimization in Stata: lp (linear programming) and milp (mixed integer linear programming)

    They look very handy, but does anyone know where to find them? -findit lp- turns up nothing, and I have so far been unable to reach the author, Choonjoo Lee
    Last edited by paulvonhippel; 31 Aug 2022, 19:26.

  • #2
    Appears to be available here: https://sourceforge.net/p/deas/code/HEAD/tree/trunk/

    Comment


    • #3
      Note that Mata now provides linear programming capabilities.
      Code:
      help mf_linearprogram

      Comment


      • #4
        Thanks, Ali Atia ! What's the most efficient way to install a Stata package from Sourceforge? I could copy all the files to the right folders on my desktop, but is there something like the ssc install command for Sourceforge?

        Comment


        • #5
          (Thanks also to William Lisowski . Mata is great, but it will be easier to teach a Stata command.)

          Comment


          • #6
            Well, I tried the lp command and unfortunately couldn't reproduce the behavior described in @Choonjoo Lee's 2013 presentation to the Stata User's Conference. Let me describe what I did, in case one of you wants to try and correct it.

            I went to Lee's SourceForge page, downloaded the linear programming command lp.ado and put it in the folder where Stata keeps user written commands that start with l (~\ado\plus\l\). I did not find a help file to go with it.

            I went to the website of the 2013 Stata User's Conference and downloaded Lee's PowerPoint presentation.

            I did what Lee described on pages 12-14, but unfortunately got an error instead of a solution. Here's my code:

            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input float(x1 x2 x3 x4) str2 rel float rhs
            40 50 80 170 "="    0
             1  8  2   1 "<="  50
             9  1  5   3 "<="  70
             7  7  4   1 "<=" 117
            end
            lp x1 x2 x3 x4, max
            and here's the error I got:
            struct BoundCond undefined
            (128 lines skipped)

            (error occurred while loading lp.ado)
            Do let us know if you can reproduce the error, or fix it.

            Thanks!
            Paul

            Comment


            • #7
              I can reproduce the error. I lack the experience needed to diagnose the source of the problem, which occurs when Mata is compiling a function definition, not when the lp command is actually running.

              Comment

              Working...
              X