Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: maximum likelihood estimation of nonlinear models


From   "Paulo Regis" <[email protected]>
To   <[email protected]>
Subject   st: maximum likelihood estimation of nonlinear models
Date   Sun, 24 Jul 2005 19:22:01 +0100

hi all,

I am working with nonlienar least squares (nl) and maximum likelihood (ml) estimators since I have a nonlinear specification. My problem is I cannot find the appropiate notation for my log likelihood function. My dependent variable (y) has a normal distribution. the model is:

y=x1^b1*x2^b2*x3^b3+e


I checked "Maximum Likelihood Estimation with Stata" (gould and Sribney). In page 45, they present the programme to estimate:

y=b0+b1*x1+b2*x2+b3*x3^b4

which is:

        program define linreg
        version 8.0
        args lnf theta1 theta2 theta3 theta4
        quietly replace `lnf'= ln(normd(($ML_y1-`theta1'-
                        `theta2'*x3^`theta3')/`theta4'))-ln(`theta4')
        end 
        ml model lf linreg (y = x1 x2) /beta3 /beta4 /sigma
        ml maximize

So, i tried something similar 

        program define linreg
        version 8.0
        args lnf theta1 theta2 theta3 theta4
        quietly replace `lnf'= ln(normd(($ML_y1-x1^`theta1'
                        *x2^`theta2'*x3^`theta3')/`theta4'))-ln(`theta4')
        end 
        ml model lf linreg (y=) /beta1 /beta2 /beta3 /sigma
        ml maximize

but it did not work. I am not sure if the problem is my notation for the log likelihood function in the programme in lines 4-5 or the "ml model" statement in line 7.
I would appretiate any suggestion.

Cheers - Paulo

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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