Functions for simulation of Mixed Models