Hello everyone, this is the code i am writing to estimate MLE estimates. while writing this program i am trying to check this program by ML check command and getting "prob1l^ invalid name". it is showing that invalid name in the program. this i am unable to understand. please help me on this problem.
Test 1: Calling HL_cpt0 to check if it computes log likelihood and
does not alter coefficient vector...
FAILED; HL_cpt0 returned error 198.
Here is a trace of its execution:
------------------------------------------------------------------------------
-> HL_cpt0 __000008 __000009
- `begin'
= capture noisily version 12: HL_cpt0 __000008 __000009
----------------------------------------------------------------------------------------------------------------------------------------- begin HL_cpt0 ---
- args lnf alpha gamma
- tempvar choices prob1l prob2l prob1r prob2r y1 y2 y3 y4 euL euR euDiff tmp
- quietly {
- generate double `tmp' = (($ML_y2^`gamma')+((1-$ML_y2)^`gamma'))
= generate double __00000M = ((prob1l^)+((1-prob1l)^))
prob1l^ invalid name
replace `tmp' = `tmp'^(1/`gamma')
generate double `prob1l' = ($ML_y2^`gamma')/`tmp'
generate double `prob2l' = ((1-$ML_y2)^(`gamma'))/`tmp'
replace `tmp' = (($ML_y3^`gamma')+((1-$ML_y3)^`gamma'))
replace `tmp' = `tmp'^(1/`gamma')
generate double `prob1r' = ($ML_y3^`gamma')/`tmp'
generate double `prob2r' = ((1-$ML_y3)^(`gamma'))/`tmp'
generate double `y1' = ($ML_y4)^(`alpha') if $ML_y4>=0
generate double `y2' = ($ML_y5)^(`alpha') if $ML_y5>=0
generate double `y3' = ($ML_y6)^(`alpha') if $ML_y6>=0
generate double `y4' = ($ML_y7)^(`alpha') if $ML_y7>=0
gen double `euL'=(`prob1l'*`y1')+(`prob2l'*`y2')
gen double `euR'=(`prob1r'*`y3')+((1-`prob2r')*`y4')
generate double `euDiff' = `euR' - `euL'
replace `lnf' = ln(normal( `euDiff')) if $ML_y1==1
replace `lnf' = ln(normal(-`euDiff')) if $ML_y1==0
}
------------------------------------------------------------------------------------------------------------------------------------------- end HL_cpt0 ---
- `end'
= set trace off
------------------------------------------------------------------------------
Fix HL_cpt0.
r(198);
Related Posts with difficult to find the problem in MLE coding
Diff-in-Diff policy analysis: supress intercept to obtain policy effect?Dear Statalists, I am currently writing my ba thesis on the effectivness of Environmental Policy usi…
Random slopes for second level variables in mixedDear, We are wondering if it makes sense to allow random slopes for second level variables in a two…
Factor variable notation and exporting to excel tableHey everyone, I have a question on whether it is at all possible to export summary statistics to an …
spxtregress command errorDear all I am trying to use spatial regression commands in STATA in a panel data set up. Basically,…
Generate a group if an ID starts with an AHi all, I am trying to generate a group=1 if an ID starts with a certain letter/number. Do you have…
Subscribe to:
Post Comments (Atom)
0 Response to difficult to find the problem in MLE coding
Post a Comment