Grubb statistic implementation