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: function evaluator


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: function evaluator
Date   Mon, 9 Apr 2012 22:23:17 +0100

References to m1 should be to `m1'.

Nick

On Mon, Apr 9, 2012 at 8:23 PM, Peter Willemé <pw@plan.be> wrote:
> Dear all,
> I keep getting the error (using Stata/SE 9.0)
>
> (1997 missing values generated)
> nllppl returned 199
> verify that nllppl is a function evaluator program
> r(199);
>
> after running my program:
>
> program nllppl
>  syntax varlist (min = 2, max = 2) [if], at(name) lincoefs(numlist)
>  tempname m1 w1 fi1
>  local aa : word 1 of `lincoefs'
>  local bb : word 2 of `lincoefs'
>  local cc : word 3 of `lincoefs'
>  local tau : word 4 of `lincoefs'
>  scalar `m1' = `at'[1,1]
>  scalar `w1' = `at'[1,2]
>  scalar `fi1' = `at'[1,3]
>  local logp : word 1 of `varlist'
>  local t : word 2 of `varlist'
>  replace `logp' = `aa' - `bb'*(`tau' - `t')^{m1} + `cc'*(`tau' -
> `t')^{m1}*cos({w1}*ln(`tau'-`t')-{fi1}) `if'
> end
>
>
> In short, this program should estimate 3 nonlinear parameters (m, w and fi)
> using -nl- :
>
> nl lppl @ lnp t if tel < 61, parameters(m w fi) initial(m 0.59 w 1.83 fi
> 175.3) lincoefs(`a' `b' `c' `tc')
>
> There are 4 extra constants (a, b, c and tc) passed to the program, but they
> do not have to be estimated. What also puzzles me (and this may have
> something to do with the problem), is the statement "(1997 missing values
> generated)". I want to run the estimation on a subsample of the first 60
> observations using -if-. This looks as if the sample selection does not
> work.
>

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index