Bookmark and Share

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]

st: ml graph returns error


From   B Villena <[email protected]>
To   Statalist <[email protected]>
Subject   st: ml graph returns error
Date   Mon, 21 Mar 2011 14:12:24 -0400

>
> Dear Maarten,
>
> I apologize for not proving enough details. Here I provide much more details
>
> My model looks like this
>
> program mymod
> args lnf xv xi phi z
> tempvar xb
> qui gen double `xb' = (`xv'-$xm)*(`phi'*(`xi'-$xm)+$xm-`z')
> qui replace `lnf' =ln(normal(`xb' )) if $ML_y1==1
> qui replace `lnf' =ln(1-normal(`xb' )) if $ML_y1==0
> end
>
> where $xm is just a given constant. I checked that this model is identified, in the sense that all first-order conditions are linearly independent.
>
> Then I run my model by using ml
>
> ml model lf voter_lf (Xv: q = A_*, nocons) (Xi: B_*, nocons) (phi:) (lambda: zs, nocons)
>
> where A_* is a set of saturated dummy variables, i.e. sum of all A_ add up to 1; and B_* is another set of saturated dummies. Of course, A and B variable sets are linearly independent, i.e.
> if for all observations with A_j==1 there are some of them for which B_k==0 and B_k==1 for all k=1,2,3,....K, and j=1,2,3,...J
>
> Here is the problem. If I run
> ml model lf mymod (Xv: q = A_*, nocons) (Xi: B_*, nocons) (phi:) (lambda: zs, nocons)
> ml search
> ml check
> ml maximize
> ml graph
>
> everything looks just fine. The model passes all 10 checks and the model is estimated with sensible parameters.
> The first problem occurs at this stage. I'm running this model many times for different samples. Although I obtain the ml estimates, ml graph returns an error message
>
> Mopt_graph_gen(): 3301 subscript invalid
> : - function returned error
> r(3301);
> r(3301);
>
>
> The second problem arises when I put ml check after ml search. Specifically, I run
>
> ml model lf mymod (Xv: q = A_*, nocons) (Xi: B_*, nocons) (phi:) (lambda: zs, nocons)
> ml check
> ml search
> ml maximize
> ml graph
>
> I get the following error
>
> Test 1: Calling voter_lf to check if it computes log likelihood and
> does not alter coefficient vector...
> opt__eval_cycle(): 3301 subscript invalid
> opt__eval(): - function returned error
> _optimize_evaluate(): - function returned error
> _mopt__evaluate(): - function returned error
> mopt__check_test1(): - function returned error
> _moptimize_check(): - function returned error
> Mopt_check(): - function returned error
> : - function returned error
> r(3301);
> r(3301);
>
> I hope this information is accurate enough. Please let me know any problem you may notice here
>
> Best regards,
>
> Benjamin 		 	   		  
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index