In terms of actual implementation I have this in mind: http://www.phenix-online.org/newsletter/CCN_2011_01.pdf "Maximum likelihood refinement of twinned structures", page 29.