| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: error message with ml maximization
Hey, I wrote a little do file to estimate a simutanous equation system with
switch regime and get the following error message:
*************************************************************************
initial: log likelihood = -<inf> (could not be evaluated)
feasible: log likelihood = -38722.421
rescale: log likelihood = 95133.127
rescale eq: log likelihood = 230929.35
could not calculate numerical derivatives
discontinuous region with missing values encountered
r(430);
end of do-file
r(430);
*************************************************************************************
Here is my code.
*************************************************************************************
capture program drop myml
program myml
version 8.0
args lnf theta1 theta2 lamda alpha1 beta1 beta3 sigma1 sigma2
sigma12
tempvar u1 u21 u22 r T1 T2 Badet f
quietly {
gen double `u1' = $ML_y1 - `theta1' - `alpha1'*lp
gen double `u21' = $ML_y2 - `theta2' - `beta1'*lq
gen double `u22' = $ML_y3 - `theta2' - `beta1'*lq - `beta3'
gen double `r' = `sigma12'/(`sigma1'*`sigma2')
gen double `T1' =
((`u1'/`sigma1')^2-2*`r'*(`u1'/`sigma1')*(`u21'/`sigma2')+(`u21'/`sigma2')^2)/(2*(1-`r'^2))
gen double `T2' =
((`u1'/`sigma1')^2-2*`r'*(`u1'/`sigma1')*(`u22'/`sigma2')+(`u22'/`sigma2')^2)/(2*(1-`r'^2))
gen double `Badet' = abs(1-`alpha1'*`beta1')
gen double `f' =
`Badet'*(`lamda'*exp(-`T1')+(1-`lamda')*exp(-`T2'))/(2*_pi*`sigma1'*`sigma2'*(1-`r'^2)^.5)
replace `lnf' = log(`f')
}
end
ml model lf myml (demand: lq = lakes md*) (supply: lp = dm* md*) /lamda
/alpha1 /beta1 /beta3 /sigma1 /sigma2 /sigma12
ml maximize
***************************************************************************************************************************************************
Could anyone give me some idea about what is going wrong? Thanks a lot!
Best,
Luhang
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
*
* 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/