function [KullbackLeibner ,pLWtest] = LWtest(Sigma,N,T)

Omega = diag(diag(Sigma.^0.5))*inv(Sigma)*diag(diag(Sigma.^0.5));
KullbackLeibner = 0.5*N*T*((1/N)*trace((Omega-eye(N))^2)-N/T*(1/N*trace(Omega))^2+N/T);
pLWtest = 1- chi2cdf(KullbackLeibner,N*(N+1)/2);
end