Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72758

Maximum likelihood estimation

$
0
0
Dear all, Dear all,

I am currently trying to estimate the parameters of a limited dependent variable model, as introduced by Lesmond et al. (1999).
y=b*x-c1 if y<0
y=b*x-c2 if y>0


This is the log likelihood function:


LNF=SUM(if y<0) [ln(1/(2*pi*(sigma^2)))-((y_j+c1-b*x)^2)/(2*(sigma^2))] +SUM(if y>0) [ln(1/(2*pi*(sigma^2)))-((y+c2-b*x)^2)/(2*(sigma^2))]+

SUM(if y=0) [Ln(NCDF((c2-b*x)/sigma)- NCDF((c1-b*x)/sigma)].

Where the y and x vectors represents the dependent and independent variables, respectively. NCDF stands for normal cumulative density function.

The parameters c1, c2, b, and sigma need to be estimated.

Below you find the .ado file and the command I used for this problem.

program LDV

version 12.0

args lnf mu1 mu2 sigma

quietly replace `lnf'=ln(1/(2*_pi*(`sigma'^2)))-(
($ML_y1-`mu1')^2)/(2*(`sigma'^2)) if $ML_y1<0

quietly replace `lnf'=ln(1/(2*_pi*(`sigma'^2)))-(
($ML_y1-`mu2')^2)/(2*(`sigma'^2)) if $ML_y1>0

quietly replace `lnf'=ln(normalden(-`mu2',0,`sigma')-normalden(-`mu1',0,`sigma')) if $ML_y1==0

end

Stata command:


constraint 1 [#1]x = [#2]x

ml model lf LDV (mu1: y=x) (mu2: y=x) (sigma


I am not sure whether this is correct or not. c1 c2 are needed. So I take c1 as the -coef(constant) for mu1 and c2 as the -coef(constant) for mu2.


I would really appreciate your hep!

Lei Zou



Viewing all articles
Browse latest Browse all 72758

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>