AnalyseResiduals function

AnalyseResiduals