/* ** Lesson 6.6: Maximizing Log-Likelihood Function ** Estimating a CES Production Function ** See Judge, et. al. [1988], Chapter 12 */ use gpe2; output file=gpe\output6.6 reset; load x[30,3]=gpe\judge.txt; call reset; _nlopt=1; _method=5; _iter=100; _tol=1.0e-5; _vcov=1; _b={1.0,0.5,-1.0,-1.0,1.0}; call estimate(&cesll,x); end; /* Objective Function */ proc cesll(data,b); @ log-likelihood function @ local l,k,q,e,n; l=data[.,1]; k=data[.,2]; q=data[.,3]; e=ln(q)-b[1]-b[4]*ln(b[2]*l^b[3]+(1-b[2])*k^b[3]); n=rows(e); retp(-0.5*n*(ln(2*pi)+ln(b[5]^2))-0.5*sumc((e./b[5])^2)); endp;