Re: st: Re: beginning programming advice

 From "Thomas Jacobs" To statalist@hsphsun2.harvard.edu Subject Re: st: Re: beginning programming advice Date Tue, 16 Oct 2007 09:11:17 -0500

```Dear Kit,

Thanks, that makes sense (I finally get it).  I already coded the
newton-raphson procedure in Mata and will look forward to testing the
optimize as you have described it once I have the whole procedure
working.  I am still trying to get the results back to Stata - more on
this in an upcoming post.

Sincerely,

Tom

On 10/16/07, Kit Baum <baum@bc.edu> wrote:
> If you can write down the maximand (or minimand) for your problem,
> optimize() can work with it. It is not clear to me what that might
> be. Note in the documentation that "type v" optimizers allow you to
> work with a vector rather than scalar function. optimize() is general
> enough to solve a multivariate optimization problem. From the online
> help:
>
> "In a type v0 evaluator, you return a column vector v such that colsum
> (v)=f(p)."
>
> If the elements of column vector v are the squared elements of ( (y1
> - f(x1)), (y2 - f(x2)), minimizing the column sum of v is the
> equivalent of solving the two nonlinear equations
>
> y1 = f (x1)
> y2 = f (x2)
>
> where some elements of x are shared in x1, x2.
>
>
> Kit Baum, Boston College Economics and DIW Berlin
> http://ideas.repec.org/e/pba1.html
> An Introduction to Modern Econometrics Using Stata:
> http://www.stata-press.com/books/imeus.html
>
>
> On Oct 16, 2007, at 2:33 AM, statalist-digest wrote:
>
> > Thanks very much for your reply.  I have examined the optimize()
> > function you mention in your first proposed solution.  Can this be
> > called to solve two functions simultaneously?  I follow how one would
> > call it to optimize a single function.  Can you add any details on how
> > it would be used for two functions each defined on similar variables
> > as in my two equations in two unknowns problem?
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

--
Thomas Jacobs
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```