Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Re: Maximizing under constraint with Mata?


From   Ozgur Ererdem <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Re: Maximizing under constraint with Mata?
Date   Tue, 18 Sep 2012 10:49:34 +0000

Thank you very much for your answer. 

Best, 

Ozgur 



-----Message d'origine-----
De : [email protected] [mailto:[email protected]] De la part de Gordon Hughes
Envoyé : mardi 18 septembre 2012 11:51
À : [email protected]
Objet : st: Re: Maximizing under constraint with Mata?

Since no-one else has replied, the simple answer is that optimize() in Mata is not designed  for constrained optimization (unless you can solve out the constraint).  moptimize() permits linear constraints but that will not cover your case.  Basically, moptimize() and -ml- in Stata proceed by applying a linear transformation of the variables to a smaller set of transformed variables for the optimization, so the methods will not work in the general case of nonlinear constraints.

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
[email protected]

===================

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/



*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index