estimating joint distribution