Model clustering and model averaging