[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Non-Linear Least Squares Programming Question

From   "Randy Akee " <>
To   <>
Subject   st: Non-Linear Least Squares Programming Question
Date   Wed, 15 Aug 2007 15:44:49 +0200


I have a program that I want to use with the NL (non-linear least
squares) command in Stata.  I just have a simple question with regard to
Stata v.9, for my objective function that gets "replaced" in the NL
program, is it possible to have the Left Hand side and the ride hand
side both be matrices?  Typically, I have seen examples (in the stata
manual and other people's do files), where the right hand side is simply
a single equation.

For instance:
capture program drop nltest
program define nltest    
        version 9.0
if "`1'"==  { global S_1 b1 b2 b3
        replace `1'=$b1*X+exp($b2*$b3)

nl test data1 X etc. . .

I want to know if Stata v.9 can handle a matrix on both the right hand
side and left hand side (can data1 and X be matrices?) in the line above
that begins with "replace".  I have several equations that I would like
to fit with the same parameters.

I know Stata v.10 has the NLSUR command, I just want to know if I should
wait for this version.


Randall K. Q. Akee, Ph.D.

Research Associate

IZA - Forschungsinstitut zur Zukunft der Arbeit GmbH
IZA - Institute for the Study of Labor
P.O. Box 7240, 53072 Bonn, Germany
Schaumburg-Lippe-Str. 5-9, 53113 Bonn, Germany
Phone: +49 (228) 3894-306; Fax: +49 (228) 3894-510
Registered Office Bonn, District Court of Bonn, HRB 7745
Represented by: Prof. Dr. Klaus F. Zimmermann (Director)

*   For searches and help try:

© Copyright 1996–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index