Chi2 calculation 1D