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

From |
"Brian P. Poi" <bpoi@stata.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Alternative uses of -nl |

Date |
Tue, 18 Nov 2008 10:42:41 -0600 (CST) |

On Tue, 18 Nov 2008, Paulo Regis wrote:

Dear all, Departing from the following data v1 v2 v3 z 0.0375815 0.0480932 -1 -0.3227311 -0.0192965 0.0261546 -0.1428161 -0.0480932 -0.097088 0.0096482 0 0.0187907 I am using NLS to estimate the following function z = v1*rho+v2*(rho^2)+v3*(sigma^2) where you have two parameters (rho and sigma^2). The problem is I tried two different ways to estimate the parameters that lead me to different values but this shouldnt be the case. Originally, I was using the following programme: program define nlequ version 9 if "`1'"== "?" { global S_1 " rho sigma2 " global rho=1 global sigma2=1 exit } replace `1'=v1*$rho +v2*$rho^2 +v3*$sigma2 end and typing in the command line something like: nl equ z, init(rho=0.7, sigma2=1)

...

Likewise, we should be able to get to the same result if we type in the command line nl (z1 = v1*{rho=1}+v2*{rho}^2+v3*{sigma2=1}) , init(rho -.1857942 sigma2 .3149169)

1- The reason i ask about nl is because I had some problems introducing a nl programme in an ado file. is it illegal to use an nl programme? The structure of my ado file is as follows: program define estim1

2- Is illegal to name a programme if the name start with numbers? (i.e.: a programme named 2sls)

Program names must start with a letter. -- Brian Poi -- bpoi@stata.com * * 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/

**Follow-Ups**:**Re: st: Alternative uses of -nl***From:*"Paulo Regis" <pauloregis.ar@googlemail.com>

**References**:**st: Alternative uses of -nl***From:*"Paulo Regis" <pauloregis.ar@googlemail.com>

- Prev by Date:
**st: GEE and likelihood ratio test** - Next by Date:
**st: re: Writing graphs to the log file** - Previous by thread:
**st: RE: Alternative uses of -nl** - Next by thread:
**Re: st: Alternative uses of -nl** - Index(es):

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