i calculated the integral with quad function and then used the log function for the result of the quad like this: proc nlp out=solve_x; max chi_comma; decvar x; p_hat=CDF('NORMAL',(&gamma.-x*&r.)/((1-(&r.**2))**0.5),0,1); chi=&d.*log(p_hat)+(&m.-&d.)*log(1-p_hat); chi_comma=chi-(x**2)/2; run; data _null_; set solve_x; call symput("theta", chi_comma); run; %put max of chi_comma is θ proc iml; pi = constant("pi"); start toint(x); p_hat=CDF('NORMAL',(&gamma.-x*&r.)/((1-(&r.**2))**0.5),0,1); p=exp(&d.*log(p_hat)+(&m.-&d.)*log(1-p_hat)-&theta.-x**2/2); return(p); finish; interval = .M || .P; call quad(pm,"toint",interval); print pm[format=E21.14]; psi=(log((1/((2*pi)**0.5))*pm)+&theta.); print psi[format=E21.14]; quit;
... View more