Hello... Here is my SAS program. I want to point out that it is not only the termination criteria values that differ from the SAS documentation, but their names also ( ABSXCONV versus ABSXTOL) prociml; start ARL(hr); shift=5; m=100; t=2*m+1; delta=2*hr[1]/t; z=-hr[1]+.5*delta; do i=2 to t; k=-hr[1]+(i-.5)*delta; z=z//k; end; do i=1 to t; zz=0; do j=1 to t; tau1=z[j, ]+(delta/2)-z[i,]; tau2=z[j, ]-(delta/2)-z[i,]; if tau1<-(hr[2]*hr[3])then fun1=tau1-(1-hr[2])*hr[3]; if abs(tau1)<=(hr[2]*hr[3])then fun1=tau1/hr[2]; if tau1>(hr[2]*hr[3])then fun1=tau1+(1-hr[2])*hr[3]; if tau2<-(hr[2]*hr[3])then fun2=tau2-(1-hr[2])*hr[3]; if abs(tau2)<=(hr[2]*hr[3])then fun2=tau2/hr[2]; if tau2>(hr[2]*hr[3])then fun2=tau2+(1-hr[2])*hr[3]; kone=z[i,]+fun1; ktwo=z[i,]+fun2; pij=probnorm(kone-shift)-probnorm(ktwo-shift); zz=zz//pij; end; if i=1 then r=zz; else r=r||zz; end; v=j(t,1,0); v[((t+1)/2),]=1; v=t(v); r=r[2:t+1,]; r=t(r); avrl=inv((I(t)-r))*j(t,1,1); bb=(v*avrl); return(bb); finish; start ARL0(hr); m1=100; shift=0; bb0=j(1,1,0.); t1=2*m1+1; delta1=2*hr[1]/t1; z1=-hr[1]+.5*delta1; do i1=2 to t1; k1=-hr[1]+(i1-.5)*delta1; z1=z1//k1; end; do i1=1 to t1; zz1=0; do j1=1 to t1; tau11=z1[j1, ]+(delta1/2)-z1[i1,]; tau21=z1[j1, ]-(delta1/2)-z1[i1,]; if tau11<-(hr[2]*hr[3])then fun11=tau11-(1-hr[2])*hr[3]; if abs(tau11)<=(hr[2]*hr[3])then fun11=tau11/hr[2]; if tau11>(hr[2]*hr[3])then fun11=tau11+(1-hr[2])*hr[3]; if tau21<-(hr[2]*hr[3])then fun21=tau21-(1-hr[2])*hr[3]; if abs(tau21)<=(hr[2]*hr[3])then fun21=tau21/hr[2]; if tau21>(hr[2]*hr[3])then fun21=tau21+(1-hr[2])*hr[3]; kone1=z1[i1,]+fun11; two1=z1[i1,]+fun21; pij1=probnorm(kone1-shift)-probnorm(ktwo1-shift); zz1=zz1//pij1; end; if i1=1 then r1=zz1; else r1=r1||zz1; end; v1=j(t1,1,0); v1[((t1+1)/2),]=1; v1=t(v1); r1=r1[2:t1+1,]; r1=t(r1); avrl1=inv((I(t1)-r1))*j(t1,1,1); bb0[1]=1000-(v1*avrl1); return(bb0); finish; con = { 0 0 0, . 1 . }; hr={2.015 0.354 1.989}; optn= j(1,11,.);optn[2]=5;optn[10]=1;optn[11]=0; CALL NLPNMS(rc,hrres,"ARL",hr) blc=con opt=optn nlc="ARL0"; quit;
... View more