compute chisqcube