compareModels function

Generic function for model comparison