recursive function

recursive marginal interactions