function S = Psi(K,m,n) S = 0; for t=1:n S = S + sum(K.*(K>0)); K = getK1(K,m,n-t+1); end return