new; cls; n=100; mu={5 4}; Sig={1 0.9, 0.9 1}; data=mu+rndn(n,2)*chol(Sig); x=data[.,1]; y=data[.,2]; n=rows(x); h0=1; /* bandwidth for 2D kernel */ points=99; /* # of points in 2D kernel */ {U1,U2}=Cempkern0(x,y,n,h0,points); library pgraph; graphset; _plctrl=-1; pqgwin auto; xy(U1,U2); proc(2)=Cempkern0(x,y,nn,h0,points); local n,xi,yj,index,U,kern,point1,point2,k,i,j,U1,U2; n=rows(x); xi=rankindx(x,1); yj=rankindx(y,1); index=xi~yj; U=index/n; /* kernel Monte Carlo */ kern=bikern(U,h0,points); kern=kern/maxc(maxc(kern)); points=rows(kern); point1=seqa(0,1,points)/(points-1); point2=seqa(0,1,points)/(points-1); U=zeros(nn,2); k=1; do while k<=nn; i=rndu(1,1); j=rndu(1,1); if rndu(1,1)