Factor marginalization.

close #5