Hi everyone,
I am replicating this code as follows:
clear all
webuse set "https://rlhick.people.wm.edu/econ407/data"
webuse tobias_koop
keep if time==4
su ln_wage educ pexp pexp2 broken_home
regress ln_wage educ pexp pexp2 broken_home
program define ols_mle
args lnf xb log_sigma2
qui replace `lnf' =ln(1/sqrt(2*_pi*exp(`log_sigma2'))) - (($ML_y1 - `xb')^2)/(2*exp(`log_sigma2'))
end
ml clear
ml model lf ols_mle (ln_wage=educ pexp pexp2 broken_home) (log_sigma2
Could someone help me understand what the program define component is doing?
I am trying to tie this back to the likelihood function and log likelihood equations but having a hard time trying to reconcile the code and theory. I have attached the likelihood function and log likelihood function for the two variable case.
Thank you for your help with this.


I am replicating this code as follows:
clear all
webuse set "https://rlhick.people.wm.edu/econ407/data"
webuse tobias_koop
keep if time==4
su ln_wage educ pexp pexp2 broken_home
regress ln_wage educ pexp pexp2 broken_home
program define ols_mle
args lnf xb log_sigma2
qui replace `lnf' =ln(1/sqrt(2*_pi*exp(`log_sigma2'))) - (($ML_y1 - `xb')^2)/(2*exp(`log_sigma2'))
end
ml clear
ml model lf ols_mle (ln_wage=educ pexp pexp2 broken_home) (log_sigma2

Could someone help me understand what the program define component is doing?
I am trying to tie this back to the likelihood function and log likelihood equations but having a hard time trying to reconcile the code and theory. I have attached the likelihood function and log likelihood function for the two variable case.
Thank you for your help with this.

Comment