Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: maximum likelihood estimation similar to Poi 2002
From
Alex Olssen <[email protected]>
To
[email protected]
Subject
Re: st: maximum likelihood estimation similar to Poi 2002
Date
Tue, 29 Mar 2011 09:46:58 +1300
Thanks a lot for pointing out e(ll), that should help a lot.
I just remembered that I had one other problem with -nlsur-
It has to do with the number of parameters that I can estimate. I
have 35 years of annual observations on 4 shares. I want to use 12
regressors in each of 3 equations - one dropped for estimation.
-nlsur- doesn't like this. But to my mind this should be possible.
Dropping one equation for estimation I no longer have any cross
equation restrictions and I estimate as if by OLS equation by
equation. Clearly with 35 observations I can estimate a simple model
with 12 regressors by OLS. Alternatively think of the simple
multivariate case.
Further more in R I can estimate a model with 3 equations with 12
regressors each using 35 years of annual observations on 4 shares.
To illustrate this problem consider the following code
sysuse auto, clear
keep in 1/5
nlsur (weight = {a0} + {a1}*price + {a2}*mpg) (length = {b0} +
{b1}*price + {b2}*mpg)
nlsur (weight = {a0} + {a1}*price) (length = {b0} + {b1}*price)
Thanks,
Alex
On 29 March 2011 01:00, Brian P. Poi <[email protected]> wrote:
>
> On 3/27/2011 10:51 PM, Alex Olssen wrote:
>>
>> Dear Statalist,
>>
>> I am trying to manually estimate a system similar to the QUAIDS system
>> estimated in Poi's article in The Stata Journal, 2002, 2 (4).
>>
>> A crucial difference is that I do not what to impose symmetry on my
>> coefficients like Poi did.
>>
>> However my code doesn't seem to quite work. I have fixed a couple of
>> problems but now when I try the command
>>
>> ml search
>>
>> I get the error
>>
>> "b not found"
>>
>> I suspected I had not put `' around a local somewhere but have checked
>> several times for this.
>>
>
> The easiest way to find problems like this is to turn on -ml trace- before
> calling -ml maximize-:
>
> . ml model ...
> . ml trace on
> . ml maximize
>
> -ml trace- is like -set trace-, except it only shows a trace of your
> likelihood evaluator and not everything that -ml- does behind the scenes.
>
>> I was wondering if anybody would be interested enough to quickly look
>> through my code - altogether it is less than 80 lines long and this
>> includes spacing and comments for readability.
>> It makes a call to the program vec_sum.ado which was written by Poi
>> and can be accessed through the command
>>
>> net sj 2-4
>> net install st0029
>>
>> Finally, I am aware that in The Stata Journal, 2008, 8 (4), that Poi
>> provided another way to estimate QUAIDS using nlsur.
>>
>> However I am particularly interested in the log-likelihood value
>> associated with my estimation and do not know of away to recover it
>> following nlsur.
>>
>
> -nlsur- with the "ifgnls" option stores the log-likelihood in e(ll). Just
> type in
>
> . display e(ll)
>
> after -nlsur- to see it. If the only twist on your model is that you don't
> impose symmetry, -nlsur- can handle it. The -ml- version is of course fine,
> it's just much slower for this type of problem.
>
> -- Brian Poi
> -- [email protected]
>
> *
> * 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/
>
*
* 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/