added PatternModelInterface for more abstraction.. Used by train() to contrain training with a joint model