Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Gordon Hughes <G.A.Hughes@ed.ac.uk> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: Re: Maximizing under constraint with Mata? |
Date | Tue, 18 Sep 2012 10:51:25 +0100 |
Depending upon the nature and complexity of your problem, you should consider other packages - there are plenty around - that are designed to handle general non-linear optimisation. There are procedures and/or toolboxes in R, Matlab, Octave, etc which have different advantages and disadvantages.
Gordon Hughes g.a.hughes@ed.ac.uk =================== Dear Stata users,I've been trying to implement an optimization under constraint, using the optimize() command of Mata.
Both the function I'm willing to maximize and the constraint are non-linear.Below please find the code I am using to define the Lagrange function denoted as "Ref". p[K] is the Lagrange multiplier, and the other p[i]s are the unknown parameters I am looking for. I use a "d0" evaluatortype.
Mata have been unable to find a solution, because it "cannot calculate numerical derivatives -- discontinuous region with missing values encountered"
Am I making a mistake in the way I write the problem? Has Mata the capacity to solve these kinds of optimization problems? Thank you very much for your help.
Regards
* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/