Fortunately, there is a well worked-out notion of estimating a grammar from an infinite distribution over trees (Corazza and Satta, 2006).
we can estimate parameters for a projected grammar π(G) from the tree distribution induced by G (which can itself be estimated in any manner).