KGE function

KGE computation