Hi,
Has anyone ever programmed the Klein-Spady semiparametric estimator? I
have tried to do so by creating my own ml program and including a kernel
function; the ml passes all tests but when maximizing the likelihood
function it shows "(non-concave)". Any ideas how to proceed now?
Reference: Klein, R. & R.Spady (1993) "An efficient semiparametric
estimator for discrete choice models", Econometrica, 61, 387-421. Or:
Green (2000: p.847) for the likelihood function.
Here is my code:
program klein_spady_lf
version 9.1
args lnf xb
quietly {
tempvar number_yes number_no tmp1 tmp2 Gn
summarize $ML_y1, meanonly
gen double `number_yes' = r(mean)
gen `number_no' = 1 - `number_yes'
kdensity `xb' if $ML_y1==1, nogr gaussian width(.5)
gen(`tmp1') at(`xb')
kdensity `xb' if $ML_y1==0, nogr gaussian width(.5)
gen(`tmp2') at(`xb')
replace `tmp1' = `tmp1'*`number_yes'
replace `tmp2' = `tmp2'*`number_no'
gen double `Gn' = `tmp1'/(`tmp1'+`tmp2')
replace `lnf' = log(`Gn')/_N if $ML_y1==1
replace `lnf' = log(1-`Gn')/_N if $ML_y1==0
}
end
Ben D'Exelle
Institute of Development Policy and Management
University of Antwerp
*
* 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/