How to model very complicated likelihood automatically?