Statalist


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

Re: st: MLE: Setting Initial Values


From   "Arne Risa Hole" <[email protected]>
To   [email protected]
Subject   Re: st: MLE: Setting Initial Values
Date   Mon, 28 Jan 2008 15:16:37 +0000

No, there are 7 dependent variables (4 in the first equation and 3 in
the second equation) so this is ok - it looks like Sabah is using a
code for estimating double bounded CV models I posted on the list a
couple of months ago
<http://www.mata.co.uk/statalist/archive/2007-12/msg00121.html>.

Try this:

ml model lf double_cv_4 (xb: Y_Y_C N_N Y_N N_Y = rev_incm) (bid:
bid_intl bid_low bid_high = )
matrix b = 0,0,-1
ml init b, copy
ml maximize, search(off)

Arne


On 28/01/2008, Maarten buis <[email protected]> wrote:
> In your -ml model- statement you specify only 4 dependent variables
> (Y_Y_C, N_N, Y_N, and N_Y), while in log likelihood you use 7 ($MLy_1
> till $MLy_7). Surprisingly this does not lead to an error message, but
> to the model not converging. (I have made the same mistake before)
>
> Hope this helps,
> Maarten
>
> --- Sabah Abdullah <[email protected]> wrote:
>
> > Dear Stata Listserve:
> >
> > Presently I am working on MLE and was able to maximize some of my
> > data
> > but one of them refused to maximize the error message was could not
> > find feasible values
> > r(491); (see below for more details) . Hence, I tried to set initial
> > values but all I am receiving are error messages. Please see below
> > for
> > my commands and results.
> > Note I do not have any missing values.  I will be grateful for any
> > suggestions or comments.
> >
> > Regards,
> >
> > Sabah
> > --
> >
> > COMMANDS:
> >  capture program drop double_cv_4
> >  program double_cv_4
> >       version 9.2
> >       args lnf xb bid
> >       qui replace `lnf' = ln(invlogit($ML_y6*`bid'+`xb')) if $ML_y1 == 1
> >       qui replace `lnf' = ln(invlogit(-($ML_y7*`bid'+`xb'))) if $ML_y2 ==
> > 1
> >       qui replace `lnf' = ln(invlogit(-($ML_y6*`bid'+`xb')) - ///
> >       invlogit(-($ML_y5*`bid'+`xb'))) if $ML_y3 == 1
> >       qui replace `lnf' = ln(invlogit(-($ML_y5*`bid'+`xb')) - ///
> >       invlogit(-($ML_y7*`bid'+`xb'))) if $ML_y4 == 1
> >  end
> >
> >
> > ml model lf double_cv_4 (xb: Y_Y_C N_N Y_N N_Y = rev_incm) (bid:
> > bid_intl bid_low bid_high = )
> > ml maximize, difficult
> > ml graph
> >
> >
> > OUTPUT:
> > initial:       log likelihood =     -<inf>  (could not be evaluated)
> >
> > could not find feasible values
> > r(491);
> >
> >
> >
> > What I decided to do following recommendation in MLE book by Gould et
> > al, 3rd edition---loading initial values from vectors:
> >
> > COMMANDS
> > . regress Y_Y_C rev_incm sexresp_male
> >
> >       Source |       SS       df       MS              Number of obs
> > =     200
> > -------------+------------------------------           F(  2,   197)
> > =    2.52
> >        Model |  .527840655     2  .263920328           Prob > F
> > =  0.0827
> >     Residual |  20.5921593   197  .104528728           R-squared
> > =  0.0250
> > -------------+------------------------------           Adj R-squared
> > =  0.0151
> >        Total |       21.12   199  .106130653           Root MSE
> > =  .32331
> >
> >
> ------------------------------------------------------------------------------
> >        Y_Y_C |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
> > Interval]
> >
> -------------+----------------------------------------------------------------
> >     rev_incm |   2.40e-06   2.92e-06     0.82   0.411    -3.35e-06
> > 8.15e-06
> > sexresp_male |   .0917239   .0510439     1.80   0.074    -.0089387
> > .1923866
> >        _cons |   .0652509   .0386968     1.69   0.093    -.0110622
> > .1415639
> >
> ------------------------------------------------------------------------------
> >
> > . matrix b0 = e(b)
> >
> > . ml model lf double_cv_4 (xb: Y_Y_C N_N Y_N N_Y = rev_incm
> > sexresp_male) (bid: bid_intl bid_low bid_high = )  /sigma1
> > >  /sigma2
> >
> > . ml init b0
> >
> > . ml maximize
> >
> > initial:       log likelihood =     -<inf>  (could not be evaluated)
> >
> > could not find feasible values
> > r(491);
> >
> > . ml check
> >
> > Test 1:  Calling double_cv_4 to check if it computes log likelihood
> > and
> >          does not alter coefficient vector...
> >          Passed.
> >
> > Test 2:  Calling double_cv_4 again to check if the same log
> > likelihood value
> >          is returned...
> >          Passed.
> >
> >
> ------------------------------------------------------------------------------
> > The initial values are not feasible.  This may be because the initial
> > values
> > have been chosen poorly or because there is an error in double_cv_4
> > and it
> > always returns missing no matter what the parameter values.
> >
> > Stata is going to use ml search to find a feasible set of initial
> > values.
> > If double_cv_4 is broken, this will not work and you will have to
> > press Break
> > to make ml search stop.
> >
> > Searching...
> > initial:       log likelihood =     -<inf>  (could not be evaluated)
> > searching for feasible values
> >
> ........................................................................................
> > >
> >
> ....................................................................................................................
> > >
> >
> ....................................................................................................................
> > >
> >
> ....................................................................................................................
> > >
> >
> ....................................................................................................................
> > >
> >
> ....................................................................................................................
> > >
> >
> ....................................................................................................................
> > >
> >
> ....................................................................................................................
> > >
> >
> ........................................................................................................
> >
> > could not find feasible values
> > r(491);
> >
> >
> > . ml query
> >
> > Method:           lf
> > Program:          double_cv_4
> > Dep. variables:   Y_Y_C N_N Y_N N_Y bid_intl bid_low bid_high
> > 4 equations:
> >         xb:       rev_incm sexresp_male
> >        /bid
> >        /sigma1
> >        /sigma2
> > Search bounds:
> >         xb:            -inf       +inf
> >        /bid            -inf       +inf
> >        /sigma1         -inf       +inf
> >        /sigma2         -inf       +inf
> > Current (initial) values:
> >    xb:_cons           35.081399
> >    bid:_cons          58.844529
> >    sigma1:_cons       30.126179
> >    sigma2:_cons       73.279225
> >     remaining values are zero
> >
> > .
> > end of do-file
> >
> >
> >
> >
> > ***********************************************
> > Ms. Sabah Abdullah
> > PhD Student
> > University of Bath
> > Department of Economics & Int'l Dev.
> > BATH
> > BA2 7AY
> > UNITED KINGDOM
> > *
> > *   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/
> >
>
>
> -----------------------------------------
> Maarten L. Buis
> Department of Social Research Methodology
> Vrije Universiteit Amsterdam
> Boelelaan 1081
> 1081 HV Amsterdam
> The Netherlands
>
> visiting address:
> Buitenveldertselaan 3 (Metropolitan), room Z434
>
> +31 20 5986715
>
> http://home.fsw.vu.nl/m.buis/
> -----------------------------------------
>
>
>      __________________________________________________________
> Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com
>
> *
> *   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/
>
*
*   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