Gramian-based interaction measure