def prob_bv_rectangle(lower, upper, cdf):
 probuu = cdf(*upper)
 probul = cdf(upper[0], lower[1])
 problu = cdf(lower[0], upper[1])
 probll = cdf(*lower)
 return (((probuu - probul) - problu) + probll)

def prob_bv_rectangle ( lower , upper , cdf ) : probuu = cdf ( * upper ) probul = cdf ( upper [ 0 ] , lower [ 1 ] ) problu = cdf ( lower [ 0 ] , upper [ 1 ] ) probll = cdf ( * lower ) return ( ( ( probuu - probul ) - problu ) + probll )
helper function for probability of a rectangle in a bivariate distribution parameters lower : array_like tuple of lower integration bounds upper : array_like tuple of upper integration bounds cdf : callable cdf .