n-dimensional correlation