Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: ml porgramming


From   "emre ekinci" <eekinci2610@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: ml porgramming
Date   Fri, 18 May 2007 00:21:56 +0000

sorry,I forgot the code in the previous thread.
here is the code:

capture program drop myll

program define myll
version 9


args todo b lnf

tempvar theta1 c1 c2 c3 c4 c5 c6 c7 c8 c9 a1

tempvar lnfj


mleval `theta1' = `b'

quietly gen double  `c1' = (0.628222008/(`theta1'))
quietly gen double  `c2' = (0.04836303/(`theta1'))
quietly gen double  `c3' = (0.009742825/(`theta1'))
quietly gen double  `c4' = (0.021884783/(`theta1'))
quietly gen double  `c5' = (0.242897686/(`theta1'))
quietly gen double  `c6' = (0.008396969/(`theta1'))
quietly gen double  `c7' = (0.008133649/(`theta1'))
quietly gen double `c8' = (0.016618391/(`theta1'))
quietly gen double  `c9' = (0.015740659/(`theta1'))


constraint define 1 `c1' + `c2' + `c3' = 0.688412327
constraint define 2 `c4' + `c5' + `c6' = 0.270318976
constraint define 3 `c7' + `c8' + `c9' = 0.041268697
constraint define 4 `c1' + `c4' + `c7' = 0.655623075
constraint define 5 `c2' + `c5' + `c8' = 0.311162907
constraint define 6 `c3' + `c6' + `c9' = 0.033214018


quietly gen double `lnfj' = ln(`c1') if ............
quietly replace  `lnfj' = ln(`c2') if ............
quietly replace  `lnfj' = ln(`c3') if .................
quietly replace  `lnfj' = ln(`c4') if .................
quietly replace  `lnfj' = ln(`c5') if ...............
quietly replace  `lnfj' = ln(`c6') if ..............
quietly replace  `lnfj' = ln(`c7') if...............
quietly replace  `lnfj' = ln(`c8') if ..............
quietly replace  `lnfj' = ln(`c9') if ..................

mlsum `lnf' = `lnfj'

end



From: "emre ekinci" <eekinci2610@hotmail.com>
Reply-To: statalist@hsphsun2.harvard.edu
To: statalist@hsphsun2.harvard.edu
Subject: st: ml porgramming
Date: Fri, 18 May 2007 00:19:11 +0000

dear all,

I am trying to estimate a 3x3 transition matrix.each cell contains a known probability as the numerator and a function g of which parameters are to be estimated.the model is identified only if we impose some constraints.to estimate the model,I wrote a code shown below;yet I cannot figure out how I can incorporate these nonlinear constraints.the code below always gives some errors-mainly error code 111.
I really appreciate any advices.
thank you in advance.
best.

_________________________________________________________________
En etkili ve güvenilir PC Korumayi tercih edin, rahat edin! http://www.msn.com.tr/security/

*
* 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/
_________________________________________________________________
Siz siz olun MSN'den hava durumunu ögrenmeden evden çikmayin! http://www.msn.com.tr/havadurumu/

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