def transform_bilogistic(t, beta, delta):
 def _check_args(beta, delta):
  cond1 = ((beta > 0) and (beta <= 1) and (delta > 0) and (delta <= 1))
  cond2 = ((beta < 0) and (delta < 0))
  return (cond1 | cond2)
 if (not np.all(_check_args(beta, delta))):
  raise ValueError('invalid args')
 def _integrant(w):
  term1 = (((1 - beta) * np.power(w, (- beta))) * (1 - t))
  term2 = (((1 - delta) * np.power((1 - w), (- delta))) * t)
  np.maximum(term1, term2)
 from scipy.integrate import quad
 transf = quad(_integrant, 0, 1)
 return transf

def transform_bilogistic ( t , beta , delta ) : def _check_args ( beta , delta ) : cond1 = ( ( beta > 0 ) and ( beta <= 1 ) and ( delta > 0 ) and ( delta <= 1 ) ) cond2 = ( ( beta < 0 ) and ( delta < 0 ) ) return ( cond1 | cond2 ) if ( not np . all ( _check_args ( beta , delta ) ) ) : raise ValueError ( 'invalid args' ) def _integrant ( w ) : term1 = ( ( ( 1 - beta ) * np . power ( w , ( - beta ) ) ) * ( 1 - t ) ) term2 = ( ( ( 1 - delta ) * np . power ( ( 1 - w ) , ( - delta ) ) ) * t ) np . maximum ( term1 , term2 ) from scipy . integrate import quad transf = quad ( _integrant , 0 , 1 ) return transf
bilogistic model of coles and tawn 1994 .