joint_bayes.cpp