R script for marginal mlogr