ecmave function

Build an averaged error correction model