Hi Rick, the following is the sample codes I have. (I only keep one penalty value) proc iml; start penalty1(m,a); v=m-a; return(choose(v>0,0,v##2)); finish; start sumsqr(a) global(m1); d1=a[1:nrow(a)-1,1:ncol(a)]; p1=ssq(penalty1(d1,0.01)); ccc=(a-m1)##2; zzz=sum(ccc)+p1; return (zzz); finish; aaa={0.8 0.15 0.04 0.01, 0.1 0.8 0.09 0.01, 0.05 0.1 0.8 0.05, 0 0 0 1}; m1={0.7 0.25 0.04 0.01, 0.2 0.7 0.09 0.01, 0.05 0.2 0.7 0.05, 0 0 0 1}; test=sumsqr(aaa); print test; x0=j(4,4,0.1); opt={1,4}; call nlpnra(rc, result, "sumsqr", x0, opt); quit;
... View more