margins function

Fit of the model on the margins