/** MLE: LOGIT MODEL ***/ new; output file = test.OUT reset; format 8,4; library optmum; optset; /* _opstmth="steep one";*/ /* _opmdmth="bfgs stepbt"; */ x1 = ones(10,1); let x2 = 40 61 47 48 66 63 60 45 63 42; x = x1~x2; let y = 0 1 1 0 1 1 0 1 1 0; b0 = {-6,.14}; {c,f,g,retcode} = optmum(&fct,b0); "C = " c;?; "F = " f; ?; proc fct(b); local dev; dev=-1.*(y.*ln(exp(x*b)./(x1+exp(x*b)))+ (1-y).*ln(1-(exp(x*b)./(x1+exp(x*b))))); retp(sumc(dev)); endp; end;