Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Constant parameters taken as constant in non-linear estimation


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Constant parameters taken as constant in non-linear estimation
Date   Wed, 24 Apr 2013 10:16:02 +0100

You are fitting a three-parameter function to bivariate data. This
should mean that

1. You can plot any fitted curve on top of data for your two variables
-vdmean- and -vlagmean-.

2. You can guess at possible values of at least some of your
parameters by trying out values and seeing which are plausible.

-twoway function- is very helpful here.

In my experience -nl- often needs plausible initial values for
parameters  to converge on credible final estimates for parameters.
Without that the results can be garbage even if there is, on the face
of it, a good fit that -nl- should find easily.

Checking your data is also a good idea. Here it looks very puzzling
that what looks like a low sum of squares is reached immediately,
although there is no signal on what the data level is. Look carefully
at -summarize vdmean vlagmean, detail- and a -scatter- plot of the raw
data.

Whether you should use ML instead should depend on what you think is a
reasonable data generating process, and specifically whether a fiction
of Gaussian errors matches what you know about the science here (or
the economics, etc.).
Nick
njcoxstata@gmail.com


On 24 April 2013 09:59, Miguel Angel Duran <maduran@uma.es> wrote:
> As a result of running the following non-linear model:
>
> nl (vdmean=({b1}+{b2}*vlagmean^{b3})*(1 - vlagmean))
>
> I get the following results:
>
> Iteration 0:  residual SS =  .0050223
> Iteration 1:  residual SS =  .0050223
>
>       Source |       SS       df       MS
> -------------+------------------------------         Number of obs =
> 66
>        Model | -.000702463     0           .         R-squared     =
> -0.1626
>     Residual |  .005022252    65  .000077265         Adj R-squared =
> -0.1626
> -------------+------------------------------         Root MSE      =
> .0087901
>        Total |  .004319789    65  .000066458         Res. dev.     =
> -438.6132
>
> ----------------------------------------------------------------------------
> --
>       vdmean |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
> Interval]
> -------------+--------------------------------------------------------------
> --
>          /b1 |   .0223499          .        .       .            .
> .
>          /b2 |   2.14e-17   .0041096     0.00   1.000    -.0082075
> .0082075
>          /b3 |          0          .        .       .            .
> .
> ----------------------------------------------------------------------------
> --
>   Parameter b3 taken as constant term in model & ANOVA table
>
> I have seen in a previous message to the Statalist that this results from
> the fact that Stata looks for a constant term. But does anyone know whether
> there is a way to avoid it? Do you recommend me to estimate the models
> through maximum likelihood instead of non-linear LS? By the way, if I
> estimate the model without {b1} everything works, but I would like to
> estimate it with and without {b1} (because the interpretation is different).
>
> Thanks in advance.
>
> Miguel.
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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