Flexible estimation of joint probability and joint cumulative density functions