Compiling and fitting the model