parameters: (w)
return_statement: return z
docstring: bhattacharyya parameter is a measure of similarity between two prob. distributions
      THEORY: sum over all y e Y for sqrt( W(y|0) * W(y|1) )
      Implementation:
      Numpy vector of dimension (2, mu//2)
      holds probabilities P(x|0), first vector for even, second for odd.
docstring_summary: bhattacharyya parameter is a measure of similarity between two prob. distributions
      THEORY: sum over all y e Y for sqrt( W(y|0) * W(y|1) )
      Implementation:
      Numpy vector of dimension (2, mu//2)
      holds probabilities P(x|0), first vector for even, second for odd.
docstring_tokens: bhattacharyya parameter is a measure of similarity between two prob . distributions THEORY : sum over all y e Y for sqrt ( W ( y|0 ) * W ( y|1 ) ) Implementation : Numpy vector of dimension ( 2 mu // 2 ) holds probabilities P ( x|0 ) first vector for even second for odd .
function: def bhattacharyya_parameter(w):
      '''
      bhattacharyya parameter is a measure of similarity between two prob. distributions
      THEORY: sum over all y e Y for sqrt( W(y|0) * W(y|1) )
      Implementation:
      Numpy vector of dimension (2, mu//2)
      holds probabilities P(x|0), first vector for even, second for odd.
      '''
      dim = np.shape(w)
      if len(dim) != 2:
          raise ValueError
  
      if dim[0] > dim[1]:
          raise ValueError
  
      z = np.sum(np.sqrt(w[0] * w[1]))
      # need all
      return z
function_tokens: def bhattacharyya_parameter ( w ) : dim = np . shape ( w ) if len ( dim ) != 2 : raise ValueError if dim [ 0 ] > dim [ 1 ] : raise ValueError z = np . sum ( np . sqrt ( w [ 0 ] * w [ 1 ] ) ) # need all return z