Error-correction modelling in discrete and continuous time