function cv = ugcv(x,h)
n=size(x,1);
c1 = 1/((n^2)*sqrt(2*pi)*sqrt(2));
c2 = 2/(n*(n-1));
dx = gsubtract(x,x');
dx2=dx.^2;
cv = (1/h)*c1*sum(sum(exp(-0.25*(1/h^2)*dx2)))-c2*(1/h)*sum(sum(((1/sqrt(2*pi))*exp(-0.5*(1/h^2)*dx2))-diag(diag(((1/sqrt(2*pi))*exp(-0.5*(1/h^2)*dx2)),0),0)));

