Add computeAverageError() and plotAverageError()