internal.model function

Internal function for fitting outcome models