affinity function

Internal function to fit the likelihood scaling mixture model.